Repository navigation
Commit 747e009
authored
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-gate` nor `enqueue-guard` could read it. This adds the
missing reader.
## The window, as it happened (#3279, 2026-11-21)
| UTC | event |
| --- | --- |
| 04:47:33Z | `Test` green at the tip — every check the queue reads has
now run |
| 04:47:43Z | the author comments `Stop request for this tip: …` |
| 04:47:58Z | the queue merges the entry; nothing read the request |
After: the comment takes the entry out of the queue through
`dequeuePullRequest`, and the pull
request stays open at its head.
## What changed
- `.github/scripts/stop-request.mjs` — `parseStopRequest` reads `Stop
request for this tip: <sha>`
(case-insensitive, across lines, backticks allowed); `sameSha` accepts a
12+ character short sha
either way; `dequeue` calls GraphQL `dequeuePullRequest` for the pull
request node and returns
`skipped` on 404/422 or when the head moved; `handleStopRequest` is the
one decision, with the
GraphQL client injected so the tests are offline.
- `.github/workflows/stop-request.yml` — `issue_comment` `created`, pull
requests only, code taken
from `main`; `stop-request.mjs` drops anything that is not the marker,
another tip, a merged pull
request or a base other than `main`. On success it leaves `Dequeued by:
Chief` with the tip and a
link to the stop comment.
- `.github/scripts/stop-request.test.mjs` — 10 tests, written first and
run red against a missing
module.
- `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:
```sh
$ cd .github/scripts && TZ=UTC node --test stop-request.test.mjs
# tests 10
# pass 10
# fail 0
$ cd .github/scripts && TZ=UTC node --test enqueue-guard.test.mjs merge-gate.test.mjs
# tests 207
# pass 207
# fail 0
$ node .github/scripts/testing-layers.mjs --check
# 37 test file(s) in 18 workflow(s); every test file and every workflow is classified
$ node -e 'YAML.parse(readFileSync(".github/workflows/stop-request.yml","utf8"))'
# issue_comment: {types: [created]}; yaml@2.9.1, syntax only
```
All four ran at `b27e1ffab8a1800c4fa2667c4274f2d6bc5c41e7`; the five
files in this commit are byte
for byte the ones those runs read (blob sha compared).
### Revert check (red)
With `.github/scripts/stop-request.mjs` replaced by a no-op stub
(`parseStopRequest` → null,
`sameSha` → false, `dequeue` → `skipped`, `handleStopRequest` →
`{action:'none'}`) the same command
goes red: 6 of 10 fail, exit 1.
- not ok 1 — parseStopRequest reads the tip request, its short sha and
backticks, and nothing else
- not ok 2 — sameSha accepts a 12-character short sha either way and
refuses another tip
- not ok 3 — dequeue takes the entry out through dequeuePullRequest at
the tip it read
- not ok 6 — a stop request naming the live tip is dequeued and leaves
`Dequeued by: Chief`
- not ok 7 — a stop request naming another tip changes nothing
- not ok 9 — only a pull request based on main is read, and a merged one
is never re-judged
The 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 verify` and the core/plugins suites: this host has no full
checkout and no
`core/node_modules` (only api.github.com is reachable, github.com is
not). The full
`.github/scripts/*.test.mjs` suite was run instead: 673 pass, 21 fail,
every failure from files the
partial checkout does not have (`core/`, `plugins/`, `CHANGELOG.md`,
`docs/images/`) — none names
`stop-request`. CI's `package` job, which does have the checkout, ran
them green.
- `actionlint` is not installed here; the workflow was parsed with the
`yaml` package.
- The real `dequeuePullRequest` call is not exercised locally: the
GraphQL client is injected in the
tests 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
<!-- flybot: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: <sha>',
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"
}
<!-- /flybot:checkpoint -->
1 parent 041342a commit 747e009
5 files changed
Lines changed: 429 additions & 0 deletions
File tree
- .github
- scripts
- workflows
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
0 commit comments