Summary
Add handling for pull_request_review_thread webhook events to trigger can-be-merged re-evaluation when review threads are resolved.
Problem / Motivation
When required_conversation_resolution is enabled, can-be-merged fails if there are unresolved review threads. However, there is no event handler for when threads get resolved, so can-be-merged never re-runs unless another trigger fires (label change, check run completion, etc.).
Running the check on every pull_request_review_comment event would be wasteful since that fires on every comment, not just resolution changes.
Requirements
- Handle the
pull_request_review_thread webhook event (action: resolved). This event fires only when a thread's resolution status changes.
- Optimization: "last thread resolved" gate — Before running the full
check_if_can_be_merged, query get_unresolved_review_threads() first:
- If count > 0 → skip (other threads still unresolved, can-be-merged would fail anyway)
- If count == 0 → run full can-be-merged check
- This means resolving 10 threads results in 10 cheap GraphQL calls but only 1 full can-be-merged evaluation.
Deliverables
Notes
- The
pull_request_review_thread event is a distinct GitHub webhook event, separate from pull_request_review_comment.
- It fires only on thread resolution/unresolve, making it ideal for this use case.
Summary
Add handling for
pull_request_review_threadwebhook events to triggercan-be-mergedre-evaluation when review threads are resolved.Problem / Motivation
When
required_conversation_resolutionis enabled,can-be-mergedfails if there are unresolved review threads. However, there is no event handler for when threads get resolved, socan-be-mergednever re-runs unless another trigger fires (label change, check run completion, etc.).Running the check on every
pull_request_review_commentevent would be wasteful since that fires on every comment, not just resolution changes.Requirements
pull_request_review_threadwebhook event (action:resolved). This event fires only when a thread's resolution status changes.check_if_can_be_merged, queryget_unresolved_review_threads()first:Deliverables
pull_request_review_threadevent routing ingithub_api.pyprocess()methodexamples/.github-webhook-server.yaml)required_conversation_resolutionis disabledNotes
pull_request_review_threadevent is a distinct GitHub webhook event, separate frompull_request_review_comment.