Skip to content

fix(cli): checkout i18n branch from remote instead of HEAD#2049

Merged
AndreyHirsa merged 2 commits intomainfrom
fix/ci-checkout-existing-i18n-branch
Mar 24, 2026
Merged

fix(cli): checkout i18n branch from remote instead of HEAD#2049
AndreyHirsa merged 2 commits intomainfrom
fix/ci-checkout-existing-i18n-branch

Conversation

@AndreyHirsa
Copy link
Copy Markdown
Contributor

@AndreyHirsa AndreyHirsa commented Mar 18, 2026

Summary

Fix CI pull request flow to checkout existing translation branch from remote instead of HEAD, preventing duplicate PRs when the original is merged during a concurrent run.

Changes

  • Fixed checkoutI18nBranch in pull-request.ts to create the local branch from remote instead of HEAD, so existing translations are preserved
  • This eliminates unnecessary re-translation of already-translated content when the translation branch exists

Testing

  • All tests pass locally

Visuals

N/A

Checklist

  • Changeset added (if version bump needed)
  • Tests cover business logic (not just happy path)
  • No breaking changes (or documented below)

Summary by CodeRabbit

  • Bug Fixes
    • Fixed CI pull request flow to properly reuse existing translation branches instead of starting from scratch, preventing duplicate PRs during concurrent runs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

A patch release is declared via changeset, fixing a bug in the CI pull request flow for i18n branch handling. The git checkout command is updated to explicitly track the remote branch, ensuring the local branch reuses existing translation branches instead of creating duplicates during concurrent CI runs.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/heavy-areas-happen.md
Declares patch release documenting the i18n branch reuse fix to prevent duplicate PRs during concurrent CI runs.
CI Pull Request Flow
packages/cli/src/cli/cmd/ci/flows/pull-request.ts
Updates git checkout command from git checkout -b <branch> to git checkout -b <branch> origin/<branch> to establish explicit remote tracking for the local i18n branch.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • cherkanovart

Poem

🐰 A branch now tracks its distant twin,
No more duplicates pile in!
Concurrent runs need not despair,
When remotes and locals properly pair. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: fixing the CI checkout flow to use remote instead of HEAD for the i18n branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description follows the template structure with Summary, Changes, Testing, Visuals, and Checklist sections. All required sections are present with substantive content.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-checkout-existing-i18n-branch
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@AndreyHirsa AndreyHirsa marked this pull request as draft March 19, 2026 15:08
@AndreyHirsa AndreyHirsa marked this pull request as ready for review March 24, 2026 09:45
@AndreyHirsa AndreyHirsa merged commit 2aa4145 into main Mar 24, 2026
13 checks passed
@AndreyHirsa AndreyHirsa deleted the fix/ci-checkout-existing-i18n-branch branch March 24, 2026 09:45
vrcprl pushed a commit that referenced this pull request Apr 17, 2026
* fix(cli): checkout i18n branch from remote instead of HEAD

* fix(cli): add changeset
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.

2 participants