Skip to content

Supersede push runs by branch, not run id - #965

Merged
d-chambers merged 1 commit into
devfrom
ci-cancel-superseded-push-runs
Aug 21, 2026
Merged

Supersede push runs by branch, not run id#965
d-chambers merged 1 commit into
devfrom
ci-cancel-superseded-push-runs

Conversation

@d-chambers

Copy link
Copy Markdown
Contributor

Description

Every test workflow's concurrency group falls back to github.run_id when there is no pull request number:

group: TestCode-${{ github.event.pull_request.number || github.run_id }}

run_id is unique per run, so on a push the group never collides and cancel-in-progress has nothing to cancel. Consecutive pushes to dev therefore each keep a full matrix alive. This morning three dev pushes (08:57, 08:58, 09:14) were running simultaneously — TestCode alone is 14 jobs (setup + conda_env + 3 OS × 3 Python + 3 network_tests), so that is ~42 jobs for one branch against the org's 20-concurrent-job cap. Queued jobs peaked at 84 and PR CI stalled behind it.

Switching the fallback to github.ref puts all pushes to a branch in one group, so a new commit on dev supersedes the in-flight run for the previous one. Pull requests are unaffected: they still group by pull_request.number and never reach the fallback. master and dev group separately, since github.ref differs.

Six workflows carried the same fallback: runtests.yml, run_min_dep_tests.yml, lint.yml, profile.yml, test_free_threaded.yml, test_wasm.yml.

Trade-off worth stating: a rapid series of merges to dev now leaves intermediate commits untested, since only the newest push keeps its run. That is the usual reason to group by branch, and it is what the fallback already does for pull requests.

Two related contributors to the same pile-up are left alone here and can be handled separately:

  • CancelPRRuns is an 8-job matrix of echo statements, so it queues behind the very backlog it exists to drain (jobs sat queued for over an hour this morning).
  • network_tests adds 3 jobs to every TestCode run and is subject to the known stall in Fix remote HTTP test stalls and tune HTTP HDF5 caching #784.

Changelog

  • none (CI only)

Checklist

I have:

  • filled in the Changelog section above (see docs/contributing/general_guidelines.qmd).

The concurrency group fell back to github.run_id when there was no pull
request number, which is unique per run, so consecutive pushes to dev
never collided and each kept a full matrix alive.
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@d-chambers, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cea211d9-78a6-4e8f-a887-5217a2288e35

📥 Commits

Reviewing files that changed from the base of the PR and between 2bfb202 and 635d6e4.

📒 Files selected for processing (6)
  • .github/workflows/lint.yml
  • .github/workflows/profile.yml
  • .github/workflows/run_min_dep_tests.yml
  • .github/workflows/runtests.yml
  • .github/workflows/test_free_threaded.yml
  • .github/workflows/test_wasm.yml

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

Comment @coderabbitai help to get the list of available commands.

@d-chambers
d-chambers merged commit f207d19 into dev Aug 21, 2026
1 of 8 checks passed
@d-chambers
d-chambers deleted the ci-cancel-superseded-push-runs branch August 21, 2026 10:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 635d6e4577

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Supersede the previous run: by pull request, or by branch for pushes.
concurrency:
group: CodSpeed-${{ github.event.pull_request.number || github.run_id }}
group: CodSpeed-${{ github.event.pull_request.number || github.ref }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep manual benchmark runs out of push concurrency groups

Because this workflow also supports workflow_dispatch, the fallback now groups a manually requested benchmark with push runs for the selected ref. With cancel-in-progress: true, a subsequent push to that branch cancels the manual benchmark (and a manual dispatch can cancel the push benchmark), although the stated behavior only intends branch supersession for pushes; retain a unique fallback such as github.run_id for non-push, non-PR events.

Useful? React with 👍 / 👎.

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