Update existing review instead of always posting a new one #6

Closed
opened 2026-05-01 18:26:22 +00:00 by rodin · 0 comments
Owner

Problem

Every push triggers a new review, which creates a growing stack of review comments on the PR. On active PRs with many iterations, this clutters the conversation and makes it hard to find the current review state.

Proposed Solution

When posting a review, check if the same reviewer bot already has an existing review on the PR. If so, either:

  1. Dismiss the old review and post a new one (keeps history but marks old as stale)
  2. Edit the existing review body in-place (cleaner, single source of truth)

Implementation Ideas

  • Before posting, call GET /repos/{owner}/{repo}/pulls/{pr}/reviews and filter by the current reviewer username
  • If a previous review exists from the same bot:
    • Option A: Use POST /repos/{owner}/{repo}/pulls/{pr}/reviews/{id}/dismissals on the old one, then post new
    • Option B: Use PATCH /repos/{owner}/{repo}/pulls/{pr}/reviews/{id} to update the body (if Gitea supports it)
  • Add a --update-existing flag (default: true) so users can opt into the old behavior with --update-existing=false

Benefits

  • Cleaner PR threads
  • Single authoritative review per bot at any time
  • Easier to see current review state at a glance
  • Reduces notification spam for PR participants
## Problem Every push triggers a new review, which creates a growing stack of review comments on the PR. On active PRs with many iterations, this clutters the conversation and makes it hard to find the current review state. ## Proposed Solution When posting a review, check if the same reviewer bot already has an existing review on the PR. If so, either: 1. **Dismiss the old review and post a new one** (keeps history but marks old as stale) 2. **Edit the existing review body in-place** (cleaner, single source of truth) ## Implementation Ideas - Before posting, call `GET /repos/{owner}/{repo}/pulls/{pr}/reviews` and filter by the current reviewer username - If a previous review exists from the same bot: - Option A: Use `POST /repos/{owner}/{repo}/pulls/{pr}/reviews/{id}/dismissals` on the old one, then post new - Option B: Use `PATCH /repos/{owner}/{repo}/pulls/{pr}/reviews/{id}` to update the body (if Gitea supports it) - Add a `--update-existing` flag (default: true) so users can opt into the old behavior with `--update-existing=false` ## Benefits - Cleaner PR threads - Single authoritative review per bot at any time - Easier to see current review state at a glance - Reduces notification spam for PR participants
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#6