ci(staging): rebase-rescue conflicting open PRs onto upstream main - #22
Open
btli wants to merge 1 commit into
Open
ci(staging): rebase-rescue conflicting open PRs onto upstream main#22btli wants to merge 1 commit into
btli wants to merge 1 commit into
Conversation
A merge applies a PR's total diff, so a PR partially landed upstream (merged in evolved form, cherry-picked) conflicts every night even though replaying its commits succeeds. Give each conflicting open PR one rescue: rebase its head onto upstream main in a throwaway worktree (reproducible identity and committer dates, already-landed patches dropped), retry the merge with the rescued head, and push the rescue back to the PR's fork branch under a lease on the pre-rescue head so a branch that moved keeps its newer work. Extras stay verbatim (frozen pins) and the production ring never rescues. A rescue that lands exactly on upstream main is not pushed — the PR fully landed and blanking its branch helps nobody. Rescues are byte-reproducible, so a rerun with a stale listing rebuilds the same head and no-op detection keeps working.
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
Safety properties
--committer-date-is-author-datemake rescued oids byte-identical across reruns, so same-day no-op detection keeps working even when a push-back fails (covered by test).--force-with-leaseon the pre-rescue head — a branch a human moved meanwhile keeps its newer work; this run still ships the rescue, the next run rescues from the newer head (covered by test).Test Plan
test_stage.py(rescue success incl. fork-branch refresh, reproducibility/no-op rerun, moved-branch lease, production-ring exclusion, and the existing pure-conflict skip still byte-identical).test_stage.py+test_ring_golden.py+test_push_classify.py— 82 passed (goldens untouched).Note for local checkouts
When the ring rescues one of your PRs, its branch history is rewritten —
git pull --rebase(orgit reset --hard origin/<branch>) before continuing local work on that branch.