Repository navigation
fix(release): release-start.yml agrees with bin/release on fragments after a published version - #719
Merged
Merged
Conversation
…after a published version The shared Start release workflow failed when npm already had the version in package.json and every entry was in changes/ fragments: renumber looked for "## Unreleased" and threw. It also kept the level of the published version, so a published 1.0.0 with one fix asked for 2.0.0 and stopped at the major check. It now settles the version as bin/release does since #713: - a published version keeps its section; the new version takes the Unreleased section, or a new empty section that the fragments fill - a published x.y.z starts from its next patch, and `cli-dev changelog level --next` raises it only when the entries need more - with no fragment and no Unreleased entry (or an empty Unreleased section) the run stops before anything changes - package.json, src/version.ts and CHANGELOG.md are all checked before any is written The fragment and level logic stays in the existing cli-dev commands (fragments --collect, level --next, next-version), which every caller's cli-dev already has. scripts/release-start.test.ts runs the step's own script against a local git origin with a fake npm. Fixes #714 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…version Review of #714: the step asked npm twice whether the version was published, so a version that reached npm mid-run could be folded into and then raised. after-raise ran on every renumber, once with a number that never ships. Document that callers need cli-dev from cli-base 0.98.0 (changelog level), and cover a custom unreleased title, src/version.ts and the hook in tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task
Fixes #714. The shared Start release workflow failed when npm already had the version in
package.jsonand every entry was inchanges/fragments (no## Unreleasedto rename). It also asked for a major after a publishedx.0.0. #713 fixed both inbin/release; this brings the workflow in line.What
.github/workflows/release-start.yml, step "settle the version", now followsbin/release:x.y.zstarts from its next patch.cli-dev changelog level --nextraises it only when the entries need more (1.0.0 + fix → 1.0.1, + Added → 1.1.0).package.json,src/version.tsandCHANGELOG.mdare all checked before any is written.after-raiseruns once, with the version that ships.fragments --collect,level --next,next-version). Only the renumber script and the next-patch one-liner stay inline. Callers run their own installed cli-dev, so the workflow cannot depend on a new cli-dev command. It now needs cli-base 0.98.0 or later forchangelog level; this is stated in the input and indocs/dev/release-workflow.md. Callers pin the workflow by SHA, so nothing changes for them until they bump.changes/fix-release-start-fragments.md.Testing
scripts/release-start.test.tstakes the step's script from the YAML and runs it against a local git origin with a fakenpm. It covers 8 cases: fragments only, a 1.0.0 patch, a 1.0.0 minor, a custom title withsrc/version.tsand the hook, an empty Unreleased section, nothing unreleased, and a major with and withoutmajor. Against the old workflow, 6 of 7 cases failed (the 8th was added later).scripts/release.test.tspasses, as dopnpm lint,pnpm typecheckandpnpm docs:check.##heading fails before writing anything, the same asbin/release.🤖 Generated with Claude Code