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

Old reviewed-pull posts say the verdict too #16928

Merged opened this

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

Merged

Old pull.reviewed events that carry a state but no reviewId now find their review and read like new ones, for example asked for changes on : or approved . A new test builds that case. It submits a review, strips reviewId from its event, and expects the feed to say the verdict and first sentence.

Notes

opened this

Old pull.reviewed events that carry a state but no reviewId now find their review and read like new ones, for example asked for changes on <title>: <first sentence> or approved <title>.

A new test builds that case. It submits a review, strips reviewId from its event, and expects the feed to say the verdict and first sentence. The feed tests I ran pass (feed-reviewed, feed-fold, feed-review-rank) and tsc is clean. The dead-code suite also ran: 2 skipped, 0 failed. The gate passes. I did not run the full suite, which the forge's check runs on push.

  • Match rule: oldReview in src/feed/items.ts looks among the pull's reviews for the same author as the event's actor and the same state, then takes the one nearest in time to the event.
  • Fallback: when nothing matches, or the state is missing or unknown, the post keeps reviewed a pull request: <title>.
  • Reused, no new dependency: listReviews and isReviewState from src/core/reviews.ts, and the existing reviewedPost from #5823.
  • Left out: I did not backfill reviewId into stored events. The match is done at read time, so nothing is migrated.
  • No door: this only changes the words of a feed post. No page, action, route or tool changed, so there is no src/tui/ or docs/features/ change.

Try it: open /feed on the preview and read an old reviewed-pull post for its verdict.

🤖 Generated with Claude Code

Closes #5853

commented

Old pull.reviewed events that carry a state but no reviewId now find their review and read like new ones, for example asked for changes on <title>: <first sentence> or approved <title>.

A new test builds that case. It submits a review, strips reviewId from its event, and expects the feed to say the verdict and first sentence. The feed tests I ran pass (feed-reviewed, feed-fold, feed-review-rank) and tsc is clean. The dead-code suite also ran: 2 skipped, 0 failed. The gate passes. I did not run the full suite, which the forge's check runs on push.

  • Match rule: oldReview in src/feed/items.ts looks among the pull's reviews for the same author as the event's actor and the same state, then takes the one nearest in time to the event.
  • Fallback: when nothing matches, or the state is missing or unknown, the post keeps reviewed a pull request: <title>.
  • Reused, no new dependency: listReviews and isReviewState from src/core/reviews.ts, and the existing reviewedPost from #5823.
  • Left out: I did not backfill reviewId into stored events. The match is done at read time, so nothing is migrated.
  • No door: this only changes the words of a feed post. No page, action, route or tool changed, so there is no src/tui/ or docs/features/ change.

Try it: open /feed on the preview and read an old reviewed-pull post for its verdict.

🤖 Generated with Claude Code

commented

Old pull.reviewed events that have a state but no reviewId now find their review by same pull, same author, same state and nearest in time. Both of juniper's points are addressed. tsc is clean and test/feed-reviewed.test.ts passes (6 tests). The gate is clean and the push went through. I did not run the full suite; the forge's check does that.

  • Batched lookup: the feed build now reads the reviews of every pull named by an old reviewed event in one listReviewsFor call, and oldReview reads from that result. A feed with many old events no longer makes one query per event.
  • Nearest in time: two same-author, same-state reviews on one pull, with the event nearest the second. The post reads "Second take.", not "First take.", so it fails if the pick isn't nearest-in-time.
  • No match: a review by another author, and a review in another state, each leave the post as reviewed a pull request: <title>.
  • Approved: an old event with state approved reads approved <title>.

The preview's /feed shows no reviewed-pull posts, so the tests are the only proof the change works.

Test setup: the feed shows only the newest event for a pull. So the nearest-in-time test moves the pull's opened event and both reviews to recent, distinct times, and strips reviewId from both review events.

No door change is needed, since only the words of a feed post change.

Try it: open /feed on the preview and read an old reviewed-pull post for its verdict.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs