Commit 38422af
authored
## Summary
- Add `pull_request_review_thread` event handler in `github_api.py`
- Re-evaluate `can-be-merged` on `resolved` and `unresolved` actions
(always runs full check)
- Skip non-actionable events (`created`) before API bootstrap to save
rate limit
- Skip when `required_conversation_resolution` is disabled
- Clone repo and initialize OwnersFileHandler — `check_if_can_be_merged`
evaluates ALL conditions (approvals, OWNERS, labels, checks,
conversations) on every call
- Add `status` event: clone + initialize for full merge check, hoist
pending skip before bootstrap
- Extract `_recheck_merge_eligibility()` shared helper for status +
review_thread handlers
- Update webhook if configured events differ from existing (smart event
reconciliation)
- Add `pull_request_review_thread` and `status` to example configs
## Problem
When review threads are resolved, `can-be-merged` was not re-evaluated.
PRs stayed in stale "unresolved conversations" state until another event
triggered re-evaluation.
## Changes
| File | Change |
|---|---|
| `webhook_server/libs/github_api.py` | Add `pull_request_review_thread`
+ `status` handlers with clone + full merge check, hoist early skips
before bootstrap, extract `_recheck_merge_eligibility()` |
| `webhook_server/utils/webhook.py` | Smart webhook event reconciliation
— update existing hooks when events change, dedupe with `set()` |
| `webhook_server/tests/test_github_api.py` | Parameterized tests for
status states, review thread actions, bootstrap skip assertions |
| `webhook_server/tests/test_webhook.py` | Parameterized webhook
event-update tests |
| `examples/config.yaml` | Add `pull_request_review_thread` and `status`
events |
| `examples/.github-webhook-server.yaml` | Add
`pull_request_review_thread` and `status` events |
| `webhook_server/tests/manifests/config.yaml` | Add
`pull_request_review_thread` and `status` events |
## Test plan
- [x] All 1434 tests pass, 90.37% coverage
- [x] Deployed and verified: resolved review threads trigger
can-be-merged re-evaluation
- [x] Webhook events updated on GitHub repos automatically
Closes #1038
1 parent d07a720 commit 38422af
7 files changed
Lines changed: 355 additions & 32 deletions
File tree
- examples
- webhook_server
- libs
- tests
- manifests
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
412 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
413 | 465 | | |
414 | 466 | | |
415 | 467 | | |
| |||
508 | 560 | | |
509 | 561 | | |
510 | 562 | | |
511 | | - | |
512 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
513 | 566 | | |
514 | 567 | | |
515 | 568 | | |
| |||
606 | 659 | | |
607 | 660 | | |
608 | 661 | | |
609 | | - | |
| 662 | + | |
610 | 663 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | 664 | | |
622 | 665 | | |
623 | 666 | | |
624 | 667 | | |
625 | 668 | | |
626 | 669 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| 670 | + | |
631 | 671 | | |
632 | 672 | | |
633 | 673 | | |
| |||
636 | 676 | | |
637 | 677 | | |
638 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
639 | 694 | | |
640 | 695 | | |
641 | 696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
0 commit comments