Public: anyone can read this; the crew can change it.

The pulls list says green while a pull's tests are still running #17265

opened this in answer to

Merged 35h 4m ago, live in production

The pulls list now gives each pull the same check word its own page gives it. A queued or running check under a quick preview deploy reads running, a failed check under a later ok deploy reads red, and green appears only once every kind at the head is ok. The new test, the type check and 609 related tests pass.

Notes

opened this

The pulls list now gives each pull the same check word its own page gives it. A queued or running check under a quick preview deploy reads running, a failed check under a later ok deploy reads red, and green appears only once every kind at the head is ok. The new test, the type check and 609 related tests pass. The rest of the suite was too broad to run here, so the forge's check runs it on the push.

  • List route: src/http/api/pulls.ts now reads checkSummaries, a batched form of checkSummary built on checksForHeads. The check word comes from that summary's run.
  • #17258 hadn't landed: main's checkSummary still let a finished deploy speak for a queued check. So summaryOf in src/core/runs.ts carries its rule: a failed run that wasn't cut short, then any run not yet ok, then the newest. Once #17258 lands, the two may conflict in checkSummary.
  • Shared helper: newestOfEachKind is exported from runs.ts. src/flow/read.ts now uses it in place of its own newestPerKind, which the gate flagged as a near-duplicate.
  • Test: test/pull-list-check-under-deploy.test.ts is the one from the issue, unchanged. It reads running, then red, then green.
  • Not done: I kept latestRunsForIssues, since fleet, the studio pages and stale asks still call it. I didn't move those callers; the issue says only a studio list showing a pass/fail mark has the same gap, and I didn't check which of them that is.
  • No door: the API field's shape is unchanged, so there's no terminal or docs/features edit. One commit says so.
  • Gate: it reports one comment line over 100 columns in src/core/runs.ts. It says the nightly rewrap handles it, and --fix made no change.

Try: GET /api/v1/repos/<owner>/<repo>/pulls?fields=number,check on the preview. A pull whose test check is still queued or running reads running, even with a finished preview deploy newer than the check.

🤖 Generated with Claude Code

Closes #17262

3 earlier comments
commented

The pulls list now gives each pull the same check word its own page gives it. A queued or running check under a quick preview deploy reads running, a failed check under a later ok deploy reads red, and green appears only once every kind at the head is ok. The new test, the type check and 609 related tests pass. The rest of the suite was too broad to run here, so the forge's check runs it on the push.

  • List route: src/http/api/pulls.ts now reads checkSummaries, a batched form of checkSummary built on checksForHeads. The check word comes from that summary's run.
  • #17258 hadn't landed: main's checkSummary still let a finished deploy speak for a queued check. So summaryOf in src/core/runs.ts carries its rule: a failed run that wasn't cut short, then any run not yet ok, then the newest. Once #17258 lands, the two may conflict in checkSummary.
  • Shared helper: newestOfEachKind is exported from runs.ts. src/flow/read.ts now uses it in place of its own newestPerKind, which the gate flagged as a near-duplicate.
  • Test: test/pull-list-check-under-deploy.test.ts is the one from the issue, unchanged. It reads running, then red, then green.
  • Not done: I kept latestRunsForIssues, since fleet, the studio pages and stale asks still call it. I didn't move those callers; the issue says only a studio list showing a pass/fail mark has the same gap, and I didn't check which of them that is.
  • No door: the API field's shape is unchanged, so there's no terminal or docs/features edit. One commit says so.
  • Gate: it reports one comment line over 100 columns in src/core/runs.ts. It says the nightly rewrap handles it, and --fix made no change.

Try: GET /api/v1/repos/<owner>/<repo>/pulls?fields=number,check on the preview. A pull whose test check is still queued or running reads running, even with a finished preview deploy newer than the check.

🤖 Generated with Claude Code

commented

Review: the list fix matches #17262. Two points.

  1. Order with #17258. #17258 puts the same rule (uncut failed, then any run not ok, then the newest) inline in checkSummary, and its check is running now. Land #17258 first. Then rebase this pull so summaryOf is the only copy of the rule and checkSummary just calls it. Keep test/check-summary-queued-under-deploy.test.ts green after the rebase.
  2. Cut checks. The page's word comes from summary.state, which turns a cut failed check into cancelled. The list hands summary.run to checkWord, which reads the run's own failed. Add a cut check to the test, e.g. finishRun(..., { state: "failed", summary: "interrupted: restart, resumes on the next pass" }), and check that the list reads the same as the page. If it reads red, pass the summary's state to checkWord.
commented

I merged main into the branch and pushed it (a19d06869). src/core/runs.ts was the only file that conflicted.

  • The conflict: main added a comment from #17256 inside checkSummary. This branch had moved that same logic into a shared summaryOf so the pulls list and the pull's own verdict read a head the same way. I kept the summaryOf version and carried over main's #17256 note: a head reads ok only when the newest run of every kind is ok, so a quick preview deploy can't cover a check that is still queued or running.
  • Checks run:
    • bun x tsc --noEmit was clean.
    • I ran the check-summary-* tests plus the tests changed on this branch: 126 passed, 6 skipped, 1 failed.
    • The failure is "the stream of hosted forges > the service streams on its own timer and on request, never beside a snapshot". It logged "hosted forge left out of the snapshot … copy refused". I read that as the sandbox's copy restriction rather than this merge, but I didn't confirm it by running the test on main.
  • Not run: the full suite. scripts/fast.ts named 3572 of 4688 files (about 300 minutes), so I picked tests myself. The forge's own check will run the whole suite on this push.
  • Gate: bun scripts/gate.ts --fix changed nothing. It notes that src/core/runs.ts and src/flow/read.ts have comment lines over 100 columns, which the nightly rewrap fixes on main.
commented

The pulls list now builds its check word from the summary's state, so a cut check reads none on the list, as it reads cancelled on the pull's page. I pushed this as 9b1e911f1.

  • Fix: in src/http/api/pulls.ts, checkWord now gets the summary's state instead of the run's own failed. cancelled and none both come out as none.
  • Test: test/pull-list-check-under-deploy.test.ts has a new case. It finishes a check as failed with a cut summary, asserts checkSummary says cancelled, and asserts the list says none. Both tests in that file pass and tsc is clean.
  • Where I disagreed with the review: the suggested summary "interrupted: restart, resumes on the next pass" is not one isCut recognises. With it the check stays failed and the list correctly says red. I used "interrupted by a restart; queued again", which does match.
  • Doors: no terminal or docs change, since the API field's shape is the same.
  • Not run: I ran only this test file, the earlier check-summary-* tests and tsc. I did not run the full suite or the "dead code: every export under src/ has a caller" test, and the forge's check will run both.
  • Gate: gate.ts --fix changed nothing. It still notes over-long comment lines in src/core/runs.ts and src/flow/read.ts, which the nightly rewrap handles.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs