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

A changes-requested review with only a body is invisible: the pull's API, its reviews list and a repeat review request all say nothing #18184

opened this in answer to

Merged 12h 28m ago, live in production

A body-only changes-requested review now shows in the pull's answer, in the reviews list and in the 409 of a repeat ask. The Next line names the author. The new test for #18181 passes, as do the gate, tsc, bun test test/mcp-size.test.ts and the tests that cover the change.

Notes

opened this

A body-only changes-requested review now shows in the pull's answer, in the reviews list and in the 409 of a repeat ask. The Next line names the author. The new test for #18181 passes, as do the gate, tsc, bun test test/mcp-size.test.ts and the tests that cover the change. I did not run the whole suite or the sandbox-skipped suites; the forge's check does that. scripts/fast.ts named about 3,100 files, so I ran the specific ones instead.

What changed

  • Pull answer: GET …/pulls/:n carries latestReview and changesRequested, each {id, state, reviewer, at, body, commit, current}. latestReview is the newest review of any state. changesRequested is the review asking for changes on the current head, or null. The shaping is in the new src/core/review_list.ts.
  • Reviews list: GET …/pulls/:n/reviews now lists reviews (state, body) with their line comments under each. Line comments store no review id, so each goes under the same author's review on the same commit nearest in time. Comments that match no review come as one entry per author with id: null.
  • Repeat ask: a head with a changes-requested review answers 409 already_reviewed. The message gives the reviewer, the time (UTC), the first lines of the body and "Push a change, then ask again." The review object is in the body. The MCP tool, the terminal K prompt and the web ask-review form say the same words.
  • MCP: request_review now acts by default, and dryRun: true only plans. A read-only token may still plan.
  • Next line: "waits on its author: changes requested", with the reviewer after a colon. The pull pane is adjusted to match.
  • Contract and docs: the OpenAPI schemas and docs/features/review-requests.md are updated.

Things to look at

  • Breaking change to the reviews list: the route used to return line comments. Four existing tests read it that way, so I changed them to flatten comments (parity, reviews-states, api-reader-marks, next_actor/pull-pane for the Next wording). Any outside client that read the old shape will need the same change.
  • Reused: listReviews and reviewsOnHead from core/reviews.ts. changesBrief overlaps blockingReviewWords; I did not merge them.
  • Gate: the only notes left are the three similarity notes on review_list.ts.
  • Commit lines: the commit carries a No door: line, because the existing screen and how-to already carry these words, and a No look: line.

Not done

  • No migration to tie line comments to a review by id. The grouping above is a heuristic.
  • No change to landing.ts's "changes were asked on this head" cause text.

Try it: file a changes_requested review with only a body on an open pull, then:

  1. GET /api/v1/repos/:owner/:name/pulls/:n?diff=0 and read latestReview and changesRequested.
  2. GET …/pulls/:n/reviews and find the review.
  3. POST …/pulls/:n/review-requests and expect the 409.

The test is the last one in test/review-request.test.ts.

🤖 Generated with Claude Code

Closes #18181

2 earlier comments
commented

A body-only changes-requested review now shows in the pull's answer, in the reviews list and in the 409 of a repeat ask. The Next line names the author. The new test for #18181 passes, as do the gate, tsc, bun test test/mcp-size.test.ts and the tests that cover the change. I did not run the whole suite or the sandbox-skipped suites; the forge's check does that. scripts/fast.ts named about 3,100 files, so I ran the specific ones instead.

What changed

  • Pull answer: GET …/pulls/:n carries latestReview and changesRequested, each {id, state, reviewer, at, body, commit, current}. latestReview is the newest review of any state. changesRequested is the review asking for changes on the current head, or null. The shaping is in the new src/core/review_list.ts.
  • Reviews list: GET …/pulls/:n/reviews now lists reviews (state, body) with their line comments under each. Line comments store no review id, so each goes under the same author's review on the same commit nearest in time. Comments that match no review come as one entry per author with id: null.
  • Repeat ask: a head with a changes-requested review answers 409 already_reviewed. The message gives the reviewer, the time (UTC), the first lines of the body and "Push a change, then ask again." The review object is in the body. The MCP tool, the terminal K prompt and the web ask-review form say the same words.
  • MCP: request_review now acts by default, and dryRun: true only plans. A read-only token may still plan.
  • Next line: "waits on its author: changes requested", with the reviewer after a colon. The pull pane is adjusted to match.
  • Contract and docs: the OpenAPI schemas and docs/features/review-requests.md are updated.

Things to look at

  • Breaking change to the reviews list: the route used to return line comments. Four existing tests read it that way, so I changed them to flatten comments (parity, reviews-states, api-reader-marks, next_actor/pull-pane for the Next wording). Any outside client that read the old shape will need the same change.
  • Reused: listReviews and reviewsOnHead from core/reviews.ts. changesBrief overlaps blockingReviewWords; I did not merge them.
  • Gate: the only notes left are the three similarity notes on review_list.ts.
  • Commit lines: the commit carries a No door: line, because the existing screen and how-to already carry these words, and a No look: line.

Not done

  • No migration to tie line comments to a review by id. The grouping above is a heuristic.
  • No change to landing.ts's "changes were asked on this head" cause text.

Try it: file a changes_requested review with only a body on an open pull, then:

  1. GET /api/v1/repos/:owner/:name/pulls/:n?diff=0 and read latestReview and changesRequested.
  2. GET …/pulls/:n/reviews and find the review.
  3. POST …/pulls/:n/review-requests and expect the 409.

The test is the last one in test/review-request.test.ts.

🤖 Generated with Claude Code

commented

This round addresses all three of sentinel's points and the doc request. tsc is clean and test/pull-waits-for.test.ts passes (9 tests). gate --fix wrote nothing; it only noted two files with long comment lines and three similar-function pairs in src/core/review_list.ts. I did not run the wider suite; the forge's check runs it on this push.

  • Null on the web ask-review form: reviewedAlready(...) is no longer asserted non-null in src/web/studio/actions.ts. If the review is gone by the time of the lookup, the form says "Changes were already requested on this head. Push a change, then ask again." The nested ternary is re-indented.
  • One wording: CHANGES is now exported from src/flow/next_actor.ts.
    • landing.ts: src/core/landing.ts uses it, so the green-not-landed line reads "Green for N hours, not landed: waits on its author: changes requested. …". test/pull-waits-for.test.ts expects that new text.
    • flow-waiting.md: docs/features/flow-waiting.md now quotes the Next line's wording.
  • Pane strip: src/flow/pull_pane.ts builds the strip from CHANGES instead of a regex copy.
  • /reviews shape: docs/features/review-requests.md now says the shape changed from a flat comment list to reviews with nested comments. It also says line comments are grouped under a review by author, commit and nearest time, which is a heuristic and not a link.

One thing to look at: src/core/landing.ts now imports from src/flow/. That is the layering sentinel's suggestion produces, and I did not move the constant into core.

The commit carries Direction: … (#18181) and No door: …, since this is wording and null handling only and the terminal already shares alreadyReviewedWords. No new exports or module-level state.

commented

A changes-requested review with only a body now shows in the pull, the reviews list and a repeat ask. The failing check came from an import cycle my earlier commits added, and that cycle is now removed.

Cause of the failures. src/core/landing.ts imported the CHANGES wording from src/flow/next_actor.ts. That set up a cycle that left PILLAR_DAYS uninitialised when src/core/watches.ts loaded. The pages worker threw on startup, so the picture-keep and flow-pages tests timed out. The survival-set test is in test/game-mods.test.ts, which the check also re-ran on main, but I did not run it against the cycle.

Fix. CHANGES now lives in a new leaf module, src/core/changes_words.ts. landing.ts and next_actor.ts both read it from there, and next_actor.ts still re-exports it, so existing imports keep working.

Verification.

  • The worker now loads when started directly.
  • bun x tsc --noEmit is clean.
  • test/picture-keep.test.ts, test/flow-pages.test.ts, test/game-mods.test.ts, test/next_actor.test.ts, test/review-request.test.ts and test/reviews-states.test.ts all pass (101 tests).
  • I did not run the rest of the suite; the forge's check does that on this push.

Gate. bun scripts/gate.ts --fix reported two over-long comment lines, which it wraps, and three similarity notes on src/core/review_list.ts. I changed nothing for the notes and did not read the --fix output closely.

Not done. No tests were changed.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs