Skip to content

fix(cli): handle rebase abort crash in CI pull-request flow#2012

Merged
cherkanovart merged 1 commit intomainfrom
fix/ci-rebase-abort-crash
Feb 23, 2026
Merged

fix(cli): handle rebase abort crash in CI pull-request flow#2012
cherkanovart merged 1 commit intomainfrom
fix/ci-rebase-abort-crash

Conversation

@cherkanovart
Copy link
Contributor

@cherkanovart cherkanovart commented Feb 23, 2026

Summary

  • Wrapped git rebase --abort in a try/catch in the CI pull-request flow so it doesn't crash when no rebase is actually in progress
  • Previously, if the rebase failure was resolved before the abort step (or never started), the unhandled error would crash the entire flow

Test plan

  • Run CI pull-request flow where rebase fails and verify it falls back gracefully
  • Run CI pull-request flow where rebase succeeds and verify normal behavior is unaffected

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a crash in the CI pull request flow that occurred when rebasing failed and the CLI attempted to abort a non-existent rebase. The workflow now handles this scenario gracefully.

Wrap `git rebase --abort` in a try/catch so the CI pull-request flow
doesn't crash when the rebase has already been resolved or was never
started.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78511de and 8baa262.

📒 Files selected for processing (2)
  • .changeset/fix-ci-rebase-abort-crash.md
  • packages/cli/src/cli/cmd/ci/flows/pull-request.ts

📝 Walkthrough

Walkthrough

The PR adds graceful error handling to the CI pull-request flow, preventing crashes when attempting to abort a git rebase that isn't in progress. A try/catch wrapper around the abort operation emits a warning instead of throwing, allowing subsequent rollback steps to execute normally.

Changes

Cohort / File(s) Summary
Changeset Declaration
.changeset/fix-ci-rebase-abort-crash.md
New changeset entry declaring a patch release for CLI to handle rebase abort gracefully when no rebase is in progress.
Rebase Error Handling
packages/cli/src/cli/cmd/ci/flows/pull-request.ts
Wrapped git rebase abort in try/catch block; failure now emits warning instead of throwing, permitting flow to continue with reset and file restoration operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rebase gone awry, no crash in sight,
With try and catch wrapped ever so tight,
The abort may fail, but we won't despair,
We'll reset and restore with utmost care!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the summary and test plan sections, but lacks several required template sections including detailed changes list, business logic tests with checkboxes, and visuals section. Fill in the missing template sections, particularly add checkbox items under 'Business logic tests added' to clarify what test cases were added or need to be added.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: handling a rebase abort crash in the CI pull-request flow, which matches the core change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ci-rebase-abort-crash

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

@cherkanovart cherkanovart merged commit 7bb465c into main Feb 23, 2026
10 checks passed
@cherkanovart cherkanovart deleted the fix/ci-rebase-abort-crash branch February 23, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants