Skip to content

ci: cancel superseded runs on the five unguarded workflows - #435

Merged
leogdion merged 1 commit into
v1.0.0-beta.4from
claude/ci-concurrency-groups
Aug 21, 2026
Merged

ci: cancel superseded runs on the five unguarded workflows#435
leogdion merged 1 commit into
v1.0.0-beta.4from
claude/ci-concurrency-groups

Conversation

@leogdion

@leogdion leogdion commented Aug 21, 2026

Copy link
Copy Markdown
Member

Makes every PR-driven workflow run only on a PR's latest commit. Five workflows had no concurrency block at all, so each re-push left the previous run alive and holding a runner until it finished on its own.

What was piling up

Workflow Fires on Cost of a stale run
codeql.yml every push to every branch (branches-ignore: ['*WIP']) Swift analysis runs on macos-26 — the scarcest runner class
swift-source-compat.yml all PRs 3 ubuntu container jobs
claude-code-review.yml every synchronize 1 job
check-unsafe-flags.yml main-targeting PRs 1 job
examples.yml main-targeting PRs 3 ubuntu container jobs

CodeQL was the expensive one: a branch pushed three times held three macOS runners, none of which could be superseded.

MistKit.yml, MistDemo.yml, BushelCloud.yml, and CelestraCloud.yml already cancelled correctly and are untouched.

The change

All five get the branch-keyed group the rest of the repo already uses:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

codeql.yml additionally keys on github.event_name, so its weekly scheduled scan and a push scan of the same branch land in separate groups and cannot cancel each other. Within a single event type, only the newest run of a branch survives.

No trigger filters change. Nothing that was being built, tested, or scanned stops being built, tested, or scanned — the only behavior change is that a superseded run now stops instead of running to completion.

Deliberately left alone

MistDemo-Integration.yml keeps cancel-in-progress: false. It fires only on pushes to main and v*.*.*, never on PRs, so it cannot stack per-PR — and killing it mid-run would leave stray records in the live CloudKit container.

CodeQL's double-fire is not addressed here. On main-targeting PRs it runs twice per commit, once via push and once via pull_request, so those commits still consume two macOS runners. Scoping push to main would fix it — but its pull_request filter is branches: ['main'], so PRs targeting any other base (a v1.0.0-beta.* branch, for instance) would then get no CodeQL coverage at all. That is a coverage decision rather than a cost one, so it's left for a separate discussion.

Verification

Enumerated every workflow's triggers and concurrency config before and after. Before: five workflows reported "no concurrency — piles up." After: every PR-driven workflow reports cancel-in-progress: true, with MistDemo-Integration.yml the only remaining false (deliberate, per above). All 10 root workflow files parse as YAML.

The real proof is behavioral: push twice in quick succession to a PR branch and confirm the first CodeQL run is cancelled rather than left running.

MistKit.yml, MistDemo.yml, and the two Example workflows already cancel a
PR's older runs when a new commit lands. Five workflows had no concurrency
block at all, so every re-push left the previous run alive and holding a
runner until it finished on its own.

codeql.yml was the expensive one. Its push trigger is branches-ignore:
['*WIP'], so it fires on every push to every branch, and its Swift analysis
runs on macos-26 — the scarcest runner class. A branch pushed three times
held three macOS runners.

swift-source-compat.yml (three ubuntu container jobs, unfiltered
pull_request) and claude-code-review.yml (every synchronize) had the same
problem at lower cost. check-unsafe-flags.yml and examples.yml only fire on
main-targeting PRs, so they stacked more rarely, but the gap was the same.

All five get the branch-keyed group the rest of the repo already uses.
codeql.yml additionally keys on event_name so its weekly scheduled scan and
a push scan of the same branch land in separate groups and cannot cancel
each other; within a single event type, only the newest run of a branch
survives.

No trigger filters change, so nothing that was being built, tested, or
scanned stops being built, tested, or scanned. The only behavior change is
that a superseded run now stops instead of running to completion.

Deliberately left alone: MistDemo-Integration.yml keeps
cancel-in-progress: false. It fires only on pushes to main and v*.*.*,
never on PRs, so it cannot stack per-PR, and killing it mid-run would leave
stray records in the live CloudKit container.

Also not addressed here: codeql.yml double-fires on main-targeting PRs,
once via push and once via pull_request, so those commits still get two
macOS runs. Scoping push to main would fix it, but its pull_request filter
is branches: ['main'], so PRs targeting any other base would then get no
CodeQL coverage at all. That is a coverage decision, not a cost one, and is
left for a separate discussion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XvtV3mTRRLqC7Xnqhaim92
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f26ed62b-a109-4a8d-b0b8-9049cd86e72b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@leogdion leogdion changed the title Add concurrency controls to GitHub Actions workflows ci: cancel superseded runs on the five unguarded workflows Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v1.0.0-beta.4@cedc784). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             v1.0.0-beta.4     #435   +/-   ##
================================================
  Coverage                 ?   74.52%           
================================================
  Files                    ?      158           
  Lines                    ?     3761           
  Branches                 ?        0           
================================================
  Hits                     ?     2803           
  Misses                   ?      958           
  Partials                 ?        0           
Flag Coverage Δ
spm 74.02% <ø> (?)
swift-6.1-jammy 74.01% <ø> (?)
swift-6.1-noble 74.20% <ø> (?)
swift-6.2-jammy 74.17% <ø> (?)
swift-6.2-noble 74.12% <ø> (?)
swift-6.3-jammy 74.12% <ø> (?)
swift-6.3-noble 74.36% <ø> (?)
swift-6.4-jammy 74.36% <ø> (?)
swift-6.4-noble 74.17% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leogdion
leogdion marked this pull request as ready for review August 21, 2026 19:04
@leogdion
leogdion merged commit 4fabb07 into v1.0.0-beta.4 Aug 21, 2026
46 of 47 checks passed
@leogdion
leogdion deleted the claude/ci-concurrency-groups branch August 21, 2026 19:04
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