fix(ci): stop the CLA workflow cancelling itself on its own instructions - #148
Merged
Merged
Conversation
Member
Author
|
I have read and agree to the SixSentences CLA v1.0. |
21 tasks
Every pull request showed a failed check named "Publish CLA status" beside the
green "CLA / acceptance" it had just produced:
Canceling since a higher priority waiting request for cla-144 exists
CLA acceptance verified for @L4XB on pull request #144.
##[error]The operation was canceled.
The run had already done its work. It was cancelled during cleanup, and GitHub
reports a cancelled run as a failed check.
Two events seconds apart share the concurrency group: opening the pull request
fires `pull_request_target`, and posting the acceptance sentence fires
`issue_comment`. That is not an unlucky ordering — CONTRIBUTING.md instructs the
author to post that sentence on the pull request they just opened, so the
comment reliably lands mid-run. The workflow cancelled itself on the one
sequence the documentation asks every contributor to perform, and showed a red X
next to the word CLA to the people least equipped to read it.
The runs queue now, as issue-claims.yml already does for the same reason. They
are idempotent: each reads the head commit and the comments live and publishes a
status for that exact commit, so serialized runs converge rather than fight, and
the reminder stays behind its marker check. A test plays the real sequence —
open, remind, remind again, accept, re-run — and asserts one reminder and a
stable verdict.
Queueing is also the safer of the two. Cancelling left a window where a
half-finished run could publish a stale verdict; serialized runs mean the one
that finishes last is the one that saw the newest state.
Closes #146
Signed-off-by: L4XB <L4XB@users.noreply.github.com>
L4XB
force-pushed
the
fix/cla-concurrency
branch
from
September 15, 2026 11:04
3797e83 to
b54eb22
Compare
Member
Author
Self-reviewRecorded under the founding-maintainer exception in
What this cannot prove locallyThe end-to-end criterion. The workflow that ran for this pull request is the ChecksEvery required context is green. Merging. |
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cancel-in-progress: falseon the CLA workflow, so it stops cancelling itself onthe sequence
CONTRIBUTING.mdasks every contributor to perform.Seen on #144, and on every pull request before it:
The run had already verified the acceptance and published the status. It was
cancelled during cleanup by the next event in the same concurrency group, and
GitHub reports a cancelled run as a failed check.
Behavior and compatibility
What was happening
pull_request_target: openedstarts run A.CONTRIBUTING.mdtellsthem to — which fires
issue_comment: createdand queues run B.cla-<number>,cancel-in-progress: truekills A.the green CLA / acceptance it produced moments earlier.
The required check was never in danger:
CLA / acceptanceis the requiredcontext and it was green, and
Publish CLA statusis not required, so nothingwas ever blocked. Nothing on the pull-request page says that. A first-time
contributor sees a red X next to the word CLA immediately after doing exactly
what they were asked.
Why queueing is correct here, not just quieter
Cancelling would be the right choice if a superseded run's work were wasted.
It is not, and it was never safe:
check_cla.pyreads the head SHA fromGET /pulls/{n}at the start of eachrun, not from the event payload, and posts the status against that commit.
Two runs therefore write per-commit statuses that cannot clobber each other
wrongly.
newest comments and the newest head. Convergence, not a race.
pending, bekilled before publishing the verdict, and leave a pull request pending on a
check that nothing would re-trigger until the next event.
issue-claims.ymlalready reaches the same conclusion for its own reason ("Twopeople claiming the same issue in the same second must not both win"). This
brings the second workflow that reacts to comments into line with it.
Cost
One job of about eight seconds per comment event on a pull request, instead of
collapsing them. They run one at a time, so a chatty pull request queues rather
than fans out.
Residual case, stated rather than hidden
With
cancel-in-progress: false, GitHub still cancels a pending run when anewer one queues behind an already-running one. That needs three events in quick
succession — open, comment, comment — and cancels a run that never started
rather than one mid-flight. The common sequence this issue is about, open then
accept, produces no cancellation at all. Eliminating the remaining case would
mean not triggering on ordinary comments, which would also stop noticing a
deleted acceptance; that trade is not worth making here.
Not changed
The verifier itself, the status context, the acceptance sentence, the reminder,
the permissions, the checkout of the protected default branch, and the triggers.
Rollback is reverting one line.
Validation
Two new tests, one per acceptance criterion that can be asserted locally:
test_the_cla_workflow_queues_its_runs_instead_of_cancelling_thempins thesetting and the reason, in the same shape as the existing claim-workflow test.
test_repeated_cla_runs_repeat_the_result_without_repeating_the_reminderplays the real serialized sequence against a stubbed API — open (reminder
posted), the reminder's own event (no second reminder), acceptance (success),
and one more run (still success, still one reminder). This is the criterion
about idempotency and the one about not reminding twice.
The criterion about a
synchronizemid-run is covered by construction and bythe existing
test_cla_status_is_bound_to_the_exact_pull_request_head: thestatus is always posted against the head SHA read from the API during that run,
so the queued
synchronizerun ends with the newest commit carrying a verdict.The end-to-end criterion — "opening a pull request and posting the CLA sentence
immediately afterwards leaves no failed check" — can only be observed on a real
pull request. This pull request is that test: it was opened and the
acceptance sentence posted immediately afterwards. Note that the workflow that
runs for this pull request is the one on
main, so the red X is expected hereand should be gone on the next pull request after the merge. I will confirm it
on the following one.
Review boundaries
pull_request_targetreading only the protected default branch, stillchecks out no contribution ref, still executes no contributor-controlled
code, and keeps the same
permissions:block. Concurrency changes when arun executes, never what it is allowed to do. Serializing removes a
cancellation window in which a pull request could be left permanently
pendingon a required status.Source-release hygiene
CHANGELOG.mdis updated for user-visible changes, or the omission is explained above: this changes when a repository workflow runs. It does not change the engine, the API, the web client or any released artifact, so there is nothing for a user of a release to read.Signed-off-bytrailer.CLA.mdand posted its exact acceptance sentence as a standalone pull-request comment.Visual evidence
No UI change.
Closes #146