ci(#6825): retry CreateBranch on fork replication errors - #6827
ci(#6825): retry CreateBranch on fork replication errors#6827fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
GitHub's fork replication is eventually consistent — the default-branch ref can pass awaitForkReady's GetBranchRef poll but become temporarily unavailable when CreateBranch re-fetches it moments later, producing a 409 "Git Repository is empty" error. Add createForkBranch, a retry wrapper around CreateBranch that retries on 409/422 replication errors (up to 5 attempts with 2s backoff). whenForkPullRequestOpened now uses this wrapper instead of a bare CreateBranch call. Also add isReplicationError to classify transient fork replication failures (409, and 422 with "does not exist" or "empty" messages) separately from permanent errors like permission denied. Note: golangci-lint was not available in the sandbox. gofmt and go vet passed. Pre-commit could not fetch remote hook repos (network restriction); local hooks (gofmt, go vet) ran directly and passed. Closes #6825
|
🤖 Finished Review · ✅ Success · Started 8:46 PM UTC · Completed 9:02 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.15 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsSmall, focused change (2 files, 182 lines) adding retry logic for fork replication errors with good test coverage (50% test file ratio). Bot author with prior contributions. Elevated fix/revert churn in git history indicates an active bug area, but the change is well-scoped to the linked issue and easy to roll back. |
ReviewFindingsLow
|
Summary
CreateBranchin fork PR scenarios to handle transient GitHub fork replication errors (409/422)awaitForkReadyconfirms the default-branch ref is readable, but GitHub's eventually-consistent replication can make it temporarily unavailable again whenCreateBranchre-fetches it moments latercreateForkBranchwrapper retries up to 5 times with 2s backoff;isReplicationErrorclassifies 409 and 422 replication errors separately from permanent failuresTesting
isReplicationError(6 tests) andcreateForkBranch(5 tests) — all at 100% coveragego vetcleanCloses #6825
Post-script verification
agent/6825-fork-branch-retry)2a29f774dbf5707909c4265d10b2b4b324c8a344..HEAD)