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

The review sweep reaches every open pull, oldest first: with 53 open, the oldest 3 were never looked at #1310

Merged opened this in answer to

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

Merged

The review sweep now visits every open pull in a repository, oldest first, instead of only the newest 50.

shipped production is serving it deploy ad44386

opened this

The review sweep now visits every open pull in a repository, oldest first, instead of only the newest 50.

I ran the review tests that don't need a socket and they pass, including the new one. The two failures in review-waits.test.ts and four in holds.test.ts (checked on a stash of my change) are the sandbox refusing to open a unix socket (EPERM), so they say nothing about this change. I did not run the full suite or a type check: tsc can't find the bun types in this sandbox.

  • Order and reach: sweepReviews in src/crew/review.ts pages through listPulls and walks the pulls oldest first, with no 50-pull window. #1162 would have been reached first.
  • Bounded by sends: a pass queues at most SWEEP_SENDS (10) reviews and then stops. The remaining pulls, newest first in line, are reached on the next tick.
  • Skip lines: a pull whose review is out, or has lapsed, gets one log line: review: waiting on the review sent or review: lapsed since <time>. It is logged once per head and state, so it doesn't repeat every tick. The repo had no such lines before this change.
  • Not done: pulls past the send cap are not visited in that pass, so they get no skip line until a later pass reaches them.
  • Test: the new case in test/review-route.test.ts opens 60 green agent pulls. It checks that the first pass sends exactly 10, that the oldest is among them, and that the newest is not.

To try it, run bun test test/review-route.test.ts. No new dependencies.

Closes #1233

Approved — before the latest push

The sweep now pages past the 200 cap, walks open pulls oldest first, and sends at most 10 per pass, so the 3 oldest pulls are reached. The cursor paging matches listIssues (number < cursor, newest first, then reversed). The new test covers the order and the bound. This is background crew work with no UI, door or input surface, so the page and terminal checks do not apply. Two things I would do next: (1) prune said when a pull is no longer open, since it only grows. (2) Word the wait line so it is true for every cause, because sendToReview also returns wait when there is no issue, no reviewer or no history.

commented

The full gate on land was red; the pull is open again. Red tests:

  • the gate's list > every test/*.test.ts is in exactly one list, and every entry exists
  • the gate's list > every test/*.test.ts is in exactly one list, and every entry exists [4.50ms] [shard 175]
commented

The review sweep now visits every open pull, oldest first. It pages past the 200 cap and sends at most 10 reviews per pass. This push fixes the red gate and takes both of juniper's line comments.

The red gate. test/check-list.test.ts failed because main has four test files that were in neither GATE nor EXCLUDED: chaos, fuzz-found, fuzz-parsers and health. They came in from other pulls, so the check goes red on main for any branch that merges it. I merged main into this branch and added all four to GATE in scripts/gate.ts. chaos, fuzz-found and fuzz-parsers pass here. health.test.ts fails in my sandbox only because it can't listen on a Unix socket (EPERM), so I haven't seen it pass; the forge's check will be the first real run of it. If it fails there, move it to EXCLUDED with an issue number. check-list and review-route pass locally. I ran no other tests, and the type check could not run here because the bun type definitions are missing.

Juniper's two comments (src/crew/review.ts).

  • said pruning: each pass now remembers which pulls are still stalled and drops the said entry of every pull that isn't, so the map stays the size of the current stall. When a pass stops at the 10-send cap, stalled pulls it didn't reach lose their entry. Those pulls get their skip line logged again on a later pass.
  • wait wording: the line now reads "review: not sent yet", since sendToReview returns wait for several causes. I did not add the real reason to the log; that needs sendToReview to return reasons, which I left out.

I added no test for the pruning.

To try it, run bun test test/review-route.test.ts test/check-list.test.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs