Skip to content

ci shepherd: update a green PR's branch when it is behind main (#4790) - #4842

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4790-ci-shepherd-behind
Oct 10, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4790-ci-shepherd-behind

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Refs #4790.

A PR whose `mergeable_state` is `behind` never merged: `pr_check` treats behind as not mergeable, so the shepherd waited forever (seen on the bot PR #4831).

Change: in `step()`, when a PR is behind with no failed and no pending checks, run `gh pr update-branch N` once per head SHA (`once()` key `update-branch`) and log it. The push restarts the checks, and a later pass merges it. A failed check or a pending check does not trigger the update.

Tests (fake gh): behind+green gives one update-branch call; a second pass on the same head gives none; pending gives none; behind with a failed check gives none.

Gates: `pr_gates.py --fast` 5/5 pass; ruff audit and mypy audit show no new findings; `test_ci_shepherd.py` + `test_ci_digest.py` 23 passed.

Not queued with the shepherd (orchestrator reviews and queues).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV

A PR whose mergeable_state is `behind` was never merged: pr_check treats
behind as not mergeable, so the shepherd waited forever (seen on the bot
PR #4831). When a PR is behind with no failed and no pending checks, the
shepherd now runs `gh pr update-branch` once per head SHA. The push
restarts its checks, and a later pass merges it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant