Skip to content

Let a requested pull request reach the queue without help - #417

Merged
n0rpan merged 2 commits into
mainfrom
ci/gate-security-review
Dec 3, 2026
Merged

n0rpan merged 2 commits into
mainfrom
ci/gate-security-review

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

The maintainer's goal: a requested pull request should reach the queue without anyone spending time on it. On 2026-12-03 it did not, for two reasons.

Fault 1: the security review never arrives

When the head of a requested pull request has no security review, auto-queue.sh posts @codex security review. Codex answers with a code review of the head and leaves its security entry at an older commit. The gate reads only that entry, so it reports "no answer yet to the security review request" indefinitely. This held #394, #388 and #401 for about an hour each, with consent given, checks green and no open findings. A second request by hand got the same answer.

What does start the security review: every pull request the gate admitted that day (#356, #364, #366, #386) shows both reviews of its head with the trigger "Draft marked ready". The held ones show "PR opened" on an older commit. #388 was made a draft and ready again by hand at 18:34 UTC, and Codex's summary showed both reviews of its head by 18:36.

Change. After posting the comment that records the request, the gate runs gh pr ready --undo and gh pr ready. The comment already limits this to once per head commit. If the pull request cannot be marked ready again, the gate retries once and then fails the run with an error naming it.

Fault 2: the gate's own removal ends the request

A pull request that sits in the queue while the gate holds it is taken out by the gate, and the gate then treated that removal as the end of the maintainer's request. #388 was queued by hand at 18:16 UTC while its security review was missing, removed by the gate at 18:32:24, and then answered "previous queue request expired after removal".

Real events, read through GraphQL in run 47176847530: the gate's removal of #388 is reason: "manual", actor n0rpan, identical to one made by hand. GitHub's own is reason: "failed_checks", actor github-merge-queue. The event cannot tell the first two apart.

Change. The gate notes the time of a removal it made in its status comment (<!-- ox-auto-queue-removed <time> -->), and that removal alone leaves the request standing. A removal by GitHub or by the maintainer still ends it. If GitHub removes the entry first, the gate's mutation fails and nothing is noted.

Unchanged

A completed security entry for the exact head with no unresolved findings is still required. test_an_ordinary_review_cannot_stand_in_for_security passes untouched. Consent, checks and review threads are read as before.

Verified

  • python3 -m unittest discover -s desktop/ci -p 'test_*.py': 73 passed. New cases: comment, then draft, then ready, once per head; a pull request left as a draft fails the run after one retry; the gate's own removal is noted and does not end the request; a later removal does; another author's comment cannot claim one; a removal GitHub made first is not noted.
  • bash -n passes and shellcheck -S warning reports nothing.
  • The effect of draft-then-ready on Codex, by hand on Measure scoped CI against actual merge-group results #388.

Not verified

  • The gate doing either. The triggers run main's copy, so both first run on the first requested pull request after merge. Measure scoped CI against actual merge-group results #388 is waiting at a new head and will be that test.
  • That the token in the auto-queue environment may convert a pull request to draft. It already comments and turns auto-merge off.
  • AUTO_QUEUE_DRY_RUN=1 against a real pull request: it needs GraphQL, which this session cannot reach, and a dry run exits before both changes.
  • auto-queue.yml also listens for converted_to_draft and ready_for_review, but its pull_request_target runs end in startup_failure (30 of the last 30). The gate is re-evaluated by Codex's summary edit instead, as today. That startup failure is a separate fault, not addressed here.

Checked against main at 97f609a.


Generated by Claude Code

The gate asks for a security review of the head with a comment. Codex
answers that comment with a code review and leaves its security entry at
an older commit, so the gate waits for an answer that does not come. On
2026-12-03, #394, #388 and #401 each waited about an hour that way, with
consent given, checks green and no findings, until the maintainer merged
around the gate.

Codex starts its security review when a pull request opens or a draft is
marked ready. Every pull request the gate admitted that day carried the
trigger "Draft marked ready" on both reviews, and #388 received both for
its head within two minutes of being made a draft and ready again.

After recording the request in its comment, the gate now does that itself,
once per head commit. If it cannot mark the pull request ready again it
retries once and fails the run.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz
A pull request that is in the queue while the gate holds it is taken out
by the gate. The gate then read its own removal as the end of the
maintainer's request: #388 was queued by hand at 18:16 UTC on 2026-12-03
while its security review was missing, removed by the gate at 18:32, and
answered "previous queue request expired after removal" once the reviews
were in.

GitHub records the gate's removal and one made by hand identically (reason
"manual", the maintainer's account), and its own as "failed_checks" by
github-merge-queue. So the gate notes the time of a removal it made in its
status comment, and only that removal leaves the request standing. A
removal GitHub made first is not recorded.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 9ffab77


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Not in line to merge yet: no answer yet to the security review request for 9ffab77. Nothing to do; this updates when Codex has answered.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Asked for by the maintainer’s queue request, for commit 9ffab77.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T18:50:59.217228Z 9ffab77 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 9ffab77d43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@n0rpan
n0rpan merged commit 20f8288 into main Dec 3, 2026
21 checks passed
@n0rpan
n0rpan deleted the ci/gate-security-review branch December 3, 2026 18:57
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.

2 participants