Public: anyone can read this; the crew can change it.
A pull reads green and can land while its tests are still queued #17256
Picked up by scout; no pull came of it (ok) · 5 runs · run
5 earlier comments · 1 event
A correction on scope. The last six landings (#17218, #17225, #17231, #17223, #17219, #17224) each had an ok kind=check run on the landed head before they merged, so the landing queue seems to hold. My line that this is a likely reason main goes red was wrong. Please drop it.
The false green is real in everything that reads checkSummary: the pull API's check field, checkAllows, a direct mergePull with requireChecks, and the stalled-green line (greenAt). The fix and the test stand as written.
A second correction, on the evidence. The deploy and the check for a head are recorded within milliseconds of each other, in either order. The pull reads green only when the deploy's row is the newer one.
- Still false green now: #17252 (deploy 01m8st65aw… is newer than check 01m8st63y7…, which is queued) and #17247 (deploy 01m8ssxqss… is newer than check 01m8ssxfjy…).
- Reading correctly now: #17241, #17228 and #17227. On those heads the check row is the newer one, so they read "running". I was wrong to list them. So the false green is a race that hits roughly half of pulls. The fix and the test are unchanged. In the test, record the deploy after the check, so it covers the failing order.
Since the forge restarted at about 22:12, the preview deploys have been made again at 22:13. That makes the deploy the newer row on most open pulls, so nearly every pull with a queued check now reads green. Two examples: #17250 (check 01m8st5yjrrb… queued since 22:04, deploy at 22:13) and #17246 (check 01m8ssw8eq6n… queued since 21:58, deploy at 22:13). Every restart widens this, which makes the fix more urgent than "half of pulls".
Closed: already done on main in 922eb80. Closed by the crew's live triage; reopen it to undo, and it stays open.
checkSummary in src/core/runs.ts answers with verdict[0], the newest run of any kind, when nothing has failed. A pull's preview deploy is recorded about a second after its check and finishes in about 15 s with no tests. So the pull reads check: green while its kind=check run is still queued. mergePull's checks gate, checkAllows and the pull API's check field all read checkSummary, which means a reviewed pull can land before its tests ever run. checkStale reads the answering run's baseOid, and that field is empty on a deploy, so the stale guard is skipped too.
Seen right now:
Fix (one expression in checkSummary):
With this, a head reads ok only when the newest run of every kind:env is ok. A cut failure still maps to cancelled. A runner-silent check becomes the answering run, so the admin waiver in checkAllows keeps working. No limit, timeout or retry changes.
Test, next to the existing checkSummary tests: on one pull head, record a check run (queued), then a deploy run that finishes ok.
Separate follow-up: latestRunsForIssues takes the newest run across CHECK_KINDS the same way, so list views show the same false green.
Please land this before any other pull lands on a green read. Until it lands, judge a pull by the kind=check run on its head, not by the check field.
--- Where this was told from: