Repository navigation
shepherd: keep shepherd:merge across its own async update-branch merge (Closes #8136) - #9004
Merged
Merged
Conversation
Closes #8136) update-branch returns 202, so the `to=` marker named the old head and the merged head lost its approval. Poll for the head to move, and read a GitHub-made merge of main into the approved head from the commit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
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.
Closes #8136
What
PR #8117's timeline showed the cause:
update-branchreturns 202 and the head moves later.apply()re-read the head 3 s after the PUT, still got the old sha, and wroteshepherd-update from=A to=A. The mergef194…then landed, no marker matched it,clean_main_mergedid not accept it, and the approval was dropped 25 s later.apply: polls the head (6 reads, 2 s apart) until it differs from the old head before writing theto=marker.gather: newbot_update_result(). With afrom=<approved>marker whoseto=is missing or equalsfrom, the head carries the approval when it has two parents (approved head first), the second parent is already on main, and the committer isweb-flow. Anything else falls through toclean_main_mergeand then to the drop.docs/ci.md: one sentence on this.Class / Sibling gaps
Class: the shepherd's own async update-branch result not recognised as carrying the approval. Sibling in scope: a
from=marker with noto=(same fix). Sibling gaps: a pending (from=only) marker followed by a human push still reads as pending, not dropped; no burned-estate program needs it.Tests
tests/tools/test_shepherd_gh.py: the #8117 shape (to==from, and no to=), four negatives (non-web-flow committer, wrong parent order, second parent not on main, single parent), and the apply poll. Gates: pytest (shepherd tests, markers test),audit_check.pyall clear,ruff format.Cross-repo: none. Overlaps PR #9002 on
docs/ci.md(one sentence; merge order free).Lessons for agents
PUT pulls/N/update-branchis asynchronous: never read the new head right after it.🤖 Generated with Claude Code