Repository navigation
feat: review sweep auto-updates a cleanly-behind PR branch via GitHub's update-branch API - #630
Conversation
…'s update-branch API Follow-up to the review-sweep BEHIND friction hit repeatedly this session (PRs #621, #623, #627 all needed a manual git merge origin/master before they could merge). run_review_sweep now checks PrCiStatus::Behind (GitHub's own mergeable_state == "behind" -- mergeable, no conflict, just missing base-branch commits) before ever fetching CI check runs for that PR, and calls pulls::update_branch (the same server-side operation the PR page's own "Update branch" button triggers) to bring it current, letting CI re-run naturally. Entirely server-side: no local worktree/git state touched, so it can't race a concurrently-dispatched job still pushing to the same branch the way a local git merge would. Agentflare-Agent: claude-code Agentflare-Branch: task/review-sweep-update-branch Agentflare-Session: e77fc32e-33d0-4884-ab55-fdda48fe45fd
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe review sweep now detects pull requests behind the base branch, updates stale branches through GitHub, tracks successful updates, and reports the updated count in dashboard logs. ChangesStale branch update flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change automatically updates cleanly-behind pull request branches through GitHub without altering local worktrees. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, implementation, behavior, and test results. It includes Summary and Test plan sections. The optional Notes for reviewers section is missing, but the description is otherwise complete.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Summary
PRs #621, #623, and #627 all hit
mergeStateStatus: BEHINDthis session and needed a manualgit merge origin/masterin the item's worktree before they could merge — nothing was watching for or fixing this automatically, even thoughrun_review_sweepalready polls every in-review item's PR status every tick.Changes
PrCiStatusgains aBehind { number }variant, checked inpr_ci_status_implright after the merged check and before check-runs are ever fetched — GitHub's ownmergeable_state == "behind"already means "mergeable, no conflict, just missing base-branch commits," so there's no point fetching CI for checks the branch update is about to invalidate anyway.worktree::update_stale_branchcalls the newgithub::pulls::update_branch, which isPUT /pulls/{number}/update-branch— the same server-side operation the PR page's own "Update branch" button triggers. Entirely server-side: no local worktree/git state touched, so it can't race a concurrently-dispatched job still pushing to the same branch the way a localgit mergewould.run_review_sweepgets aBehindmatch arm calling this, counted in a newReviewSweepResult.updatedfield (distinct frompromoted/self_repairedsince neither the item's state nor CI outcome changed).Test plan
update_branch_puts_to_the_update_branch_endpoint— confirms the right HTTP verb/pathpr_ci_status_reports_behind_before_ever_fetching_check_runs— confirmsBehindshort-circuits before the check-runs API callcargo test --bin agentflare -- worktree:: supervisor:: github::pulls::— 85 passed, 0 failedcargo build --bin agentflare,cargo fmt --all -- --check,cargo clippy --bin agentflareall clean on touched filesSummary by CodeRabbit
New Features
Bug Fixes