Repository navigation
shepherd: keep merge approval across a clean merge from main - #4979
Merged
Merged
Conversation
A new PR head dropped shepherd:merge and set shepherd:reapprove even when it was only a plain merge of main into the approved head. Such a head is now carried over (approval marker written for it) when its parents are the approved head and a commit already on main, the merge changed exactly what main changed since the merge base, and the PR's own files do not overlap main's. Anything else, or any unreadable compare, still goes to reapprove. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
…roval-clean-merge
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 12, 2026 15:09
squid-protocol
enabled auto-merge (squash)
October 12, 2026 15:09
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.
Problem
The merge shepherd dropped
shepherd:mergeand setshepherd:reapproveon ANY new PR head, including a plain no-conflict merge of main into the PR branch. On 2026-10-12 PRs #4948 and #4966 were approved, someone merged main in to update them, and they then waited overnight for a re-review nothing performs.Change
gather()already knows the approved head (newest trustedshepherd:approved sha=marker). When the head moved and was not the bot's own update-branch, the newclean_main_merge()(GitHub API only: commit parents + compare endpoints) keeps the approval if:compare base...parentis behind/identical);The head is then treated like the bot's own carried update: label kept, a fresh approval marker is written for the new sha. Any other head, an unreadable compare, or 300+ files falls back to reapprove as before.
Tests
tests/tools/test_shepherd_gh.py: clean merge keeps approval; merge with extra changes, overlapping files, off-main parent, unreadable compare, and an ordinary new commit all go to reapprove.pr_gates --fastpasses 5/5.Note:
pr_gates --ratchetsshowsportsfailing on the carddemo equivalence cases locally (unrelated files; likely missing JDK env in this shell); CI runs the full suite.🤖 Generated with Claude Code