Commit f392601
authored
fix: handle cherry-pick edge cases after AI conflict resolution (#1045)
## Summary
- Check `CHERRY_PICK_HEAD` before running `--continue` to handle
auto-completed cherry-picks (e.g. modify/delete conflicts)
- Handle empty cherry-pick result with `--allow-empty` commit when AI
resolution produces no changes vs target branch
- Add `--label` flags to `gh pr create` to prevent
auto-verify/auto-merge race condition on AI-resolved cherry-pick PRs
- Add `ai-resolved-conflicts` guard in `set_pull_request_automerge()`
with active `disable_automerge` when already enabled
- Return `False` for unexpected `rev-parse` errors instead of silently
proceeding
## Test plan
- [x] New test `test_cherry_pick_ai_resolves_modify_delete_conflict`
validates auto-complete scenario
- [x] New test `test_cherry_pick_ai_resolves_empty_cherry_pick`
validates empty commit fallback
- [x] Updated `test_cherry_pick_ai_resolves_conflicts` verifies labels
in `gh pr create` command
- [x] Full test suite passes (1436 tests, 90.22% coverage)
Closes #1043
Closes #1044
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Cherry-pick pull requests now include appropriate labels for better
tracking and organization.
* **Improvements**
* Enhanced handling of AI-resolved conflicts in automated cherry-pick
operations.
* Auto-merge now prevents activation for cherry-picks containing
resolved conflicts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 88ffe55 commit f392601
3 files changed
Lines changed: 134 additions & 17 deletions
File tree
- webhook_server
- libs/handlers
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
908 | 925 | | |
909 | 926 | | |
910 | 927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
804 | | - | |
805 | | - | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
806 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
807 | 824 | | |
808 | 825 | | |
809 | 826 | | |
| |||
988 | 1005 | | |
989 | 1006 | | |
990 | 1007 | | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
991 | 1012 | | |
992 | 1013 | | |
993 | 1014 | | |
994 | 1015 | | |
995 | 1016 | | |
| 1017 | + | |
996 | 1018 | | |
997 | 1019 | | |
998 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
1497 | | - | |
| 1497 | + | |
1498 | 1498 | | |
1499 | 1499 | | |
1500 | 1500 | | |
| |||
1514 | 1514 | | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1530 | 1520 | | |
1531 | 1521 | | |
1532 | 1522 | | |
| |||
1599 | 1589 | | |
1600 | 1590 | | |
1601 | 1591 | | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
1602 | 1680 | | |
1603 | 1681 | | |
1604 | 1682 | | |
| |||
0 commit comments