Skip to content

ci: push and schedule runs get their own concurrency group; only PR runs cancel each other - #76

Merged
askalf merged 2 commits into
mainfrom
ci/concurrency-run-id
Sep 23, 2026
Merged

askalf merged 2 commits into
mainfrom
ci/concurrency-run-id

Conversation

@askalf

@askalf askalf commented Sep 23, 2026

Copy link
Copy Markdown
Owner

GitHub keeps at most one pending run per concurrency group and cancels the older pending one when another arrives, whatever cancel-in-progress says. The groups added in the Actions-audit PR were keyed on ${{ github.workflow }}-${{ github.ref }} for every event. So with a main-branch run A in progress and B queued, a third push C cancelled B, and a scheduled CodeQL run could be replaced the same way. The comment promised default-branch results were never dropped; a queued one could be. (Found by the second-opinion review.)

Now the group is ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}:

  • PR runs share one group per branch, and cancel-in-progress (still true for PRs only) cancels the superseded run.
  • Every push and schedule run gets its own group (its run id), so none is ever replaced or cancelled.

Validated: every workflow in the repo parses, and actionlint 1.7.7 is clean.

…uns cancel each other

GitHub keeps one pending run per concurrency group, so the shared workflow/ref group let a newer push replace a queued default-branch run. Non-PR events now group by run id; PR runs still share a per-branch group and cancel the superseded run.
@askalf
askalf enabled auto-merge (squash) September 23, 2026 15:52
@github-actions github-actions Bot added github_actions Pull requests that update GitHub Actions code size/S 10-49 hand-written lines labels Sep 23, 2026

@sprayberry-secondread sprayberry-secondread left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated review from the Sprayberry Labs fleet code reviewer.

Reviewed by the Claude second-opinion lane (second opinion, non-gating; the gating review is posted separately).

No blocking issues or actionable findings in the reviewed diff at 1552f31.

Checked all changes in .github/workflows/build.yml, .github/workflows/ci.yml, and .github/workflows/codeql.yml. For pull-request events, the expression selects the nonempty PR ref, preserving a shared group for superseded runs. For push and schedule events, it selects the run ID, so separate runs no longer compete for GitHub's single pending slot. The workflow-name prefix maintains separation between workflows, and cancellation remains restricted to PR events.

What's good: the change is narrowly scoped and the comments explain the pending-run replacement behavior that motivates it.

All five reported CI checks pass. I did not run local tests or exercise live concurrency scheduling; this review covers the complete diff and its expression semantics.

The expressions are self-describing; the reasoning stays in the PR description.

@sprayberry-redline sprayberry-redline left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated review from the Sprayberry Labs fleet code reviewer.

Reviewed by the GPT gating lane (gating review).

APPROVE: No blocking issues found.

Reviewed all three workflow diffs at d5c18748397fb39af817649897cd57920e0c5d08, plus the PR description and commit messages. For pull-request events, the nonempty PR ref keeps superseded runs in the same workflow-specific group. Other events use the unique run ID, so separate push and scheduled runs no longer compete for the single pending slot. The unchanged cancellation predicate remains limited to pull requests.

The change is small and consistent across build, CI, and CodeQL, and removes the misleading concurrency comments. All five reported checks pass. This workflow-only PR is verification-exempt; no local test suite was run.

@askalf
askalf merged commit 486832c into main Sep 23, 2026
5 checks passed
@askalf
askalf deleted the ci/concurrency-run-id branch September 23, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code size/S 10-49 hand-written lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants