fix: handle cherry-pick edge cases after AI conflict resolution#1045
fix: handle cherry-pick edge cases after AI conflict resolution#1045
Conversation
- 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 - 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 proceeding Closes #1043 Closes #1044
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds guard logic to prevent auto-merge of AI-resolved cherry-pick PRs and implements empty cherry-pick handling. It shifts label application from post-creation to PR creation time to eliminate race conditions during webhook processing. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Why: The changes touch multiple interdependent components (PR handler guard, runner handler cherry-pick flow, test assertions) and require understanding the race condition context. The modifications are cohesive but involve error code validation, conditional flag construction, and test assertion restructuring across three files. Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@webhook_server/libs/handlers/pull_request_handler.py`:
- Around line 917-920: The current except block logs only the exception message
using self.logger.error and thus loses traceback; update the except handling
around the auto-merge disable code to call
self.logger.exception(f"{self.log_prefix} Failed to disable auto-merge for
AI-resolved cherry-pick") (or alternately self.logger.error(..., exc_info=True))
so the full stack trace is preserved—replace the existing self.logger.error(...)
in that except Exception as exp block accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0375aa26-ebb4-45b0-980c-32617597dc93
📒 Files selected for processing (3)
webhook_server/libs/handlers/pull_request_handler.pywebhook_server/libs/handlers/runner_handler.pywebhook_server/tests/test_runner_handler.py
Per CLAUDE.md convention, use logger.exception() instead of logger.error() to preserve full traceback in logs.
|
New container for ghcr.io/myk-org/github-webhook-server:latest published |
Summary
CHERRY_PICK_HEADbefore running--continueto handle auto-completed cherry-picks (e.g. modify/delete conflicts)--allow-emptycommit when AI resolution produces no changes vs target branch--labelflags togh pr createto prevent auto-verify/auto-merge race condition on AI-resolved cherry-pick PRsai-resolved-conflictsguard inset_pull_request_automerge()with activedisable_automergewhen already enabledFalsefor unexpectedrev-parseerrors instead of silently proceedingTest plan
test_cherry_pick_ai_resolves_modify_delete_conflictvalidates auto-complete scenariotest_cherry_pick_ai_resolves_empty_cherry_pickvalidates empty commit fallbacktest_cherry_pick_ai_resolves_conflictsverifies labels ingh pr createcommandCloses #1043
Closes #1044
Summary by CodeRabbit
New Features
Improvements