Skip to content

ci: cancel superseded runs for the same PR or branch - #2397

Merged
pancacake merged 2 commits into
HKUDS:devfrom
Antonio-Faure:ci/cancel-superseded-runs
Nov 5, 2026
Merged

pancacake merged 2 commits into
HKUDS:devfrom
Antonio-Faure:ci/cancel-superseded-runs

Conversation

@Antonio-Faure

@Antonio-Faure Antonio-Faure commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

None of the four pull-request workflows declares concurrency. Every fix-up push therefore starts a new full matrix while the previous one keeps running to completion, even though its result can no longer affect the PR.

That is measurable on the current queue: 47 pull_request workflow runs in the six hours before this PR (2 Nov, 15:00–21:55 UTC), and Tests alone fans out to lint, web, desktop on two OSes, import checks on six combinations, Python tests on four versions, the TypeScript chat engine, and video isolation. With 193 open PRs and authors often pushing several times per hour, most of that runner time is already stale when it finishes.

The effect is not only cost: a superseded run still occupies the queue, so the latest commit waits behind a run nobody needs.

What changes

Add the standard concurrency group to the four workflows that run on pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true
  • github.event.pull_request.number groups all runs of one PR; github.ref covers push, schedule and workflow_dispatch.
  • github.workflow is part of the group so Tests, Modular installation, Repository Hygiene and Memory snapshot evaluation never cancel each other.
  • No job, step, test, or required check is removed. Only a run for an older commit of the same ref is cancelled, and the newest commit always runs the full matrix.

Workflows without a PR trigger (release, notarization, PyPI, Docker) are untouched.

Verification

The setting was exercised on this PR itself. After the second push (db309527), GitHub cancelled the still-running Tests workflow from the first commit (a7703bd3) while the other three, already complete, kept their results:

a7703bd3  Tests                         completed/cancelled
a7703bd3  Modular installation          completed/success
a7703bd3  Repository Hygiene            completed/success
a7703bd3  Memory snapshot evaluation    completed/success

All four files parse with PyYAML and expose the expected concurrency.group; git diff --check is clean. The change affects only CI scheduling, not application code.

Refs #2354 (CI queue work), though this is independent of the Windows lane.

@pancacake
pancacake merged commit bb2e1d5 into HKUDS:dev Nov 5, 2026
25 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.

2 participants