Skip to content

CI shepherd: ci-gate status on every open PR, and a red check turns auto-merge off (#6919) - #6920

Merged
squid-protocol merged 2 commits into
mainfrom
ci-gate-6919
Oct 28, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
ci-gate-6919

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes the gap in #6919. Path-filtered checks (DOOM-rosetta, call-graph accuracy, ...) ran on the PRs they could affect, but their result never gated a merge. #6881, #6894, #6895 and #6899 merged with them red.

Checklist: A (ci-gate, posted by the shepherd) + C (a red check turns auto-merge off), both from #6919.

Change

C: a real failure turns auto-merge off. In decide(), triage now runs before the auto-merge decision. A real failure of any check, other than the shepherd's own jobs and ADVISORY (empty), joins blocked, so auto-merge goes off and stays off until the head is green.

A: a ci-gate commit status, without holding a runner. The shepherd already reads every check on the head, so it posts ci-gate on every open PR, labelled or not, in both passes:

  • pending: a draft, a running or rerun check, a failure that is main's, or a required check that hasn't reported yet (this also covers runs not yet created right after a push).
  • failure: a real failure.
  • success: otherwise.

It posts only when the state or description changes. Its own status is filtered out before classify(), so a pending gate never waits on itself. Reconcile now covers all open PRs (open_prs, 9 open today) and also triggers on DOOM-rosetta and Call Graph Accuracy Audit (GATE_TRIGGERS). Other workflows are picked up by the 20-min cron. The status query now also fetches description (pr_check.py, graphql_reads).

Owner steps

  1. This PR edits .github/workflows/, so the shepherd token can't auto-merge it. Merge it by hand.
  2. Check that the squid-shepherd App has Commit statuses: write (otherwise the AUTOMATION_PAT fallback posts).
  3. After ci-gate has reported on the open PRs for a while, add ci-gate to ruleset 24824983. Until then C is the guard, and it can still lose the race against a slow check (Include resolution: generated forwarder headers and the importer's own module tree (Part of #6266) #6899).

Open question (#6919)

equivalence-e2e is documented as never holding a merge. With this change a red E2E blocks. If it should stay advisory, add it to ADVISORY.

Tests

pr_gates.py --fast: 9/9 pass (CI's ruff 0.17.1). test_shepherd_gh.py + test_pr_check.py + test_ci_digest.py: 212 pass, 9 of them new: the gate states, posting once, self-exclusion, unlabelled PRs, the 140-char description limit, the commit-status argv, and the reconcile triggers check against real workflow names. The fake GitHub now remembers a posted status.

Class / Sibling gaps

Class: merge-path checks that only see the required set. Covered: the shepherd's auto-merge and the gate. Gaps:

  • churn's review gives a merge verdict before full CI on the head. With the gate that's safe, but the verdict still trusts pr_gates --fast.
  • docs/ci_experiments_log.md wants an entry for a CI change. It's not added here (5-file cap); add one after the soak with the measured hold time.

Part of #6919

🤖 Generated with Claude Code

…turns auto-merge off (#6919)

Path-filtered workflows ran but never gated a merge: the ruleset requires five core checks,
and the shepherd only labelled other failures needs-fix while auto-merge stayed on. #6881,
#6894, #6895 and #6899 merged with DOOM-rosetta / call-graph-accuracy red.

- decide(): triage runs before the auto-merge decision; a real failure of any gating check
  (not the shepherd's own jobs, not ADVISORY) blocks and turns auto-merge off.
- gate_status(): ci-gate is pending (draft, running or rerun checks, main's failure, an
  unreported required check), failure (a real failure) or success; posted only on change,
  and the shepherd's own status is never read back as an input.
- reconcile covers every open PR (open_prs), so a hand merge is gated too; it also triggers
  on DOOM-rosetta and Call Graph Accuracy Audit (GATE_TRIGGERS).
- pr_check / graphql_reads fetch the status description, so an unchanged gate is not reposted.

The ruleset change (require ci-gate) is the owner's step after a soak.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…abelled (#6919)

reconcile now lists every open PR through open_prs; the two exit-code tests still faked
open_labelled, so they reached a real `gh api pulls?state=open`. They passed where gh is
logged in and failed in full-suite part 1/2 (no GH_TOKEN in CI).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvfVvURyJ9zRpgVkace
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