Commit 5a4bdd3
authored
fix: improve AI cherry-pick conflict resolution for modify/delete conflicts (#1046)
## Summary
- Updated AI conflict resolution prompt with explicit rules for
modify/delete conflicts
- For modify/delete conflicts (file "deleted in HEAD"), the AI now keeps
the file instead of deleting it
- Removed `--allow-empty` fallback — empty cherry-picks now fall back to
manual instructions since they indicate incorrect AI resolution
## Context
Cherry-pick of PR RedHatQE/mtv-api-tests#349 to v2.10 resulted in an
empty PR (#352) because the AI deleted the file (following the old
prompt's "prefer target branch version" instruction). The file
`tools/bm-dns-setup.sh` doesn't exist on v2.10 — git reports this as
"deleted in HEAD" but it's actually a new file being brought to the
target branch.
## Test plan
- [x] Updated `test_cherry_pick_ai_resolves_conflicts` verifies prompt
includes modify/delete guidance
- [x] Updated `test_cherry_pick_ai_empty_result_falls_back_to_manual`
verifies empty cherry-picks fail correctly
- [x] Full test suite passes (1436 tests, 90.28% coverage)
Closes #1043
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Improvements**
* Updated AI conflict-resolution behavior to handle modify/delete
conflicts more explicitly and simplify post-resolution instructions.
* **Bug Fixes**
* Changed empty cherry-pick handling to report failure instead of
creating empty commits or attempting auto-fallbacks.
* **Tests**
* Updated tests to expect a manual fallback path and to verify the AI
prompt includes delete/modify conflict guidance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent f392601 commit 5a4bdd3
2 files changed
Lines changed: 33 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
754 | 762 | | |
755 | 763 | | |
756 | 764 | | |
| |||
801 | 809 | | |
802 | 810 | | |
803 | 811 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
| 812 | + | |
| 813 | + | |
820 | 814 | | |
821 | 815 | | |
822 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1502 | 1502 | | |
1503 | 1503 | | |
1504 | 1504 | | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1505 | 1510 | | |
1506 | 1511 | | |
1507 | 1512 | | |
| |||
1599 | 1604 | | |
1600 | 1605 | | |
1601 | 1606 | | |
1602 | | - | |
| 1607 | + | |
1603 | 1608 | | |
1604 | 1609 | | |
1605 | | - | |
| 1610 | + | |
1606 | 1611 | | |
1607 | 1612 | | |
1608 | 1613 | | |
| |||
1624 | 1629 | | |
1625 | 1630 | | |
1626 | 1631 | | |
1627 | | - | |
1628 | | - | |
1629 | 1632 | | |
1630 | 1633 | | |
1631 | 1634 | | |
1632 | 1635 | | |
1633 | | - | |
| 1636 | + | |
1634 | 1637 | | |
1635 | 1638 | | |
1636 | 1639 | | |
| |||
1654 | 1657 | | |
1655 | 1658 | | |
1656 | 1659 | | |
1657 | | - | |
| 1660 | + | |
1658 | 1661 | | |
1659 | | - | |
| 1662 | + | |
1660 | 1663 | | |
1661 | 1664 | | |
1662 | 1665 | | |
1663 | | - | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
| 1666 | + | |
| 1667 | + | |
1667 | 1668 | | |
1668 | | - | |
1669 | | - | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
1670 | 1674 | | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
1680 | 1675 | | |
1681 | 1676 | | |
1682 | 1677 | | |
| |||
0 commit comments