Skip to content

ci: cancel superseded runs only on pull requests - #697

Merged
PastaPastaPasta merged 1 commit into
masterfrom
ci/concurrency-pr-only
Nov 24, 2026
Merged

PastaPastaPasta merged 1 commit into
masterfrom
ci/concurrency-pr-only

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

The account hit its 40-job Actions cap overnight. Superseded PR runs should cancel, but master pushes never should.

  • CI and Web e2e: before this, a newer master merge cancelled the in-progress master run (cancel-in-progress: true, keyed on ref). Now the group includes the event name and only PR runs cancel.
  • Check Action: had no concurrency group. It now gets the same PR-only cancel group.

Every other workflow already follows this pattern (or is a deploy/schedule singleton).

🤖 Generated with Claude Code

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]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4e01de6-0985-4eae-be72-d9517f1d7377
Commits

Reviewing files that changed from the base of the PR and between 9334c05 and 59c2705.

Files selected for processing: 3

  • .github/workflows/check-action.yml
  • .github/workflows/ci.yml
  • .github/workflows/web-e2e.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ref to refs/heads/master; the github.event_name segment separates them. PR groups key on refs/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) and web report 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's github.workflow cannot leak into the group the way web-ipfs.yml has to handle. In ci.yml, github.workflow is redundant next to the ci- 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.

@PastaPastaPasta
PastaPastaPasta merged commit fa65e16 into master Nov 24, 2026
20 checks passed
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