docs: require i18n postprocess before skip#61960
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cd0ed3237
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR fixes a correctness bug in the The fix is minimal and well-targeted:
The logic in
Confidence Score: 4/5Safe to merge — the fix is minimal, logically correct, and well-covered by new regression tests. Score reflects a clean, targeted bug fix with thorough test coverage and no critical issues identified. One minor dead-assignment in test code prevents a perfect score. No files require special attention beyond the minor style note in scripts/docs-i18n/main_test.go. Prompt To Fix All With AIThis is a comment left during a code review.
Path: scripts/docs-i18n/main_test.go
Line: 94-96
Comment:
**Dead variable assignment before immediate overwrite**
The `outputPath` declared on line 94 is never read — it is unconditionally overwritten two lines later by the `:=` on line 96. Both computations produce the same path (`filepath.Join(docsRoot, "zh-CN", "gateway", "index.md")`), so there is no behavioral impact, but the first declaration is dead code. Consider removing it and relying solely on the return value from `processFileDoc`:
```suggestion
skip, outputPath, err := processFileDoc(context.Background(), fakeDocsTranslator{}, docsRoot, sourcePath, "en", "zh-CN", true)
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "docs: require i18n postprocess before sk..." | Re-trigger Greptile |
139a0fa to
2c7d62a
Compare
2c7d62a to
169f7d5
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open for maintainer handling: this draft, MEMBER-authored, maintainer-labeled PR is superseded by #92668 and current main has the more complete output-state implementation, but protected item rules prevent automatic cleanup close. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this PR as superseded by #92668. So I’m closing this here and keeping the remaining discussion on #92668. Review detailsBest possible solution: Close this PR as superseded by #92668. Do we have a high-confidence way to reproduce the issue? Yes at source level. The branch returns false for matching-hash non-English legacy outputs without postprocess_version, while current main classifies that same state as docOutputNeedsPostprocess and has regression tests for it. Is this the best way to solve the issue? No. The merged replacement is the better fix because it makes output readiness explicit, preserves legacy localized outputs, and tests the postprocess-only and max-bound paths this branch lacks. Security review: Security review cleared: No concrete security or supply-chain concern found; the diff is limited to local docs-i18n Go script logic and tests with no dependency, workflow, lockfile, credential, or execution-source change. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 7bbd09047bd7; fix evidence: commit eaeedbf1f96b, main fix timestamp 2026-06-13T13:17:03Z. |
|
Thanks @hxy91819. Closing as superseded by your later #92668, which explicitly supersedes this branch and shipped in v2026.6.8. Current main uses explicit needs-translation, needs-postprocess, and ready output states; preserves legacy matching-hash localized outputs without retranslating them; honors the |
Summary
postprocess_version: pendingand finalize them only after locale-link postprocess succeedsRoot cause
postprocessLocalizedDocs(...)runsx-i18n.source_hash, so a later postprocess failure could leave stale English-root links on disk--overwrite=false,shouldSkipDoc(...)only looked atsource_hash, so the broken file could be skipped indefinitely unless the English source changedFix
encodeFrontMatter(...)now writesx-i18n.postprocess_version: pendingpostprocessLocalizedDocs(...)upgrades that marker to the current postprocess version only after it rewrites or finalizes the fileshouldSkipDoc(...)now requires both a matchingsource_hashand the current postprocess version before it skips a localized fileTest plan
go test ./...inscripts/docs-i18n