Skip to content

ci: dispatched Queue reports only on open main PR heads - #9692

Merged
kixelated merged 3 commits into
mainfrom
quest/m0/ci/queue-dispatch-open-heads
Nov 26, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m0/ci/queue-dispatch-open-heads

Conversation

@kixelated

@kixelated kixelated commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

gh workflow run queue-pr.yml -f sha=<sha> posted a skipped Queue check on any commit. Dispatched on a merge group's commit by mistake, that skipped Queue would pass the group before its build reports.

Approach

  • The dispatch step now lists open PRs into main (pulls?state=open&base=main, paginated) and requires one whose head is $SHA; otherwise it exits non-zero with an ::error:: and posts nothing. The job gains pull-requests: read.
  • sh/gh/queue.test.ts runs the step against a stub gh (answering the listing through the step's own --jq filter) and asserts it posts for an open main PR head and refuses any other commit.
  • Deletes the finished quest.

Choice made without asking (deviates from the quest's Plan): the Plan named gh api repos/$REPO/commits/$SHA/pulls, but that endpoint returns nothing for an open fork PR's head (checked on #9688), which would refuse exactly the fork PRs a dispatch exists to fix. Listing open PRs into main covers forks, and closed PRs and other bases drop out server-side. Cost: one page per 100 open PRs (one call today, 45 open).

Impact

  • No public API or wire change. CI only: a dispatch on a commit that is not an open main PR's head now fails instead of posting.

Validation

Alternatives

  • commits/$SHA/pulls per the Plan: rejected, misses fork PRs (above).

Follow-ups

None.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown (arm B)

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 6ba0f95

  • Base: origin/main at 4fba5df

  • Risk: high, it changes .github/workflows/queue-pr.yml, which is always high: workflows run with the repository's secrets

  • Classified: high by the always-high paths

  • Risk file: bb7b1c0de60b

  • Reviewer: Codex, gpt-6.2-sol, low effort

  • Session: 01a218ef-381f-7b23-9e25-1b4233a12860, round 1

  • Score: 9/10, The review found no blockers by inspection and verified that dispatch requires a matching open PR targeting main before posting the skipped Queue check, but did not run tests.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Claude Code, claude-opus-5-5, medium effort, second

  • Session: 11645ea5-65f5-46c1-ad84-19c39cf1e2c4, round 1

  • Score: 9/10, The change is small and correct: a dispatch now posts a skipped `Queue` only on the head of an open PR into main, so a merge group commit can no longer pass before its build reports. Only notes remain.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Notes, the author's to take or leave:

    • sh/gh/queue.test.ts:134: Test stub runs the --jq filter through system jq, not gh's built-in gojq
    • sh/gh/queue.test.ts:141: No test pins the open/base=main filter on the PR listing

kixelated and others added 3 commits November 26, 2026 09:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Queue (pull request) dispatches report only on open PR heads ci: dispatched Queue reports only on open main PR heads Nov 26, 2026
@kixelated
kixelated marked this pull request as ready for review November 26, 2026 17:38
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Manual dispatches now require a full commit SHA that matches the head of an open pull request targeting main. The workflow adds pull-requests: read permission and creates the skipped Queue check only after the match. Tests cover the permissions and matching and nonmatching dispatch outcomes. The proposal document for this guard was deleted.

Merge Risk: Minimal · up to 6ba0f

Manual Queue dispatches now post a check only for the head of an open pull request into main, and other SHAs fail without posting. The change is small, tested, and easy to revert. No material merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main behavior change: a dispatched Queue report now posts only for open main PR heads. It matches the workflow guard in queue-pr.yml and the tests in sh/gh/queue.test.ts. The title…
Description check Passed The description states the problem (dispatch posted a skipped Queue check on any commit), the approach (paginated open-PR listing into main with a head-SHA match, plus pull-requests: read), the stub-b…
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: Title check

Explanation

The title names the main behavior change: a dispatched Queue report now posts only for open main PR heads. It matches the workflow guard in queue-pr.yml and the tests in sh/gh/queue.test.ts. The title is specific and concise.

Full details: Description check

Explanation

The description states the problem (dispatch posted a skipped Queue check on any commit), the approach (paginated open-PR listing into main with a head-SHA match, plus pull-requests: read), the stub-based test, and the quest deletion. This matches the raw summary of queue-pr.yml, queue.test.ts, and the deleted quest document.

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

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: 72261757-51c1-4607-969d-86c61d5f82be
Commits

Reviewing files that changed from the base of the PR and between 4fba5df and 6ba0f95.

Files selected for processing: 3

  • .github/workflows/queue-pr.yml
  • quest/m0/ci/queue-dispatch-open-heads.md
  • sh/gh/queue.test.ts
Files with no reviewable changes: 1

  • quest/m0/ci/queue-dispatch-open-heads.md

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

@kixelated
kixelated added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 61b4677 Nov 26, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m0/ci/queue-dispatch-open-heads branch November 26, 2026 17:48
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