Skip to content

fix(ci): never cancel a pull request's Queue check - #539

Merged
kixelated merged 1 commit into
mainfrom
fix/queue-pr-cancel
Nov 3, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/queue-pr-cancel

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq-dev/rust2#536 made the required Queue job report the reusable build's result: needs: build with if: always() && github.event_name == 'merge_group'. On a pull request that job now waits for build to skip before it skips itself. The workflow-level concurrency group (cancel-in-progress: true) cancels a PR's run when a second event for the same PR arrives within seconds, such as synchronize from a push followed by edited from a body edit. The cancelled run's Queue check then reports cancelled, which fails the required check and blocks enqueueing.

Seen on moq-dev/quest#445, head adb28aa6: run 41683755363 had Queue cancelled while Queue build and Report Queue skipped, next to run 41683758122, which skipped normally. Both were created in the same second.

Approach

Drop the workflow's concurrency group and say why in a comment:

  • Merge groups each have their own ref, and dispatches each have their own head, so the group never coordinated a merge-group run with another. Its only effect was cancelling a PR's duplicate run, which is the bug.
  • With no group, nothing cancels a pull request's run, so its Queue check always ends skipped.
  • The merge-group path is unchanged: Queue still runs under always() and fails when the build fails or is cancelled, so a skipped context can't pass the group.

Alternatives

  • cancel-in-progress: ${{ github.event_name != 'pull_request' }}: rejected. A group without cancel-in-progress still cancels a pending run when a newer one queues (GitHub docs on concurrency), so three quick events would still cancel the middle run's Queue.
  • Make Queue skip immediately off merge groups: not possible while it keeps needs: build, since a job waits for its needs before it evaluates if. always() is what keeps it running when the build is cancelled (status check functions). Dropping needs would lose the build's result.

Impact

  • No public API change. CI only.

Related

Review

  • Reviewer: Codex (quest review --base origin/main), gpt-6.1-sol, medium effort
  • Head: e6356c694ab5c0b91a46d1573653c3cfe5fe3344
  • Findings: none

Follow-ups

  • None.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

The workflow-level concurrency group cancelled a pull request's run when a
second event for the PR arrived within seconds (a push, then a body edit).
Its `Queue` job, which waits on `build` before it skips, then reported
cancelled and failed the required check. Even without cancel-in-progress, a
group cancels a pending run, so drop the group: merge groups each have their
own ref, and a repeated dispatch only reports the same skipped context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The queue workflow removes its concurrency group and cancel-in-progress: true setting. Comments describe pull-request runs waiting for build before skipping, separate refs for merge groups, and repeated dispatches reporting the same skipped context.

Merge Risk: Minimal · up to e6356

Removing workflow concurrency prevents duplicate pull-request events from cancelling Queue checks. No actionable merge-blocking risk is established; the change is ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main CI change: preventing cancellation of a pull request's Queue check.
Description check Passed The description is directly related to the changeset. It explains the cancellation problem, the removal of workflow concurrency, the merge-group behavior, and the CI-only impact.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9cf77919-655e-4181-a2b4-70a0ca16e646
Commits

Reviewing files that changed from the base of the PR and between a64d71a and e6356c6.

Files selected for processing: 1
  • .github/workflows/queue.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit d6355ea Nov 3, 2026
7 checks passed
@kixelated
kixelated deleted the fix/queue-pr-cancel branch November 3, 2026 18:37
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