Skip to content

Release script: --review the summary before anything is pushed - #173

Merged
JacobStephens2 merged 5 commits into
mainfrom
issue-160
Sep 30, 2026
Merged

JacobStephens2 merged 5 commits into
mainfrom
issue-160

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

With --review, scripts/release.sh stops once the summary is written and before anything is pushed. It prints the summary and asks [y]es / [e]dit / [n]o. To make that possible, the summary is now written before the branch is pushed on every run, with or without --review.

 main [--review] <version>
   bump the version, commit
-  push release-<version>
   write the summary (agent, or the generated notes as the fallback)
+  if --review
+    print the summary, ask [y]es / [e]dit / [n]o
+      y  → carry on with the summary as written
+      e  → open it in $EDITOR, carry on with what was saved
+      n  → "stopped at the review, so nothing was pushed", exit 1
+  push release-<version>
   open the PR, wait for CI, merge, tag

Without --review, the script never prompts and never reads stdin. The README's Releasing section now describes --review.

Evidence

  • Before: release.sh --review 0.2.0 → usage: release.sh <version>. The y and e tests failed.
    After: cargo test --test release: 13 passed, including the new tests:
    review y          → PR body summary == the agent's summary; tagged
    review e (EDITOR=sed s/headline/big news/) → PR body summary == edited text; tagged
    review n          → exit non-zero; origin has no release-0.2.0 branch, PR or tag
    no --review, "n" on stdin → runs to the tag with no prompt
    
    The full cargo test suite passes, and so do cargo clippy --all-targets and shellcheck scripts/release.sh.

Merge Danger

Door: two-way

Only the maintainer's release script and its tests change. Reverting the PR restores the old behaviour.

Blast Radius: releases

Runs without --review now push the branch after the summary is written, not before. If the notes fallback fails, the script now stops before pushing anything, where before it had already pushed an orphan release-<version> branch.

Unaddressed findings

Standards

  • pr_body is shallow now that it only fills a template. Kept: it still owns the release-summary markers the Release page step depends on.
  • run_script_with name doesn't say it adds stdin and env. Kept: _with is the usual Rust idiom, and the doc comment says what it adds.

Spec

  • No review test uses the fallback summary. Skipped: review works on whatever release_summary returns, and the fallback already has its own test.
  • The no---review test can't prove stdin is never read. Skipped: a black-box test can't observe that directly. The test pipes n and checks the script still reaches the tag without prompting.
  • End of stdin counts as no, an unrecognised answer asks again, and yes/edit/no are accepted. Kept: the safe default for a prompt that guards a push.
  • $EDITOR defaults to vi when unset. Kept: the same convention git follows.
  • An empty summary saved from the editor is accepted. Kept: the spec says to carry on with what was saved.
  • --review is only recognised before the version. Kept: this matches the documented usage, [--review] <version>.
  • "writing the summary with claude" now prints before the version diff is built. Kept: cosmetic, and the diff is part of the summary's input.
  • The branch push moved after the summary on every run. Kept: required so that nothing is pushed before the review.

Closes #160

🤖 Generated with Claude Code

JacobStephens2 and others added 5 commits September 30, 2026 03:08
With --review, the script prints the summary before anything is pushed and
asks yes, edit or no. The summary is now written before the branch is pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_summary returns a status instead of exiting inside $(…), so main
stops the script; the edit branch always removes its temp file; and the
tests share run_script_with and a pr_opened helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps --review and main's refusals before pushing: the header says both
exit 1 with nothing pushed, and the review and refusal tests sit side by side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 merged commit 0034d6c into main Sep 30, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-160 branch September 30, 2026 03:59
@JacobStephens2 JacobStephens2 mentioned this pull request Sep 30, 2026
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.

Release script: --review the summary before anything is pushed

1 participant