docs(i18n): keep auto-translate routine to a single open PR#488
Conversation
Switch the routine from a date-stamped branch (claude/translations-<date>, which opened a new PR on every daily/push-triggered run) to a single long-lived claude/translations branch. Re-runs now locate the open PR, rebase the branch onto main, translate only the new gaps, and update the existing PR in place instead of opening another. Detection runs on the branch so already-translated units (and reviewer corrections) are not re-flagged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQH6VBPhDr46yJMMH9dGcJ
📝 WalkthroughWalkthroughThe translation routine in ChangesTranslation routine: single long-lived PR strategy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit b31cc35
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
Visit the preview URL for this PR (updated for commit afd58d9): https://pushup-stats-staging-867b7--pr-488-7r8cjfsu.web.app (expires Sat, 27 Jun 2026 16:28:30 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 43c298a3304e6b54e102dc177faff73680808e1e |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c08d03826
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR updates the Claude auto-translate routine documentation/prompt so translation work is managed through a single long-lived branch (claude/translations) and a single PR that gets updated in place, avoiding one-PR-per-run accumulation.
Changes:
- Switch translation PR flow from date-stamped branches to a single
claude/translationsbranch with in-place PR updates. - Add explicit “exit decision” behavior for runs with no gaps vs. an already-open translation PR.
- Document the single-PR behavior in the i18n gotchas guide.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
docs/gotchas/i18n.md |
Documents the “single open translations PR” behavior and when the routine exits vs. leaves an existing PR open. |
.claude/routines/translate.md |
Updates the routine prompt to find/reuse a single PR/branch, detect gaps on that branch, and update the PR in place. |
…fresh Address PR review: the rebase + hard-reset-on-conflict fallback could silently discard reviewer corrections on the open PR, and the push guidance wrongly assumed history was always rewritten. Switch the reuse path to a non-rewriting merge of main into claude/translations (stop and report on conflict instead of discarding), so plain fast-forward pushes suffice everywhere and no force-push is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQH6VBPhDr46yJMMH9dGcJ
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/routines/translate.md:
- Around line 188-215: The instructions reference a `<count>` placeholder in the
commit message (line 194) and PR title (line 208-209) but don't specify how to
calculate it. The definition states it should be "the number of translation
items this branch adds over main (XLIFF units flipped to translated + new
blog/wiki files)" but this differs from the detector's gap_count. Add a
clarification step after the translation work is completed but before
committing: explain that `<count>` must be computed by analyzing the actual
changes made (either by re-running the gap detector and comparing the output, or
by examining the git diff to count XLIFF units where state changed from initial
to translated, plus new blog/wiki files created). Make explicit which approach
is preferred and where to perform this count calculation in the workflow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 986f5831-a712-4a96-9f11-2a371ed682bb
📒 Files selected for processing (2)
.claude/routines/translate.mddocs/gotchas/i18n.md
Address CodeRabbit review: the routine referenced a <count> placeholder in the commit message and PR title without saying how to derive it. Make it explicit — count XLIFF units now translated plus new blog/wiki files in the diff against origin/main (not the detector's single-run gap_count, which undercounts an accumulated PR) — and point the PR title at the same value. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQH6VBPhDr46yJMMH9dGcJ
What
Updates the Claude auto-translate routine so it keeps exactly one open translation PR at a time and updates the already-open one instead of opening a new PR on every run.
Why
The routine is triggered daily (06:00 UTC) and on every push to
mainthat touches i18n source. Previously it created a fresh date-stamped branchclaude/translations-<YYYY-MM-DD>and opened a new PR each run, so open translation PRs accumulated — one per run — until each was merged.How
In
.claude/routines/translate.md(the routine prompt) the flow becomes:claude/translations; if severalchore(i18n)PRs somehow exist, converge back to one.claude/translations(no date suffix):origin/maininto it — a non-rewriting update that preserves every commit on the PR, including human review corrections. On merge conflict, abort and stop/report rather than discarding history.main.state="translated"and aren't re-flagged — only genuinely new gaps are added.claude/translations— because step 2 only ever merges (never rewrites history), no force-push is needed.update_pull_requestrefreshes title + body) — never a second one. The title<count>is derived from the branch's diff againstorigin/main(XLIFF units nowtranslated+ new blog/wiki files), not the detector's single-rungap_count.New steady-state handling: if there are no new gaps but a translation PR is already open, the routine re-pushes only if
mainadvanced (to keep it mergeable) and otherwise leaves it to merge. On merge, the branch is deleted (squash + delete branch) so the next run starts clean frommain.docs/gotchas/i18n.mdis updated to describe the single-PR / update-in-place behavior.Notes
tools/src/detect-translation-gaps.mjs) and seeder are untouched, so no code tests are affected.Allow unrestricted branch pushessetting can stay off; the routine only ever fast-forward-pushes the singleclaude/translationsbranch.🤖 Generated with Claude Code
https://claude.ai/code/session_01NQH6VBPhDr46yJMMH9dGcJ