Skip to content

ci: shepherd reconcile wakes on the required checks only and coalesces bursts (Part of #4935) - #4936

Merged
squid-protocol merged 1 commit into
mainfrom
ci/4935-shepherd-thrash
Oct 11, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
ci/4935-shepherd-thrash

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4935 (the shepherd reconcile member; Main Watch and the double-run heavy jobs stay open there).

Problem

  • shepherd-reconcile.yml triggered on 25 workflows: 204 runs in 24h, 41% of all CI runs, with 99 cancelled and 30 skipped.
  • Worse, GitHub keeps one pending run per concurrency group and cancels older pending ones. A workflow_run pass only reconciled the triggering head's PRs (--head-sha), so when PR A's pending pass was cancelled by PR B's newer completion, PR A waited for the 20-minute cron.
  • (The label-event workflow is unaffected: it has no concurrency group since det translator: accept single-byte national letters in data names (BETRÄGE / GEBÜHR) (Fixes #4664) #4854. The reconcile's comment saying the group was shared was out of date.)

Change

  • Triggers go from 25 to 6: the workflows behind main's required checks (det, full-suite, ground-truth, mypy-audit, ruff-audit → Det Sweep, Smoke Tests, Mainframe Ground Truth, Mypy Audit, Ruff Audit) plus the Full Suite Gate that shepherd:matrix waits on. GitHub's auto-merge itself waits on the required checks. Digests and reruns for other checks come from the next pass on the same head, or from the cron.
  • branches-ignore: [main] on the trigger: runs on main create no reconcile run at all, rather than a skipped one.
  • Every pass reconciles all labelled PRs, so a cancelled pending pass loses nothing and a burst coalesces into one pass. Only a few PRs carry labels at a time, so the extra API cost is small.
  • shepherd_gh.REQUIRED_CHECKS mirrors the ruleset. A new test derives the expected trigger list from the workflow files that define those checks, so adding a required check without waking the shepherd fails CI. Another test makes sure passes are never head-only again.
  • The cron (every 20 min, the rerun gap) and manual runs are unchanged. docs/ci.md is updated.

Expected: about 65 reconcile runs a day instead of 204, with no PR waiting on the cron after a dropped pass. I'll compare the 24h counts and label-merge latency after it merges.

Evidence: test_shepherd_gh.py + test_ci_shepherd.py 76 pass (2 new; the workflow security lint still passes). pr_gates --fast 5/5. Owner-approved workflow edit (2026-10-11).

🤖 Generated with Claude Code

…s bursts (Part of #4935)

The reconcile triggered on 25 workflows: 204 runs a day, 99 cancelled and
30 skipped. A pending pass cancelled by a newer one (one pending run per
concurrency group) also dropped the PRs of its head until the 20-minute
cron, because a workflow_run pass only reconciled that head's PRs.

Now it triggers on the workflows behind main's required checks plus the
Full Suite Gate (6), ignores runs on main at the trigger instead of
skipping them in the job, and every pass reconciles all labelled PRs, so a
burst coalesces into one pass and nothing waits for the cron. The cron and
manual runs are unchanged. shepherd_gh.REQUIRED_CHECKS mirrors the ruleset;
a test keeps the trigger list in step with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 11, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 11, 2026 21:37
@squid-protocol
squid-protocol enabled auto-merge (squash) October 11, 2026 21:37
@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

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.

1 participant