feat(release): auto-open the flake bump PR, and fix preflight ordering - #2956
Merged
Conversation
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>
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>
…ript-improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four changes to
scripts/release.ts, all about the steps that stop a release before it starts. Theflake.nixbump now happens before main'scli-testsresult is judged — that bump has to merge into main, which re-runscli-teststhere, 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 tobump-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-testsskips only the green-main check for the cases where it's wrong —cli-releasestill 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 behindorigin/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,--changesand--statusrun 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 stubbeddevbox/nix/gh: it committed, pushed, opened the PR, returned to main clean, halted with the URL, and short-circuited on re-run. Thecli-testscheck was run against real GitHub — it correctly caught that the latest run on main isin_progress, and--skip-cli-testswalked 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