Suppress duplicate review comments across successive reviews on the same PR #8

Open
opened 2026-05-01 13:58:36 -07:00 by auto-review · 0 comments
Collaborator

Reviews 709, 710, 711 each restated the same observations on the same files. On a long-running PR with frequent force-pushes, the same advice multiplies on every push.

Desired behaviour: before posting a new line-attached comment, list the bot's prior comments on the PR. For each prospective comment matching (path, position, body-similarity) of a prior one:

  • If the prior comment is unresolved → skip the new one (the original is still standing).
  • If the prior was resolved by the PR author → allow the new one to post — that signals the author thought the concern was addressed but the bot still sees it (regression / unaddressed).

Forgejo exposes resolution state on review comments via the resolver field on each comment object — non-null = resolved.

Implementation: a pre-post filter in the orchestrator that fetches /repos/{o}/{r}/pulls/{n}/reviews/*/comments once per dispatch, builds a fingerprint set keyed by (path, position, normalized_body), and drops collisions whose prior is unresolved.

Risks: body-similarity is fuzzy; a strict equality check is safer initially even if it lets through near-duplicates with reworded prose. We can tighten later.

Reviews 709, 710, 711 each restated the same observations on the same files. On a long-running PR with frequent force-pushes, the same advice multiplies on every push. **Desired behaviour:** before posting a new line-attached comment, list the bot's prior comments on the PR. For each prospective comment matching `(path, position, body-similarity)` of a prior one: - If the prior comment is **unresolved** → skip the new one (the original is still standing). - If the prior was **resolved by the PR author** → allow the new one to post — that signals the author thought the concern was addressed but the bot still sees it (regression / unaddressed). Forgejo exposes resolution state on review comments via the `resolver` field on each comment object — non-null = resolved. Implementation: a pre-post filter in the orchestrator that fetches `/repos/{o}/{r}/pulls/{n}/reviews/*/comments` once per dispatch, builds a fingerprint set keyed by `(path, position, normalized_body)`, and drops collisions whose prior is unresolved. Risks: body-similarity is fuzzy; a strict equality check is safer initially even if it lets through near-duplicates with reworded prose. We can tighten later.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jwilger/auto_review#8
No description provided.