Skip to content

fix: handle cherry-pick auto-completion after AI conflict resolution (#1041)#1042

Merged
myakove merged 1 commit intomainfrom
fix/issue-1041-cherry-pick-continue-after-ai-resolution
Mar 18, 2026
Merged

fix: handle cherry-pick auto-completion after AI conflict resolution (#1041)#1042
myakove merged 1 commit intomainfrom
fix/issue-1041-cherry-pick-continue-after-ai-resolution

Conversation

@myakove
Copy link
Copy Markdown
Collaborator

@myakove myakove commented Mar 18, 2026

Summary

  • After AI resolves cherry-pick conflicts, check if cherry-pick is still in progress before running --continue
  • For modify/delete conflicts with a single file, git auto-completes the cherry-pick when the resolved file is staged
  • Previously this caused cherry-pick --continue to fail with "no cherry-pick or revert in progress"

Test plan

  • New test test_cherry_pick_ai_resolves_modify_delete_conflict validates the auto-complete scenario
  • Existing cherry-pick AI tests continue to pass
  • Full test suite passes (1435 tests, 90.40% coverage)

Closes #1041

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced cherry-pick conflict resolution with pre-verification of cherry-pick state before finalizing operations.
    • Improved handling of already-completed cherry-picks with distinct logging for in-progress vs completed scenarios.
  • Tests

    • Added comprehensive test coverage for modify/delete conflict scenarios during cherry-pick resolution.

After AI resolves cherry-pick conflicts (e.g. modify/delete conflicts),
git may auto-complete the cherry-pick when all conflicts are staged.
Check CHERRY_PICK_HEAD before running --continue to avoid "no cherry-pick
in progress" errors.

Closes #1041
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 828b799d-8d10-4af5-a5b6-e7a02540029e

📥 Commits

Reviewing files that changed from the base of the PR and between 38422af and 8b129a9.

📒 Files selected for processing (2)
  • webhook_server/libs/handlers/runner_handler.py
  • webhook_server/tests/test_runner_handler.py

Walkthrough

The PR fixes cherry-pick conflict handling by adding a pre-check before running cherry-pick --continue. It verifies if a cherry-pick is still in progress via git rev-parse CHERRY_PICK_HEAD, only continuing if needed, and adds test coverage for modify/delete conflict scenarios.

Changes

Cohort / File(s) Summary
Cherry-pick Continuation Logic
webhook_server/libs/handlers/runner_handler.py
Added conditional check via git rev-parse CHERRY_PICK_HEAD before executing cherry-pick --continue. If cherry-pick is already in-progress, proceeds with continuation; if already auto-completed by git (no cherry-pick head exists), logs success without further action. Maintains file staging but defers finalization to only when needed.
Test Coverage
webhook_server/tests/test_runner_handler.py
Added new test function test_cherry_pick_ai_resolves_modify_delete_conflict that verifies the fix for modify/delete conflict resolution. Tests expects auto-completion without --continue call, validates CHERRY_PICK_HEAD pre-check, and ensures PR creation and AI-derived comments are generated correctly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The fix requires understanding git's cherry-pick semantics—specifically why modify/delete conflicts auto-complete the cherry-pick once the last conflict is resolved—and verifying the pre-check logic is correctly placed. The test mirrors existing patterns but targets a specific conflict type that caused the original failure.

Possibly related PRs

Suggested labels

size/M, branch-main, can-be-merged

Suggested reviewers

  • rnetser
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a check before cherry-pick --continue to handle auto-completion after AI conflict resolution.
Linked Issues check ✅ Passed The code changes directly address all primary requirements from issue #1041: checking for in-progress cherry-pick before calling --continue, handling auto-completed cherry-picks as success, and adding test coverage for modify/delete conflicts.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the cherry-pick auto-completion issue: modifications to conflict finalization logic and comprehensive test coverage for the modify/delete scenario.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-1041-cherry-pick-continue-after-ai-resolution
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@myakove-bot
Copy link
Copy Markdown
Collaborator

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest python-module-install - Test Python package installation
  • /retest pre-commit - Run pre-commit hooks and checks
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 1 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@myakove-bot myakove-bot requested a review from rnetser March 18, 2026 09:53
@myakove myakove merged commit 88ffe55 into main Mar 18, 2026
7 of 9 checks passed
@myakove myakove deleted the fix/issue-1041-cherry-pick-continue-after-ai-resolution branch March 18, 2026 09:56
@myakove-bot
Copy link
Copy Markdown
Collaborator

New container for ghcr.io/myk-org/github-webhook-server:latest published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: cherry-pick --continue fails after AI conflict resolution for modify/delete conflicts

2 participants