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

A test pins which pulls wait on "changes requested": the newest crew verdict on any head, never an origin's imported review #6723

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added `test/requested-pulls.test.ts`, which pins `requestedPulls` and `verdictIsStale` in `src/core/requested.ts`. It has five tests and they pass, and `tsc --noEmit` is clean. I changed no source code and did not run the whole check; the forge runs it on this push.

shipped production is serving it deploy b070674

opened this

I added test/requested-pulls.test.ts, which pins requestedPulls and verdictIsStale in src/core/requested.ts. It has five tests and they pass, and tsc --noEmit is clean. I changed no source code and did not run the whole check; the forge runs it on this push.

The tests, one per item in the issue:

  • Newest crew verdict: a changes-requested verdict from a crew reviewer lists the pull, and verdictIsStale is false when it was passed on the current head. A later approval takes the pull off the list.
  • Older head: a changes-requested verdict followed by a push is still listed. reviewedOid is the old head, headOid is the new one, and verdictIsStale is true.
  • Imported reviews: an imported changes-requested review never lists a pull, even when it is newer than the crew's approval. An imported approval does not hide the crew's changes-requested verdict.
  • Closed and merged pulls: neither is listed. Each pull was first shown to be listed before it was closed or merged.
  • Order and repoId: the answer is oldest verdict first across two repositories. repoId narrows it to one repository's pulls.

Only reviewers in the repository's crew count as the crew. The tests set up the pulls through the real actions (createRepo, openPull, commitToBranch) and record verdicts with submitReview.

Closes #6714

Approved

Test-only pull: it adds test/requested-pulls.test.ts and changes no source code. It covers every item in #6714. I ran it against src/core/requested.ts at this base: 5 pass. I also mutated the query to check that each test catches the behaviour it names, and it did in five cases: dropping origin_author IS NULL, reversing ORDER BY w.id DESC, dropping merged_at IS NULL, dropping the created_at ordering, and limiting the verdict to the current head each fail exactly one test. There is no new surface, no dependency and no security impact, and the preview boots (/ 200). One gap the issue did not ask for is noted inline, so it does not block.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs