Skip to content

fix(create-pr): cover edge cases - #701

Merged
baleen37 merged 1 commit into
mainfrom
royal-ember-hickey
Jun 25, 2026
Merged

fix(create-pr): cover edge cases#701
baleen37 merged 1 commit into
mainfrom
royal-ember-hickey

Conversation

@baleen37

@baleen37 baleen37 commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • tighten the create-pr skill guidance into a compact terminal-prefix contract
  • preserve preflight output when create-pr preflight fails
  • expand create-pr wrapper coverage for concurrency, existing PR, conflict, CI failure, closed PR, and merge-blocked edge cases

Tests

  • bats tests/me/create-pr-e2e.bats tests/me/me-specific.bats
  • bash tests/run-unit-tests.sh
  • 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
  • markdownlint plugins/me/skills/create-pr/SKILL.md
  • git diff --check

Summary by CodeRabbit

  • Documentation

    • Clarified the recommended end-to-end flow for creating pull requests, including when to reuse the wrapper and how to interpret its terminal status messages.
    • Added clearer guidance for handling syncing, merge, and PR-creation outcomes.
  • Bug Fixes

    • Improved handling of preflight failures so errors are reported and propagated more reliably.
    • Better covers edge cases like PR creation races, blocked merges, and closed or unreviewable pull requests.
  • Tests

    • Expanded automated coverage for pull request creation, merge waiting, and related failure scenarios.
    • Added checks to keep the skill description focused and concise.

@baleen37
baleen37 enabled auto-merge (squash) June 25, 2026 07:02
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR revises create-pr usage guidance, changes the wrapper’s preflight exit handling, and expands e2e coverage for PR creation, branch sync, PR reuse, race handling, and merge-wait outcomes.

Changes

create-pr workflow

Layer / File(s) Summary
Skill guidance and validation
plugins/me/skills/create-pr/SKILL.md, tests/me/me-specific.bats
SKILL.md rewrites the wrapper-first instructions, terminal outcome table, and error handling notes, and the companion Bats test checks the description format and word count.
Preflight exit propagation
plugins/me/skills/create-pr/scripts/create-pr.sh
create-pr.sh captures preflight-check.sh output and status, restores set -e, and exits with the captured non-zero status.
E2E harness stubs
tests/me/create-pr-e2e.bats
The e2e harness adds merge-failure git behavior, richer gh PR visibility and PR-check outputs, and a two-run assertion for distinct repo-local body files.
Create-pr branching cases
tests/me/create-pr-e2e.bats
The e2e suite covers PR reuse with auto-merge, base sync success and failure, and create-pr race and no-PR failure paths.
wait-for-merge outcomes
tests/me/create-pr-e2e.bats
The e2e suite covers wait-for-merge CI failure output with run id, awaiting-review output when squash merge is blocked, and closed-PR termination.

Sequence Diagram(s)

sequenceDiagram
  participant "create-pr.sh" as CreatePr
  participant "preflight-check.sh" as Preflight
  participant "git" as Git
  participant "gh" as Gh
  CreatePr->>Preflight: run preflight-check.sh
  Preflight-->>CreatePr: output + exit status
  CreatePr->>Git: merge origin/main --no-edit
  CreatePr->>Gh: pr create / pr view / pr checks
  Gh-->>CreatePr: PR status or terminal prefix
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • baleen37/bstack#696: Extends the same wrapper/preflight and terminal-prefix flow in create-pr.sh, SKILL.md, and the e2e suite.
  • baleen37/bstack#697: Also changes create-pr body-file handling and fallback behavior around PR creation and reuse.
  • baleen37/bstack#597: Shares the wait-for-merge run-id failure path and related terminal output behavior.

Poem

I tucked the body file under my paw,
Then hopped through preflight, neat as law.
If PRs exist, I reuse the trail,
And merge-time whispers tell the tale.
🐇✨

🚥 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 is concise and accurately reflects the PR’s main focus on create-pr edge cases and fixes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 royal-ember-hickey

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.

auto-merge was automatically disabled June 25, 2026 07:03

Repository rule violations found

@baleen37
baleen37 merged commit b74c628 into main Jun 25, 2026
4 of 5 checks passed
@baleen37
baleen37 deleted the royal-ember-hickey branch June 25, 2026 07:07
baleen-release-app Bot pushed a commit that referenced this pull request Jun 25, 2026
## [17.26.1](v17.26.0...v17.26.1) (2026-06-25)

### Bug Fixes

* **create-pr:** cover edge cases ([#701](#701)) ([b74c628](b74c628))
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