Skip to content

fix(create-pr): create new PR after merged branch advances - #703

Merged
baleen37 merged 1 commit into
mainfrom
quick-horizon-abramov
Jun 25, 2026
Merged

fix(create-pr): create new PR after merged branch advances#703
baleen37 merged 1 commit into
mainfrom
quick-horizon-abramov

Conversation

@baleen37

@baleen37 baleen37 commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Treat only OPEN pull requests as reusable in create-pr.sh
  • Add regression coverage that post-merge commits create a new PR attempt

Tests

  • bats --filter 'creates a new PR when commits exist after the branch was merged' tests/me/create-pr-e2e.bats
  • bats tests/me/create-pr-e2e.bats
  • shellcheck plugins/me/skills/create-pr/scripts/create-pr.sh plugins/me/skills/create-pr/scripts/preflight-check.sh plugins/me/skills/create-pr/scripts/wait-for-merge.sh
  • git diff --check
  • bats tests/me/create-pr-e2e.bats tests/me/me-specific.bats
  • bash tests/run-unit-tests.sh

Summary by CodeRabbit

  • Bug Fixes
    • Improved pull request detection so existing open PRs are recognized more reliably after create attempts.
    • When PR creation fails, the app now rechecks for an open PR and returns its link if one exists.
    • Added clearer failure handling when no open PR can be found.
  • Tests
    • Updated end-to-end coverage for PR creation failure and no-diff scenarios.

@baleen37
baleen37 enabled auto-merge (squash) June 25, 2026 08:54
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7577a102-9023-4c8d-a7ba-b165c8c476b4

📥 Commits

Reviewing files that changed from the base of the PR and between 7298d2e and 5679734.

📒 Files selected for processing (2)
  • plugins/me/skills/create-pr/scripts/create-pr.sh
  • tests/me/create-pr-e2e.bats

📝 Walkthrough

Walkthrough

The PR creation script now checks GitHub PR state before and after a failed create attempt, returning an existing open PR URL when one exists and failing only when no open PR is found. The e2e stub and assertions were updated to match the revised flow.

Changes

PR creation state handling

Layer / File(s) Summary
State-driven PR creation
plugins/me/skills/create-pr/scripts/create-pr.sh, tests/me/create-pr-e2e.bats
The script switches from an unconditional PR URL pre-check to state-based handling around gh pr view and gh pr create, and the e2e stub/assertions cover the open-PR fallback and the no-create case.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • baleen37/bstack#696: Modifies the same create-pr.sh PR state/URL detection flow and updates the matching e2e test file.
  • baleen37/bstack#697: Changes the same gh pr view / gh pr create fallback logic around handling an existing PR after create failure.

Poem

A rabbit hopped through state and shell,
and found the PR path worked quite well.
If open, "here!" the URL sings,
if not, creation tries its springs.
🐇✨

✨ 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 quick-horizon-abramov

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.

@baleen37
baleen37 merged commit 20e4527 into main Jun 25, 2026
4 of 5 checks passed
@baleen37
baleen37 deleted the quick-horizon-abramov branch June 25, 2026 08:55
baleen-release-app Bot pushed a commit that referenced this pull request Jun 25, 2026
## [17.26.3](v17.26.2...v17.26.3) (2026-06-25)

### Bug Fixes

* **create-pr:** create new PR after merged branch advances ([#703](#703)) ([20e4527](20e4527))
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.

1 participant