Skip to content

Reviewer: every press of Re-request review gets its own review - #345

Merged
nambok merged 1 commit into
mainfrom
fix/rerequest-dedup
Oct 28, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/rerequest-dedup

Conversation

@nambok

@nambok nambok commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a person pressed GitHub's "Re-request review" a second time on the same commit within 6 hours, nothing happened. The gateway gave each re-request the job key rerequest#<head sha>, and the worker holds that key for 6 hours, so the second press was dropped before the worker ran and the person never saw a verdict. Every explicit ask should get a visible verdict, so each press now has its own key.

Changes

  • New rerequest_key in routes/github_webhook.rs. The key is GitHub's id for the delivery (X-GitHub-Delivery) plus the id of the reviewer being requested.
    • A redelivery of the same event has the same delivery id, so it gets the same key and is still deduplicated.
    • A new press is a new event with a new delivery id, so it reaches the worker.
    • If the delivery id is ever missing, the key falls back to the head commit plus the pull request's updated_at for that request.
  • The delivery id is passed from route to dispatch and then to handle_pull_request. It is already recorded on every delivery as external_id, and relayed events from hybrid installs carry their relay delivery id there too.
  • The re-review reward event uses the same key, so each press is counted once.
  • No worker change was needed. A re-request already counts as an explicit ask, so its verdict is posted even when it hasn't changed.

Verification

  • New tests:
    • two_presses_on_the_same_commit_are_two_asks: two presses on the same head get different keys, so both reach the worker.
    • a_redelivery_of_the_same_event_is_the_same_job: a redelivery with the same delivery id gets the same key.
    • without_a_delivery_id_each_request_still_has_its_own_key.
  • cargo fmt --check and cargo clippy --workspace --all-targets -D warnings are clean.
  • cargo test --workspace: common 1226, gateway 596, worker 770, all passing, after rebasing on main with Reviewer: answer replies to its findings without a mention; look up bucket and key settings instead of asking #342 in.

The gateway keyed a native re-request by the PR head (rerequest#<sha>),
claimed for hours, so a second press on the same commit was dropped
before the worker ran and the person saw no verdict. The key is now
GitHub's delivery id plus the requested reviewer: a redelivery of the
same event is still one job, a new press is a new ask.
@nambok
nambok force-pushed the fix/rerequest-dedup branch from fbdaf9d to 7453070 Compare October 27, 2026 21:27
@nambok
nambok merged commit 008460d into main Oct 28, 2026
8 checks passed
@nambok
nambok deleted the fix/rerequest-dedup branch October 28, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant