Commit 1fac8c5
feat(pr): draft PRs by default, auto-undraft in pr-patrol (#1794)
* fix(ci): increase scheduled-maintenance max-turns and timeout
Previous run (2026-03-05T07:59:11Z) failed with error_max_turns after
31 turns — Claude ran out with max-turns=30 on a weekly sweep. Also
increase timeout-minutes from 30 to 60 to give sufficient wall-clock
headroom for weekly/monthly cadences.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(pr): draft PRs by default, auto-undraft in pr-patrol
- `crux pr create` now creates draft PRs by default (use --no-draft to override)
- New `crux pr ready` command validates eligibility (CI green, no conflicts,
no unresolved threads, no unchecked items) before converting draft to ready
- PR Patrol auto-undrafts draft PRs labeled `ready-to-merge` when all other
eligibility checks pass, then merges in the same cycle
- PR Patrol skips draft PRs from the fix queue (no point fixing drafts)
- Added `isDraft` to GraphQL PR query and `GqlPrNode` interface
- `is-draft` added as a new `MergeBlockReason`
- 4 new tests covering draft eligibility checks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address review findings — is-draft self-block, REST fallback, failed undraft tracking
- Filter out 'is-draft' from block reasons in `crux pr ready` (it's the
whole point of the command, not a blocker)
- Replace REST-then-GraphQL fallback with direct GraphQL for undrafting
(REST API doesn't support undrafting, so the REST call always fails)
- Track which PRs were successfully undrafted before attempting merge
(prevents merge attempts on PRs where undraft API call failed)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(pr): address CodeRabbit review feedback
- Validate --pr option: return error on malformed values instead of
silently falling back to branch autodetection
- Keep ci-pending as a blocker for `crux pr ready` to match PR Patrol
auto-undraft behavior (only is-draft is filtered out)
- Simulate undraft in dry-run mode so merge phase also reports what
would happen
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 03463bb commit 1fac8c5
3 files changed
+247
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
213 | | - | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
602 | 604 | | |
603 | 605 | | |
604 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
605 | 702 | | |
606 | 703 | | |
607 | 704 | | |
608 | 705 | | |
609 | 706 | | |
610 | 707 | | |
| 708 | + | |
611 | 709 | | |
612 | 710 | | |
613 | 711 | | |
| |||
620 | 718 | | |
621 | 719 | | |
622 | 720 | | |
623 | | - | |
| 721 | + | |
| 722 | + | |
624 | 723 | | |
625 | 724 | | |
626 | 725 | | |
| |||
632 | 731 | | |
633 | 732 | | |
634 | 733 | | |
635 | | - | |
| 734 | + | |
636 | 735 | | |
637 | 736 | | |
638 | 737 | | |
639 | 738 | | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
640 | 743 | | |
641 | 744 | | |
642 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
286 | 301 | | |
287 | 302 | | |
288 | 303 | | |
| |||
349 | 364 | | |
350 | 365 | | |
351 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
352 | 384 | | |
353 | 385 | | |
354 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
| 490 | + | |
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
| |||
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| |||
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
628 | 666 | | |
629 | 667 | | |
630 | 668 | | |
| |||
635 | 673 | | |
636 | 674 | | |
637 | 675 | | |
| 676 | + | |
| 677 | + | |
638 | 678 | | |
639 | 679 | | |
640 | 680 | | |
| |||
688 | 728 | | |
689 | 729 | | |
690 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
691 | 735 | | |
692 | 736 | | |
693 | 737 | | |
| |||
759 | 803 | | |
760 | 804 | | |
761 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
762 | 841 | | |
763 | 842 | | |
764 | 843 | | |
| |||
1298 | 1377 | | |
1299 | 1378 | | |
1300 | 1379 | | |
1301 | | - | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1302 | 1383 | | |
1303 | | - | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1304 | 1408 | | |
1305 | 1409 | | |
1306 | 1410 | | |
| |||
0 commit comments