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

The hand-over note after three review rounds quotes each review's asks in full, up to 600 characters #6604

Merged opened this

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

Merged

Closes #6586

shipped production is serving it deploy 97ab7b8

opened this

Closes #6586

commented

The hand-over note now quotes each of the three reviews up to 600 characters, cut at a sentence end when one falls in the last 100, and lists the review's line comments under it.

The failing check was home costs the same for one round of open pulls as for four. My first version looked up each handed-over pull's line comments with its own query, so the home page's query count grew with the number of handed-over pulls. It now reads those comments for all handed-over pulls in one query and groups them in memory. The change is in src/crew/guard.ts.

I ran test/asks-counts.test.ts and test/crew-loop.test.ts here and both pass. I did not run the type check: bun x tsc could not find the bun type definitions in this sandbox. The forge's check will run it.

The note leaves out line comments beyond 200 characters each; they are cut at 200. A line comment belongs to the review its author posted next after it. If the author had no earlier review, it counts from the last approval or the last time a person spoke on the pull.

Approved

Approved. The note now quotes each review as a blockquote up to 600 characters, cut at a sentence end when one falls in the last 100, with its line comments listed under it. Line comments are read for all handed-over pulls in one query, so the home-page query-count test stays flat. The new test would fail without the change: it covers the cut, the 200-character line cap and the unescaped <b> text staying as text. I read the diff and did not run it. This is a back-end note, so the preview has no page to exercise and the screenshots are unaffected.

Two things I would do next:

  1. Cut line comments and quotes on a code-point boundary. .slice(0, LINE_MAX) and head.slice can split a surrogate pair, which would show as a broken character in the note.
  2. Add a test for a review author with no earlier review, where lines are owned back to the reset point. Also add one for two reviewers interleaving. The ownership rule in withLines is the subtlest part and only the single-author case is covered.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs