Repository navigation
Merge the Base branch again when it moves while CI runs - #57
Merged
Merged
Conversation
vacation#28 ended as a Failed run with PR 40 sent back to draft, with all 3 Repairs unused. PR #38 merged into main at 20:29:44, inside the 60s CI wait on 6e1234c. repair_loop only re-merged the Base branch after a Repair, so green or absent CI returned straight to the final mergeable check, which found the conflict in ConsideredGames.java and failed. After green or absent CI, repair_loop now fetches the Base branch and, if it moved, goes round again: a clean merge is pushed and CI watched on the new head, and a conflict gets a conflict Repair from the usual budget. Rounds without a Repair are capped at 3 (MAX_CATCH_UPS), so a busy Base branch cannot keep a Run going forever; past the cap it is a Failed run. The fake gh gains `gh fake on-ci-read <times> '<script>'` so tests can move main while thirdshift waits for CI.
The cap is now MAX_BASE_MOVES and counts every move of the Base branch while CI ran, whether or not the merge after it needs a Repair, in plain words rather than a new "catch-up" term. The upstream check shared by ensure_base_branch_merged and base_branch_moved lives in one helper. The tests now pin the cap at exactly 3 merges and cover the base moving while CI passes, not only while it is absent.
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
A Base branch that moves while CI runs now gets merged again instead of failing the Run. vacation#28 ended as a Failed run, with PR vacation#40 sent back to draft and all 3 Repairs unused: PR vacation#38 merged into
mainat 20:29:44, inside the 60s CI wait on6e1234c, and the final mergeable check found the conflict inConsideredGames.java.repair_loop loop merge origin/<base> conflicted -> conflict Repair, go round push watch CI red -> CI-fix Repair, go round - green or absent -> done + green or absent + fetch origin/<base> + not moved -> done + moved 3 times already -> Failed run + else -> go round ensure_pr_ready_and_mergeableA merge after a move may need a conflict Repair, which draws on the usual
MAX_REPAIRSbudget.MAX_BASE_MOVES = 3caps the moves themselves, since a clean merge uses no Repair and a busy Base branch could otherwise keep a Run going forever.The fake
ghgainsgh fake on-ci-read <times> '<script>', which runs a script the first time thirdshift reads CI on each new head, so tests can movemainmid-watch.Evidence
tests/mergeable.rsfail onmain:origin/main kept moving while CI ran: merged it again 3 times. Full suite: 107 passed, andcargo clippy --all-targets -D warningsis clean.Merge Danger
Door: two-way
A revert restores the old behaviour. No state or format changes.
Blast Radius: Runs
A Run whose Base branch moves while CI runs now takes up to 3 more merge-and-CI rounds, each with its own CI grace period, before it ends. On a busy Base branch that adds wall-clock time where it used to fail fast.