Skip to content

ci shepherd: log every queued PR every pass; rerun a cancelled non-required check (#4790) - #4850

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

squid-protocol merged 1 commit into
mainfrom
ci/4790-shepherd-log-rerun

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes nothing; follow-up to #4790.

Observed 2026-10-10 (PR #4837): its only failures were two CANCELLED full-suite-matrix (macos-...) legs. A shepherd pass ran (state saved) and logged nothing about #4837 and did nothing.

Root cause: ci_digest split classify's NAME (conclusion) verdicts at the first (. A matrix leg's name contains one, so full-suite-matrix (macos-14) (cancelled) became full-suite-matrix, which matched no run. digest() returned no failed checks for the PR, so the rerun loop had nothing to do and no branch logged a line.

Fix:

  • pr_check.failed_names() cuts at the last (; ci_digest uses it in digest() and main_failures().
  • ci_shepherd.step() hands each queued PR to _pass_one() and adds a fallback line whenever a PR logs nothing: #N no action: head ..., mergeable_state ..., failed: ..., pending: N.
  • A failed infra/flake check that is not rerun logs why: #N blocked: <check> (<triage>) -- no action: 1/3 reruns used; the next waits 15 min after the last (or no run id).

The cancelled non-required check is rerun via gh run rerun RUN --failed under the existing retry_due policy (INFRA_RETRIES, RETRY_GAP) and is not changed otherwise.

Tests (tests/tools/test_ci_shepherd.py): a PR blocked only by a cancelled non-required matrix leg gets one rerun and a log line, and a second pass inside RETRY_GAP logs a blocked line with no rerun. The first test fails on the old ci_digest and passes on the fix. A behind PR whose branch was already updated logs its state.

Gates: pytest on the touched tests (25+ passed), ruff format, ruff_audit --ci and mypy_audit --ci clean against baselines, pr_gates.py --fast 5/5 via heavy-run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV

…quired check (#4790)

PR #4837 had only two CANCELLED `full-suite-matrix (macos-...)` legs. A shepherd pass ran and logged nothing about
the PR and did nothing.

Root cause: ci_digest split classify's `NAME (conclusion)` verdicts at the FIRST " (". A matrix leg's own name holds
a " (", so `full-suite-matrix (macos-14) (cancelled)` became `full-suite-matrix`, which matched no run. digest()
returned an empty `failed` list for the PR, the rerun loop had nothing to rerun, and no branch logged anything.

Fix:
- pr_check.failed_names(): cut the verdict at the LAST " ("; ci_digest uses it in digest() and main_failures().
- ci_shepherd: each queued PR is handled by _pass_one(), and step() adds a fallback line
  ("#N no action: head ..., mergeable_state ..., failed: ..., pending: ...") whenever it logs nothing.
- A failed infra/flake check that is not rerun now logs why ("#N blocked: <check> (<triage>) -- no action:
  1/3 reruns used; the next waits 15 min after the last", or "no run id").

Tests: a cancelled non-required matrix leg is rerun once with a log line, and a second pass inside RETRY_GAP logs
a blocked line with no rerun. The first test fails on the old ci_digest. A behind PR whose branch was already
updated logs its state.

Co-Authored-By: Claude Haiku 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

@squid-protocol
squid-protocol marked this pull request as ready for review October 10, 2026 16:21
@squid-protocol
squid-protocol merged commit 8e761b3 into main Oct 10, 2026
22 checks passed
@squid-protocol
squid-protocol deleted the ci/4790-shepherd-log-rerun branch October 10, 2026 16:21
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