Skip to content

fix(create-pr): avoid shared PR body temp files - #697

Merged
baleen37 merged 2 commits into
mainfrom
brave-mango-liskov
Jun 23, 2026
Merged

fix(create-pr): avoid shared PR body temp files#697
baleen37 merged 2 commits into
mainfrom
brave-mango-liskov

Conversation

@baleen37

@baleen37 baleen37 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • remove shared PR body temp file guidance from create-pr flow
  • route create-pr through the wrapper and use per-run repo-local body files by default
  • handle existing PR, committed branch diff, preflight blocking states, and PR creation fallback more clearly

Tests

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

Summary by CodeRabbit

  • Bug Fixes

    • Improved error reporting for merge conflicts with specific file details
    • Added fallback detection when PR creation fails
    • Enhanced preflight validation and sync behavior
  • Documentation

    • Refined PR creation workflow and body file handling guidance
  • Tests

    • Added end-to-end tests validating PR creation scenarios with various branch states

@baleen37 baleen37 changed the title Merge remote-tracking branch 'origin/main' into brave-mango-liskov fix(create-pr): avoid shared PR body temp files Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 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: 37d087af-a0a9-4337-a754-1c56766c05d9

📥 Commits

Reviewing files that changed from the base of the PR and between b7f2b7f and 21f94eb.

📒 Files selected for processing (4)
  • plugins/me/skills/create-pr/SKILL.md
  • plugins/me/skills/create-pr/scripts/create-pr.sh
  • plugins/me/skills/create-pr/scripts/preflight-check.sh
  • tests/me/create-pr-e2e.bats

📝 Walkthrough

Walkthrough

The create-pr skill is updated so BODY_PATH defaults to empty and a per-run temp file is lazily created via mktemp with an EXIT trap. BASE is now resolved and passed explicitly to preflight-check.sh. The NOOP guard uses branch diff and PR existence; gh pr create failure falls back to gh pr view. preflight-check.sh now reports conflicted filenames on merge failure. Tests and SKILL.md are updated accordingly.

Changes

create-pr workflow refinements

Layer / File(s) Summary
Lazy body file and BASE resolution
plugins/me/skills/create-pr/scripts/create-pr.sh
BODY_PATH defaults to empty; write_body() lazily creates a mktemp-backed per-run file with an EXIT cleanup trap. BASE is resolved from env or gh repo view defaultBranchRef and passed explicitly to preflight-check.sh.
NOOP guard and PR create fallback
plugins/me/skills/create-pr/scripts/create-pr.sh
NOOP exit now requires both no commits ahead of origin/$BASE and no existing PR from gh pr view. gh pr create failure falls back to fetching an existing PR URL; prints error and exits 1 if none found.
Structured merge conflict reporting
plugins/me/skills/create-pr/scripts/preflight-check.sh
Replaces compact `
Tests and documentation
tests/me/create-pr-e2e.bats, plugins/me/skills/create-pr/SKILL.md
Git stub gains a rev-parse --git-path case for body file path. Two new Bats tests cover unique per-run body file naming and PR creation from a committed branch diff. SKILL.md adds a preflight outcomes matrix, PR_EXISTS: handling, updated CI_FAILED: remediation, and per-run --body-file guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • baleen37/bstack#696: Directly precedes this PR's changes to create-pr.sh and preflight-check.sh, sharing NOOP/MERGED semantics and PR body-file handling that this PR refines.
  • baleen37/bstack#685: Overlaps on SKILL.md guidance around gh pr create --body-file and avoiding mixing PR setup/title text, which this PR also updates.
  • baleen37/bstack#580: Modifies preflight-check.sh's handling of BASE resolution, the same path this PR extends by passing BASE explicitly from create-pr.sh.

Poem

🐇 A temp file blooms per run, then fades away,
BASE is fetched fresh and passed on its way.
Conflicts now speak their filenames aloud,
NOOP checks the diff before crying "no crowd."
Each PR body unique — never shared, never stale,
The rabbit commits clean and hops down the trail! 🌿

✨ 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 brave-mango-liskov

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 enabled auto-merge (squash) June 23, 2026 03:04
@baleen37
baleen37 merged commit 7ee1456 into main Jun 23, 2026
4 of 5 checks passed
@baleen37
baleen37 deleted the brave-mango-liskov branch June 23, 2026 03:04
baleen-release-app Bot pushed a commit that referenced this pull request Jun 23, 2026
## [17.25.1](v17.25.0...v17.25.1) (2026-06-23)

### Bug Fixes

* **create-pr:** avoid shared PR body temp files ([#697](#697)) ([7ee1456](7ee1456))
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