Skip to content

shepherd: keep shepherd:merge across its own async update-branch merge (Closes #8136) - #9004

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8136-20261122T0743Z
Nov 22, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/8136-20261122T0743Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #8136

What

PR #8117's timeline showed the cause: update-branch returns 202 and the head moves later. apply() re-read the head 3 s after the PUT, still got the old sha, and wrote shepherd-update from=A to=A. The merge f194… then landed, no marker matched it, clean_main_merge did 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 the to= marker.
  • gather: new bot_update_result(). With a from=<approved> marker whose to= is missing or equals from, the head carries the approval when it has two parents (approved head first), the second parent is already on main, and the committer is web-flow. Anything else falls through to clean_main_merge and 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 no to= (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.py all 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-branch is asynchronous: never read the new head right after it.

🤖 Generated with Claude Code

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]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 22, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 22, 2026 07:55
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 22, 2026 07:55
@squid-shepherd
squid-shepherd Bot merged commit fd22742 into main Nov 22, 2026
60 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8136-20261122T0743Z branch November 22, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shepherd: its own 'merge main into branch' commit drops shepherd:merge (approve/update loop)

1 participant