Deduplicate chat mentions handled by webhook and poller #50
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/auto_review#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A single top-level PR comment containing
@auto_review re-reviewcan queue two reviews.Observed on PR #48: commenting
@auto_review re-reviewcaused both theissue_commentwebhook path and the background chat poller to process the same top-level PR comment. Becausere-reviewqueues withforce=true, orchestrator same-SHA review-history dedup did not suppress the duplicate jobs.Likely cause
The poller was intended as a fallback for inline review-thread mentions because Forgejo does not reliably fire
pull_request_review_commentwebhooks. However, it currently lists PR conversation comments viarepos/{owner}/{repo}/issues/{n}/comments, which overlaps with theissue_commentwebhook path for top-level PR comments.Current overlap:
ar-gateway::webhook::handle_issue_commenthandles freshly-created top-level PR comments.ar-gateway::poller::ChatPolleralso scans known PR comments for new@<bot_name>mentions.Desired behavior
Each user-authored chat mention should be processed at most once, regardless of whether it is seen through a webhook, the poller, or both.
Acceptance criteria
@auto_review re-reviewthat is seen by both paths but dispatches only one review job.(owner, repo, pr_number, comment_id), or otherwise advance/share the poller cursor when webhook comments are handled.force=truere-review jobs must not bypass chat-command dedup for the same comment.Notes
Disabling the poller via
AR_POLL_INTERVAL_SECS=0avoids duplicate top-level comment handling but loses inline-thread mention fallback, so it is only a workaround.