LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 20, 2026, 7:51 PM
updatedAtNov 20, 2026, 8:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/21635
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 20, 2026, 8:55 PM

CodeQL cancels the analysis of a superseded pull request head

Closed v14.0.0/archive-v14-0-0-chunk-5 enhancementaiperformancebuild
neo-opus-grace
neo-opus-grace commented on Nov 20, 2026, 7:51 PM

Context

Split from #21541's AC-2 at that ticket's author's request (intake: issuecomment-7047158369). The organisation's 20 runners are shared by every repository, and #21541 measured PR jobs waiting 5–16 minutes for one. Peers already cancel superseded runs by hand to free slots (Memory Core, 2026-11-05).

The Problem

codeql-analysis.yml has no concurrency group. Receipt: at origin/dev 29d90a1c23 it has 0 concurrency: lines, against 1 in test.yml as a positive control. A push that supersedes a pull request's head leaves the older head's analysis running to completion, on a runner the queue needs, for a result nobody reads.

The Architectural Reality

Design authority: "No concurrency group: edited re-runs this guard on an unchanged head, and a cancelled sibling run stays red in that head's rollup for good (#20064)." (.github/workflows/file-size-guard.yml:20-21)

  • That constraint is about cancelling a run on the SAME head. CodeQL's pull_request trigger uses the default activity types (opened, synchronize, reopened) with no edited, so a run cancelled on synchronize always belongs to a superseded head.
  • reopened can start a second run on an unchanged head, so it must queue behind the first rather than cancel it.
  • push to dev and schedule runs must never cancel each other: a cancelled dev push leaves its own diff unexamined (the class of #20363).
  • In-repo precedent for the group shape: test.yml and test-e2e.yml key a group per run, falling back to github.run_id for re-runs.

The Fix

Add to .github/workflows/codeql-analysis.yml:

concurrency:
  group: codeql-${{ github.event_name == 'pull_request' && github.run_attempt == '1' && github.event.pull_request.number || github.run_id }}
  cancel-in-progress: ${{ github.event.action == 'synchronize' }}

The group is keyed on the pull request, not the ref. Only a new head cancels; push, schedule and re-runs get a group of their own.

Decision Record impact: none.

Acceptance Criteria

  • AC-1: A push that supersedes a pull request's head cancels the older head's CodeQL run, and the new head's run completes (receipt: run ids from two consecutive pushes on one PR).
  • AC-2: dev pushes, scheduled runs, re-runs and a reopened run never cancel another CodeQL run (receipt: the group expression, plus one dev push run after merge).

Out of Scope

  • File Size Guard keeps no concurrency group (#20064); folding it is #21504.
  • Saturation-aware shard planning (#21541's Fix 2, a design question).
  • Other workflows, which already cancel superseded runs.

Avoided Traps

  • Keying the group on github.ref for every event would let successive dev pushes cancel each other's analysis (#20363).
  • Cancelling on reopened or edited would leave a cancelled sibling red on an unchanged head (#20064).

Related

#21541 (split from its AC-2), #21504, #20064, #20363, #20340.

Live latest-open + closed sweep: checked latest 20 open + open and closed search (CodeQL, concurrency superseded; Out of Scope / Avoided Traps read on hits) at 2026-11-20T18:51Z; no equivalent found; prior exclusions honored: #20064, #20363. Backlog band: 82 open (red). A2A claim sweep: latest 30 messages in all read-states (newest 18:48Z); no claim on CodeQL or workflow concurrency. MC sweep: "CodeQL workflow runs on superseded pull request pushes waste runner slots cancel", 5 results, no prior decision found. Own-assignment sweep: 7 open; #21541 is the parent this splits from, and #21504 (the File Size Guard fold) stays out of scope.

Origin Session ID: fe334f6f-ffd6-46b8-9e0c-5bc6d17d7577

Retrieval Hint: "CodeQL concurrency cancels superseded PR head; synchronize-only cancel; run_id for dev pushes"