Always post fresh review, supersede old with link #34

Closed
opened 2026-05-02 17:32:31 +00:00 by rodin · 0 comments
Owner

Problem

The current edit-in-place behavior leaves reviews ambiguous: when reviewUnchanged() skips the update, the review shows a stale badge with no indication whether it was re-evaluated against the current commit. You can't tell at a glance if the review is current.

Even when findings change and the body is PATCHed, Gitea still shows the stale badge because the review object was created on an older commit.

Proposal

Replace edit-in-place with post-new + supersede-old:

  1. Bot reviews new commit → always posts a fresh review (new review object on current commit)
  2. PATCH the old review body to mark it superseded:
~~Original review~~

**Superseded by [Review #N](link)** — see current review for up-to-date findings.

<details><summary>Previous findings (commit abc1234)</summary>

[original body preserved here]

</details>
  1. New inline comments attach to the new review (correct line numbers for current diff)
  2. Old inline comments + threads remain on the old review (readable as historical context)

Benefits

  • No stale badge — fresh review is on current commit, Gitea shows it as non-stale
  • Old threads preserved — reply conversations stay navigable, just clearly marked historical
  • Clear at a glance — current review is obvious, superseded ones are struck-through
  • Inline comments on correct lines — new review's comments reference current diff positions
  • Commit footer — each review shows which commit it evaluated

Behavior changes

  • Remove reviewUnchanged() skip logic — always post
  • Remove edit-in-place PATCH-body-with-same-content path
  • Add: after posting new review, find own previous review(s) and PATCH them to superseded state
  • Add: commit SHA + timestamp footer on every posted review
  • The <details> block preserves original findings for historical reference

Edge cases

  • First review on a PR: No supersession, just post normally with footer
  • Multiple prior reviews (rapid pushes): Only the most recent non-superseded review gets the supersede treatment. Already-superseded ones stay as-is.
  • Shared token mode: Same behavior — hasSharedToken() only affects update-in-place logic which is being removed.

Acceptance criteria

  • Every bot run posts a new review (no skip on unchanged)
  • Previous own review is PATCHed with superseded banner + collapsed original body
  • New review has commit footer: Evaluated against <sha> · <timestamp>
  • Inline comments land on current commit's line numbers
  • Old inline comment threads remain readable
  • CI passes, existing tests updated
## Problem The current edit-in-place behavior leaves reviews ambiguous: when `reviewUnchanged()` skips the update, the review shows a stale badge with no indication whether it was re-evaluated against the current commit. You can't tell at a glance if the review is current. Even when findings change and the body is PATCHed, Gitea still shows the stale badge because the review object was created on an older commit. ## Proposal Replace edit-in-place with **post-new + supersede-old**: 1. Bot reviews new commit → always posts a **fresh review** (new review object on current commit) 2. PATCH the old review body to mark it superseded: ```markdown ~~Original review~~ **Superseded by [Review #N](link)** — see current review for up-to-date findings. <details><summary>Previous findings (commit abc1234)</summary> [original body preserved here] </details> ``` 3. New inline comments attach to the new review (correct line numbers for current diff) 4. Old inline comments + threads remain on the old review (readable as historical context) ## Benefits - **No stale badge** — fresh review is on current commit, Gitea shows it as non-stale - **Old threads preserved** — reply conversations stay navigable, just clearly marked historical - **Clear at a glance** — current review is obvious, superseded ones are struck-through - **Inline comments on correct lines** — new review's comments reference current diff positions - **Commit footer** — each review shows which commit it evaluated ## Behavior changes - Remove `reviewUnchanged()` skip logic — always post - Remove edit-in-place PATCH-body-with-same-content path - Add: after posting new review, find own previous review(s) and PATCH them to superseded state - Add: commit SHA + timestamp footer on every posted review - The `<details>` block preserves original findings for historical reference ## Edge cases - **First review on a PR:** No supersession, just post normally with footer - **Multiple prior reviews (rapid pushes):** Only the most recent non-superseded review gets the supersede treatment. Already-superseded ones stay as-is. - **Shared token mode:** Same behavior — `hasSharedToken()` only affects update-in-place logic which is being removed. ## Acceptance criteria - [ ] Every bot run posts a new review (no skip on unchanged) - [ ] Previous own review is PATCHed with superseded banner + collapsed original body - [ ] New review has commit footer: `Evaluated against <sha> · <timestamp>` - [ ] Inline comments land on current commit's line numbers - [ ] Old inline comment threads remain readable - [ ] CI passes, existing tests updated
rodin closed this issue 2026-05-02 18:36:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#34