Repository navigation
ci: cancel superseded runs only on pull requests - #697
Conversation
CI and Web e2e cancelled in-progress master push runs when a newer merge landed, and Check Action had no concurrency group at all. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Verdict: approve
Checked the diff against master, the full workflow files, and actionlint (passes on all three files).
Correctness
cancel-in-progress: ${{ github.event_name == 'pull_request' }}is a valid expression and evaluates to a boolean. This is the same pattern rust.yml, contracts.yml, security.yml, survivability.yml and web-ipfs.yml already use.- Groups no longer collide across events. Push, workflow_dispatch and (in rust.yml) schedule all resolve
github.reftorefs/heads/master; thegithub.event_namesegment separates them. PR groups key onrefs/pull/N/merge, so each PR still cancels only its own superseded runs. A newer master merge no longer cancels a running master CI or Web e2e build. - Required checks are not affected. Concurrency changes no job names, and for PRs the only difference is the group string, so cancel behaviour stays the same.
playwright (read-only, testnet)andwebreport exactly as before. The existing!cancelled()guard in web-e2e still lets a superseded PR run cancel cleanly. - None of the three workflows is used through
workflow_call, so a caller'sgithub.workflowcannot leak into the group the way web-ipfs.yml has to handle. In ci.yml,github.workflowis redundant next to theci-prefix, but it does no harm.
Non-blocking caveat
"Master pushes never cancel" is not strictly true with any shared group. GitHub allows one running and one pending run per group. A third run that arrives cancels the pending one, whatever cancel-in-progress says. So if two master merges land while a master Web e2e run is going (it takes 40-90 min), the middle merge's run is cancelled before it starts. Before this PR that middle run, and the running one too, were cancelled, so this is still a clear improvement. Check Action had no group before, so its master runs could not be cancelled at all. Now a pending one can be, but it is unlikely because of its path filter and short jobs. If every master commit must get a run, key non-PR groups on the run, for example group: web-e2e-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}. Keep the serialized group for Check Action if the live job's testnet state transitions with the shared runner key need serializing. That runs into the 40-job cap that motivated this PR, though, so the current design is a reasonable trade-off.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
The account hit its 40-job Actions cap overnight. Superseded PR runs should cancel, but master pushes never should.
cancel-in-progress: true, keyed on ref). Now the group includes the event name and only PR runs cancel.Every other workflow already follows this pattern (or is a deploy/schedule singleton).
🤖 Generated with Claude Code