Skip to content

[luv-325] fix: stop translate-docs workflow from dropping translations when an auto-PR is open#325

Merged
NiveditJain merged 1 commit intomainfrom
luv-325
May 9, 2026
Merged

[luv-325] fix: stop translate-docs workflow from dropping translations when an auto-PR is open#325
NiveditJain merged 1 commit intomainfrom
luv-325

Conversation

@NiveditJain
Copy link
Copy Markdown
Member

@NiveditJain NiveditJain commented May 9, 2026

Summary

The 14 i18n READMEs are stuck on the pre-redesign 358-line layout while the English README is now 171 lines. Root cause is a translate-docs.yml consolidate-step bug that drops translations when an auto-PR is mid-flight.

The per-language Translate jobs in run 25588145237 (triggered by the README rewrite in #321) successfully re-translated all 14 i18n READMEs — visible in logs as translated (3258+3048 tokens) lines. The consolidate job then logged Translation PR already open. Skipping. because an unrelated auto-PR was mid-flight, and exited 0. But the cache-save step had already run before that check, so the cache advanced to mark the lost translations as done. The next two runs (#322, #323) saw the README as cached and PR #324 only contained 14 dashboard.mdx files.

Fix

When an [auto] update translations PR is already open:

  • Snapshot the freshly-generated docs/ tree + merged cache via tar (before any branch ops)
  • Fetch and force-checkout the existing PR's branch
  • Untar on top so the newest English source always wins over whatever the PR branch held
  • Push to the same branch (no new PR)

PR creation only fires when no existing PR matched.

Test plan

  • Dispatch the workflow on main after merge with force=true and confirm a new auto-PR contains all 14 README translations matching the current 171-line English layout
  • Trigger a docs change (or a forced run) while the auto-PR from above is still open and confirm the second run pushes its translations to the same branch instead of skipping

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved the automated translation workflow to efficiently update existing translation PRs instead of creating duplicate entries, ensuring a streamlined documentation maintenance process.

…s when an auto-PR is open

Previously the consolidate step exited early if any "[auto] update
translations" PR was open and the cache-save step ran first, so
translations queued during a busy push window were marked done in
cache but never landed in any branch. Empirically verified against
the README rewrite in #321: the per-language `Translate` jobs
successfully translated all 14 i18n READMEs (visible in run
25588145237 logs as `translated (3258+3048 tokens)` lines), but the
consolidate job logged `Translation PR already open. Skipping.` and
PR #324 only contained 14 dashboard.mdx files — the 14 README
translations were stuck on the pre-redesign 358-line layout while
the English README dropped to 171 lines.

Fix: when an auto-PR is open, snapshot the freshly-generated docs/
tree + merged cache via tar before any branch ops, fetch and
force-checkout the existing PR's branch, then untar on top so the
newest English source always wins. PR creation only fires when no
existing PR matched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b6b78544-0e76-4003-a6c7-a6e007f19b27

📥 Commits

Reviewing files that changed from the base of the PR and between e9579f1 and 2d053b3.

📒 Files selected for processing (2)
  • .github/workflows/translate-docs.yml
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

The translate-docs workflow now conditionally updates or creates auto-translation pull requests. Instead of skipping when an open PR exists, it snapshots generated documentation and translation cache, then either updates the existing PR's branch via tarball extraction and push, or creates a new PR if none is open.

Changes

Auto-Translation PR Update Logic

Layer / File(s) Summary
Workflow Logic - Existing PR Update or New PR Creation
.github/workflows/translate-docs.yml
The workflow queries for an existing open [auto] update translations PR and snapshots generated docs/ plus .translation-cache.json. If a PR is found, it fetches and force-checks out the existing branch, extracts the snapshot, commits, and pushes updates. If no PR exists, it creates a new branch, commits, pushes, and creates a new PR.
Changelog Entry
CHANGELOG.md
Unreleased Fixes section documents the workflow behavior change to update existing auto-translation PR branches instead of skipping them.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit hops through git commits with glee,
Auto-translations dance in harmony,
No skipped PRs, just updates so fleet,
Where snapshots and branches beautifully meet!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix: preventing the translate-docs workflow from dropping translations when an auto-PR already exists, matching the core change in the PR.
Description check ✅ Passed The PR description is comprehensive, covering summary, root cause, fix details, and test plan. However, the required template checklist items (npm run lint, tsc, test:run, build) are not included or marked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@NiveditJain NiveditJain merged commit af4e98a into main May 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant