Skip to content

shepherd-reconcile: a skipped completion takes no pass and cannot cancel a pending one (Part of #7455) - #7463

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
7455-reconcile-churn
Nov 1, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
7455-reconcile-churn

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7455 (item 1). The owner approved editing shepherd-reconcile.yml in this PR.

Why. 319 of the 500 most recent cancelled runs on 2026-11-01 were CI shepherd (reconcile). I measured what they cost before changing anything: almost nothing. The change is minimal for that reason.

Measured (2026-10-25..11-01, all 9,321 runs of the workflow).

  • 6,544 runs cancelled (70%), 2,775 real passes, about 347 a day.
  • A cancelled run took no runner: 100 of 100 sampled had no job at all, including the 40 longest-lived. They sat pending for 17 s at the median and 18.6 min at most, so they held no runner and made no API call. The cost is rows on the dashboard.
  • A real pass holds one runner for 54.5 s at the median, 56 s mean, 86 s p90 (60 sampled). That is about 5.4 runner-hours a day, roughly 0.2 of one slot in the pool of 20.
  • On 2026-10-31, 1,659 completions woke the workflow: 455 skipped (27%), 196 cancelled, 1,008 a real result. All were pull_request runs.

What. A skipped completion (a draft's heavy workflows) no longer takes a pass, and it gets a concurrency group of its own, so it cannot replace a real pending pass. Every other completion, the cron and manual runs stay in the shared group. Cancelled completions keep their pass: 15 of the 196 had no newer run, and those are what the shepherd reruns.

Effect (replay of the 2026-10-31 completions with that day's real pass durations; the replay gives 1,399 cancelled and 260 passes, the real day had 1,440 and 276).

now after
cancelled rows 1,399 951 (-32%)
real passes 260 253
mean wait for a pass 58 s 59 s
p99 wait 319 s 302 s

So there are about a third fewer cancelled rows, and the reaction time does not move. API calls barely move either, because a cancelled run never made any: reducing them means fewer real passes, and coalescing already limits those. I did not add a debounce, which would hold a runner idle to save seconds of work.

No lost pass. Before this, a skipped completion could replace a real pending pass and then do nothing itself. That can no longer happen. None of the 455 skipped completions was the last word on its head: each had a later real completion on the same head, and the next real completion anywhere came 34 s later at the median, 404 s at most.

Verified. tests/tools/test_shepherd_gh.py, test_shepherd_markers_not_hand_written.py and test_workflow_draft_gate.py: 214 passed. ruff_audit --ci and mypy_audit --ci: no new findings. The workflow parses as YAML and a new test pins the group and the if.

Not verified. The group expression has not run on GitHub: a workflow_run workflow runs from main, so it only takes effect after merge. Check after merge that skipped runs show as skipped and the cancelled share falls. actionlint is not installed here.

🤖 Generated with Claude Code

…cel a pending one (Part of #7455)

27% of the completions that wake the workflow are skipped (a draft's heavy
workflows). They now get a concurrency group of their own and no job, so
they can no longer replace a real pending pass. A cancelled run took no
runner (100 of 100 sampled had no job), so this is a small change: about a
third fewer cancelled rows, the same passes, the same reaction time.

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

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

Waiting on an owner decision (asked privately, 2026-11-01). Nothing is needed from contributors; work resumes once it is answered.

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 1, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 1, 2026 18:30
@squid-shepherd
squid-shepherd Bot merged commit bdb4513 into main Nov 1, 2026
36 checks passed
@squid-shepherd
squid-shepherd Bot deleted the 7455-reconcile-churn branch November 1, 2026 18:33
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

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