Skip to content

shepherd: no infra rerun while a newer run of the workflow is live on the PR - #7036

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
fix/shepherd-rerun-sibling
Oct 29, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
fix/shepherd-rerun-sibling

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What it fixes. The shepherd's infra/flake rerun was cancelling the CI run that was actually testing the PR.

The heavy workflows (Det Sweep, Equivalence E2E, CICS Crucible) use a per-PR concurrency group with cancel-in-progress. Re-running an older run's failed jobs puts that run back into the group, so GitHub cancels the newer run already testing the head. The newer run's gate jobs (det, equivalence-e2e, crucible) then fail because their shards were cancelled. Those failures triage as infra, so they get rerun too, and the PR stays red with nothing wrong in it.

Change (tests/tools/shepherd_gh.py):

  • _attempts already reads the failed run. It now also reads that workflow's runs on the PR branch, one extra call per failed run.
  • If another run is queued or in progress, the failure stays shepherd:retrying with no rerun. The next pass decides on that run's own result.
  • If the extra read fails, or the run has no workflow id, the shepherd reruns as before rather than holding the PR.

Tests:

  • test_shepherd_gh.py + test_ci_shepherd.py: 200 passed.
  • New tests: the decision with a live sibling run, sibling detection by run status, and no extra read without a workflow id.
  • pr_gates.py --fast: 9/9.

Not changed: rerun_det (the shepherd:full request), which re-runs the newest Det Sweep run on purpose.

🤖 Generated with Claude Code

… the PR

A rerun joins the workflow's per-PR concurrency group, and cancel-in-progress then cancelled the
newer run already testing the head (#7026 at 19:53Z, #6971 at 05:44Z). That run's cancelled
shards failed its gate jobs (det, equivalence-e2e, crucible), which triaged infra and were rerun in
turn, so the PRs stayed red with nothing wrong in them.

_attempts now also reads the workflow's runs on the PR branch (one call per failed run); while
another run is queued or in progress the failure stays shepherd:retrying without a rerun, and the
next pass decides on that run's result.

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 29, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 29, 2026 20:50
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 287efb9 into main Oct 29, 2026
33 checks passed
@squid-shepherd
squid-shepherd Bot deleted the fix/shepherd-rerun-sibling branch October 29, 2026 21:11
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