Skip to content

ci: cancel superseded Check runs - #4

Merged
ralyodio merged 1 commit into
mainfrom
ci/check-concurrency
Aug 3, 2026
Merged

ci: cancel superseded Check runs#4
ralyodio merged 1 commit into
mainfrom
ci/check-concurrency

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 3, 2026

Copy link
Copy Markdown

Change

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

The macOS test job runs 3–5 minutes. Without a concurrency group, a burst of
pushes to a PR branch — or several merges in a row — leaves multiple runs
queued whose results are already obsolete by the time they finish. This keeps
one in-flight run per ref and cancels the rest.

Why github.ref keys the group

Refs stay isolated, which is what makes cancel-in-progress: true safe here:

trigger github.ref
pull_request refs/pull/N/merge
push to main refs/heads/main

So a merge to main never cancels an open PR's run, and no PR can cancel
another's. Only genuinely superseded runs on the same ref get killed.

Tradeoff worth knowing

This gives up per-commit coverage on main. In a rapid series of merges, only
the newest commit keeps a completed run — the tip of main is always verified,
but intermediate commits may not be, which costs some git bisect granularity.

That partially offsets the trunk coverage added in #3. If you'd rather keep
every main commit built and only dedupe PR runs, change one line:

cancel-in-progress: ${{ github.event_name == 'pull_request' }}

I went with unconditional cancellation since that matches the follow-up as
described, but the conditional form is a defensible default — happy to switch.

Verification

This PR's own run exercises the file. Cancellation behavior only shows up under
concurrent runs, so it isn't directly observable here; the group key is the part
worth reviewing.

🤖 Generated with Claude Code

Each ref now has one concurrency group, so pushing again to a PR branch
or landing another merge cancels the run that is already in flight.
The macOS test job takes 3-5 minutes, so without this a burst of pushes
queues several runs whose results are obsolete before they finish.

github.ref keys the group, which keeps refs isolated: pull_request runs
use refs/pull/N/merge and push runs use refs/heads/main, so a merge to
main never cancels an open PR's run, and PRs never cancel each other.

Note this trades away per-commit coverage on main: in a rapid series of
merges only the newest commit keeps a completed run. The tip of main is
always verified; intermediate commits may not be. To keep every main
commit built, make cancellation conditional instead:

  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

11 finding(s)

HIGH/CRITICAL: 11

Severity Rule Location
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:57
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:79
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:104
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:140
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:141
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:199
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:257
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:276
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:360
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:378
HIGH secret-generic-credential bitchatTests/PasswordProtectedChannelTests.swift:388

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio marked this pull request as ready for review August 3, 2026 23:39
@ralyodio
ralyodio merged commit 9941680 into main Aug 3, 2026
6 checks passed
@ralyodio
ralyodio deleted the ci/check-concurrency branch August 3, 2026 23:39
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