Skip to content

feat(release): auto-open the flake bump PR, and fix preflight ordering - #2956

Merged
mikeland73 merged 4 commits into
mainfrom
mikeland73/release-script-improvements
Aug 16, 2026
Merged

feat(release): auto-open the flake bump PR, and fix preflight ordering#2956
mikeland73 merged 4 commits into
mainfrom
mikeland73/release-script-improvements

Conversation

@mikeland73

Copy link
Copy Markdown
Collaborator

Summary

Four changes to scripts/release.ts, all about the steps that stop a release before it starts. The flake.nix bump now happens before main's cli-tests result is judged — that bump has to merge into main, which re-runs cli-tests there, so any result read beforehand is about a commit that won't be released, and a red main no longer hides the fact that a bump PR is needed at all. The bump itself is now automated: the script offers to commit to bump-flake-<version>, push and open the PR, then returns you to main with a clean tree and stops with the URL to get approved and merged (a re-run while it's open short-circuits with that URL instead of rebuilding the vendor hash and opening a second one). A new --skip-cli-tests skips only the green-main check for the cases where it's wrong — cli-release still runs the suite — and that check now distinguishes an in-progress run from a failed one and prints the run URL. Finally, preflight fast-forwards a clean main that is merely behind origin/main (exactly the state you're in after merging the bump PR) and otherwise fails per-condition with the command that fixes it: wrong branch, dirty tree, or local-only commits.

How was it tested?

--help, --changes and --status run clean against the live repo. All five preflight paths (wrong branch, dirty, behind → fast-forward, ahead-only, diverged) were exercised in a throwaway clone pair and each produced the intended message, with the fast-forward really pulling and carrying on to the version step. The flake-bump PR flow was run end to end with stubbed devbox/nix/gh: it committed, pushed, opened the PR, returned to main clean, halted with the URL, and short-circuited on re-run. The cli-tests check was run against real GitHub — it correctly caught that the latest run on main is in_progress, and --skip-cli-tests walked past it. The mutating GitHub steps (draft, tag, publish) were not exercised; no stray drafts, tags, branches or PRs were created, and all test artifacts were deleted.

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.

🤖 Generated with Claude Code

Four changes to scripts/release.ts, all about the steps that stop a release
before it starts.

The flake.nix bump now happens before main's cli-tests result is judged. That
bump has to merge into main, which re-runs cli-tests there, so any result read
beforehand is about a commit that won't be released — and a red main no longer
hides the fact that a bump PR is needed at all. The check moved out of
preflight into its own step to make that ordering explicit.

The bump itself is now automated: after rewriting lastTag and refreshing
vendor-hash and flake.lock, the script offers to commit to
bump-flake-<version>, push, and open the PR, then puts you back on main with a
clean tree and stops with the URL to get approved and merged. A re-run while
that PR is open short-circuits with its URL rather than rebuilding the vendor
hash and opening a second one. Declining still prints the manual instructions.

--skip-cli-tests skips the green-main check for the cases where it's wrong (a
run still in progress you've already inspected, a known flake). It only skips
the check; cli-release still runs the suite. The check also now distinguishes
an in-progress run from a failed one and prints the run URL either way.

Preflight fast-forwards a clean main that is merely behind origin/main instead
of refusing, since that's exactly the state you're in after merging the bump
PR. Everything else fails on its own with the command that fixes it: wrong
branch, dirty tree (listing what changed), and local-only commits, worded
differently for ahead-only versus genuinely diverged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 19:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

mikeland73 and others added 3 commits August 16, 2026 12:29
Three fixes to the code this branch restructured.

resumeDraft asked preflight for no branch checks at all, but the same path
reaches stepTag when the draft's tag was never pushed — which tags local HEAD.
Resuming such a draft from a feature branch would tag and push that branch.
Preflight now requires a clean main exactly when the tag still has to be
pushed.

openBumpPR returned null on any non-zero gh exit, so a transient API failure
looked identical to "no open PR" — and that answer leads to a force-push over
the open bump PR's head. It now fails loudly instead.

Draft mode counted ten steps and then printed an eleventh, "[11/10] Done".
Both modes run eleven steps; the eleventh is the publish in one and the
closing summary in the other.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The notes template and the release skill both said to escape every backtick as
\`, on the grounds that goreleaser interpolates the body into its Discord
announcement. It doesn't — that announcer is `enabled: false` in
.goreleaser.yaml, and nothing else re-reads the body. Markdown renders \` as a
literal backtick rather than opening a code span, so the rule did the opposite
of what it claimed: 0.17.4's published notes carry backslashes and bare
backticks where inline code was meant.

Both places now say to use plain backticks, and stepNotes unescapes any that
slip through — from $EDITOR or from --notes-file — warning when it does, so
notes written against the old guidance still publish cleanly.

The house-style pointer moves to 0.18.0, since 0.17.4 is the release that
demonstrates the bug.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mikeland73
mikeland73 merged commit f26266e into main Aug 16, 2026
27 checks passed
@mikeland73
mikeland73 deleted the mikeland73/release-script-improvements branch August 16, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants