Repository navigation
fix(gate): a stop request dequeues a queued entry (#3280) - #3285
Merged
Merged
Conversation
A stop request that lands after a queue entry's required checks have run is read by nothing: on #3279 `Test` went green at 04:47:33Z, the author's request landed at 04:47:43Z, and the queue merged at 04:47:58Z. Add an `issue_comment` workflow that takes the entry out through `dequeuePullRequest` when the body is `Stop request for this tip: <sha>` and the sha is still the head. It runs only on a pull request based on `main`, only for the live tip, and writes one note naming the tip and the request it answered. Docs-not-needed: .github scripts and workflows own no subsystem page; the test-layer manifest and its generated doc are updated in this commit.
Collaborator
Author
|
Verdict: PASS at b27e1ff Ran at this tip: Red first (revert-to-base)
Semantics
Nits (not blocking)
Scope5 files, +429/−0: |
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.
Written-by: Dev
Fixes #3280
Owner: Dev
Reviewer: Reviewer
A stop request takes the entry out of the queue
On #3279 the queue entry's required checks had all passed before the author's stop request existed, so
neither
merge-gatenorenqueue-guardcould read it. This adds the missing reader.The window, as it happened (#3279, 2026-11-21)
Testgreen at the tip — every check the queue reads has now runStop request for this tip: …After: the comment takes the entry out of the queue through
dequeuePullRequest, and the pullrequest stays open at its head.
What changed
.github/scripts/stop-request.mjs—parseStopRequestreadsStop request for this tip: <sha>(case-insensitive, across lines, backticks allowed);
sameShaaccepts a 12+ character short shaeither way;
dequeuecalls GraphQLdequeuePullRequestfor the pull request node and returnsskippedon 404/422 or when the head moved;handleStopRequestis the one decision, with theGraphQL client injected so the tests are offline.
.github/workflows/stop-request.yml—issue_commentcreated, pull requests only, code takenfrom
main;stop-request.mjsdrops anything that is not the marker, another tip, a merged pullrequest or a base other than
main. On success it leavesDequeued by: Chiefwith the tip and alink to the stop comment.
.github/scripts/stop-request.test.mjs— 10 tests, written first and run red against a missingmodule.
docs/testing-layers.json/.md— the new workflow's row in the manifest and the regenerated table.Verification
Reproduce: a queue entry whose required checks are all green, then
Stop request for this tip: <sha>on the pull request. Before, the queue merges it 15 s later; after, the entry is dequeued.
Ran at this tip:
All four ran at
b27e1ffab8a1800c4fa2667c4274f2d6bc5c41e7; the five files in this commit are bytefor byte the ones those runs read (blob sha compared).
Revert check (red)
With
.github/scripts/stop-request.mjsreplaced by a no-op stub (parseStopRequest→ null,sameSha→ false,dequeue→skipped,handleStopRequest→{action:'none'}) the same commandgoes red: 6 of 10 fail, exit 1.
Dequeued by: ChiefThe 4 that stay green are the assertions that nothing happens (a non-stop comment, a plain issue) and
the two skip branches the stub answers with the same value. The implementation was restored (blob sha
matches the tip) and both commands re-ran green.
Not run
npm run verifyand the core/plugins suites: this host has no full checkout and nocore/node_modules(only api.github.com is reachable, github.com is not). The full.github/scripts/*.test.mjssuite was run instead: 673 pass, 21 fail, every failure from files thepartial checkout does not have (
core/,plugins/,CHANGELOG.md,docs/images/) — none namesstop-request. CI'spackagejob, which does have the checkout, ran them green.actionlintis not installed here; the workflow was parsed with theyamlpackage.dequeuePullRequestcall is not exercised locally: the GraphQL client is injected in thetests and only a live stop-request comment will use it.
Docs-not-needed: .github scripts and workflows own no subsystem page; the test-layer manifest and its
generated doc are updated in this commit.
Checkpoint
{
"pr": 3285, "claim": "Dev", "issue": 3280,
"summary": "A stop request posted after a queued entry's required checks have run now takes that entry out of the merge queue. A new issue_comment workflow reads 'Stop request for this tip: ', confirms the sha is still the live head of a pull request based on main, and calls GitHub's dequeuePullRequest. It leaves one note naming the tip and linking the request. The GraphQL client is injected, so the tests run offline.",
"files": [".github/scripts/stop-request.mjs",".github/scripts/stop-request.test.mjs",".github/workflows/stop-request.yml","docs/testing-layers.json","docs/testing-layers.md"],
"checks": { "ran": "node --test stop-request.test.mjs; node --test enqueue-guard.test.mjs merge-gate.test.mjs; testing-layers.mjs --check", "result": "green", "at": "b27e1ffab8a1800c4fa2667c4274f2d6bc5c41e7" },
"next": "none — ready for review"
}