Repository navigation
Leave a ready-for-review PR on green CI when the moved Base branch merges cleanly - #929
Merged
Merged
Conversation
…rges cleanly A Delivery left ready for review no longer merges a moved Base branch in again after green or absent CI, unless GitHub reports the PR not mergeable. The move is not counted against the upstream-move budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shot, cover the ready-for-review path end to end Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…base-move branch returns Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the Base branch moves while green or absent CI runs, a Delivery that leaves its pull request ready for review now stops on that head if GitHub reports the PR mergeable. The move is not counted against the upstream-move budget. A Self-merge (
Goal::Merged) is unchanged.Outside::pr_mergeableis the new seam method.RunOutsidebacks it withPullRequest::is_mergeable.is_mergeablesharessettled_ready_snapshot, the readiness and Unknown-polling read, withensure_ready_and_mergeable.roundscomment, theMAX_UPSTREAM_MOVEScomment and the how-it-works page now say which goal goes round again on a Base move.Evidence
tests/mergeable.rsran a ready-for-review Delivery with green CI andmainmoving during CI. It expectedissue-7to gainMerge remote-tracking branch 'origin/main' into issue-7and a second CI watch.After: the new code fails that expectation, because nothing further is merged. The test is now split in two:
a_pr_left_for_review_stays_on_green_ci_when_the_moved_base_branch_merges_cleanlyasserts:merging it again;issue-7history unchanged (Add feature,Initial commit).a_merge_run_merges_a_base_branch_that_moved_while_ci_passedkeeps the old behaviour for a Merge run.src/delivery/repair_loop.rs:MergeBase, Push, Watch, ReadMergeable, <log line>, CheckPr, with no further merge, push or watch;merging it again, merges again, runs a conflict Repair and goes round;RepairLoopRound, not inPullRequestReadiness.pull_request::tests::only_a_pr_github_reports_mergeable_is_mergeable_and_only_an_unready_one_fails: Yes → true, No → false, Unknown → false, draft → error.cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean. The fullcargo testrun on a630b86 exited 0. The last commit, 97a5056, was checked withcargo test --bin thirdshift pull_request(36 passed) and clippy.Merge Danger
Door: two-way
A revert restores the old loop. No state or data is migrated.
Blast Radius: Delivery
This affects ready-for-review Runs and Spec runs. They now finish on a head that may not include the latest
main, relying on GitHub's mergeability report. The post-roundsensure_pr_ready_and_mergeablecheck is unchanged. Self-merge is not touched.Unaddressed findings
Standards
Goal::ReadyForReviewtwice. Declined. The two checks answer different questions: a moved Base branch, and Foreign commits (theelse ifinRepairLoop::rounds,src/delivery/repair_loop.rs). Onematch self.goalwould restructure the Merge run path, and the spec says "Goal::Merged(Self-merge) is unchanged by this issue."Outsidemethods and two GitHub reads for one fact (pr_mergeableandensure_pr_ready_and_mergeable). Declined. The spec requires "The existing readiness and mergeability check after the rounds stays." Folding them together would move that gate into the loop.main's log with.contains, which is weaker than the old parent check. Declined. The Issue branch is deleted after the Self-merge, soassert_merged_main_into_issue_7cannot run (it failed withunknown revision issue-7). The test also asserts themerging it againline, and the reviewer judged this acceptable.a_run_left_ready_for_review_goes_round_again_as_a_base_move_if_the_pr_does_not_mergecovers it in-process, as the acceptance criteria ask ("An in-process Repair loop test").--short=7couples the test toci::short's length. No change. The reviewer raised no defect, and a mismatch fails loudly.RunOutside::pr_mergeableis a Middle Man. No change. The reviewer judged it acceptable, matching the neighbouring adapters.Spec
count_base_move's line:RepairLoop::count_base_movewrites theBudgets::count_base_moveline every time it counts. The stage test also shows the counting path exhausting the budget only on unmergeable reads.MERGEABLE. No change. The spec accepts "as GitHub reports it", and the post-rounds check re-reads it.All of the following were addressed: the Unknown-mergeability wording in the glossary and the
roundscomment, the test name, the(Mergeable, String)tuple, the wildcardMergeablearm, and the how-it-works link text.Security review outcome
No unaddressed introduced findings.
Review coverage
Both reviewers read every changed file at a630b86. After the reviews, 97a5056 changed two lines they did not see: the explicit
Mergeable::Yes | Mergeable::No | Mergeable::Unknownarm insrc/pull_request.rs(a Standards suggestion) and the link text insite/how-it-works/index.html. No generated output was excluded.Closes #906
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium