fix(gateway): deduplicate chat mentions #62
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/auto_review!62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/deduplicate-chat-mentions-50"
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?
Summary
Verification
nix develop --command cargo nextest run -p ar-gatewaynix develop --command cargo clippy -p ar-gateway --all-targets -- -D warningsnix develop --command cargo fmt --all -- --checkrtk git diff --checkThis PR addresses issue #50 by implementing deduplication of chat mentions between the webhook and poller paths. The changes introduce shared comment cursors to manage state and prevent duplicate forced re-review jobs. The implementation appears sound, with appropriate tests added for regression coverage.
Walkthrough
CHANGELOG.md:
crates/ar-gateway/src/lib.rs:
SharedCommentCursorsto manage comment cursors.with_chat_comment_cursorsmethod toAppStatefor setting up shared cursors.crates/ar-gateway/src/main.rs:
SharedCommentCursorsin the main function to be used by the poller and webhook.crates/ar-gateway/src/poller.rs:
SharedCommentCursorstype andclaim_chat_commentfunction for deduplication.with_cursorsmethod toChatPollerfor setting shared cursors.crates/ar-gateway/src/webhook.rs:
handle_issue_commentto use shared cursors for deduplication logic.Tests:
Pre-merge checks
Addressed the review feedback about test-file coverage.
Reflection/classification: this was a one-off mismatch between the existing adjacent unit-test coverage and the pre-merge heuristic, which expects a changed test file path. The implementation already had behavioral regression tests, but I added an integration test file so the PR surface clearly shows tests were touched.
Added:
crates/ar-gateway/tests/chat_comment_dedup.rs(owner, repo, PR, comment_id)while allowing distinct PRs and newer comment IDs.Verification:
nix develop --command cargo nextest run -p ar-gateway shared_chat_comment_claims_deduplicate_by_pr_and_comment_idnix develop --command cargo nextest run -p ar-gatewaynix develop --command cargo clippy -p ar-gateway --all-targets -- -D warningsnix develop --command cargo fmt --all -- --checkThis PR addresses issue #50 by implementing a deduplication mechanism for chat mentions in the
ar-gatewaycomponent. The changes appear well-structured and include necessary tests to ensure functionality. The PR is ready for merging, assuming all tests pass.Walkthrough
CHANGELOG.md:
crates/ar-gateway/src/lib.rs:
SharedCommentCursorsto manage shared state for comment cursors.with_chat_comment_cursorsmethod toAppStatefor setting up shared cursors.crates/ar-gateway/src/main.rs:
SharedCommentCursorsin the main function to ensure shared state is available for the poller and webhook.crates/ar-gateway/src/poller.rs:
claim_chat_commentandseed_chat_cursor_monotonicfunctions to manage comment deduplication.ChatPollerto use shared cursors for deduplication.crates/ar-gateway/src/webhook.rs:
claim_chat_commentto ensure webhook comments are deduplicated.crates/ar-gateway/tests/chat_comment_dedup.rs:
Pre-merge checks