Skip to content

ci: stop the changelog gate's cancelled duplicate from reading red - #1417

Merged
wshlavacek merged 1 commit into
mainfrom
ci/changelog-label-race
Oct 30, 2026
Merged

wshlavacek merged 1 commit into
mainfrom
ci/changelog-label-race

Conversation

@wshlavacek

@wshlavacek wshlavacek commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

A pull request opened with gh pr create --label "changelog exempt" fires opened and labeled together. Under the changelog workflow's concurrency group with cancel-in-progress, one of the two runs was cancelled, and the cancelled run stays in the commit's status rollup as a second fragment staged. The rollup then reads FAILURE although every check that ran passed.

Measured with statusCheckRollup on the commits involved:

Change

  • The concurrency block is gone. Dropping only cancel-in-progress would not be enough, because a group still cancels a pending run when another queues behind it (opened plus two labels is three runs). The job is read-only and takes seconds.
  • With every run finishing, the runs have to agree. The label escape read github.event.pull_request.labels, which is a snapshot of the moment each event fired, so an opened run could fail for real on an exempt pull request beside a labeled run that passed. The step now reads the labels from repos/…/pulls/N when it runs.
  • The label read is a plain assignment, so a failed API call ends the step under the runner's bash -e. It is not read as "no label", and there is no grep -q under pipefail.
  • test_changelog_fragments.py gains a textual pin (no concurrency, no payload label read), in the style of the module's other workflow checks. It fails against main's workflow.

Checked

Not changed here: the commit's statusCheckRollup counts every check run on a commit, so on #1418 the red unlabeled run kept the commit's rollup at FAILURE after the label went back on, although gh pr checks showed pass. That is how the label escape has always behaved after a red run, not something this change introduces.

`gh pr create --label "changelog exempt"` fires `opened` and `labeled`
together. Both runs shared `concurrency: changelog-${{ github.ref }}` with
`cancel-in-progress`, so one was cancelled, and a cancelled run is not
neutral: it stays in the commit's status rollup beside the run that
finished, as a second `fragment staged`, and the rollup reads FAILURE.
The first commits of #1407 and #1408 read FAILURE with every check that
ran passing, and the heads of #1262, #1258, #1251, #1223, #1184, #909 and
#839 carry the same cancelled-plus-success pair.

Removing only `cancel-in-progress` would not close it: a concurrency group
still cancels a pending run when another queues behind it, and `opened`
plus two labels is three runs. The concurrency block goes entirely. The
job is read-only and takes seconds, so overlapping runs cost nothing.

They do have to agree, though, and the label escape read
`github.event.pull_request.labels`, a snapshot of the moment each event
fired. With cancellation gone, an `opened` run whose payload predates the
label could fail for real on an exempt pull request, beside a `labeled`
run that passed. The step now reads the labels from the pulls API when it
runs, so every run sees the same list. The read is a plain assignment, so
a failed call ends the step under the runner's `bash -e` rather than
reading as "no label", and a `grep -q` never sits under `pipefail`.

A textual test pins both halves, in the style of the module's other
workflow checks. It fails against main's workflow.
@wshlavacek wshlavacek added the changelog exempt Exempt from the changelog-fragment gate: no user-visible change, or the release commit label Oct 30, 2026
@wshlavacek
wshlavacek merged commit 196d089 into main Oct 30, 2026
15 checks passed
@wshlavacek
wshlavacek deleted the ci/changelog-label-race branch October 30, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog exempt Exempt from the changelog-fragment gate: no user-visible change, or the release commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant