Repository navigation
fix(release): keep a published section and collect changes/ fragments - #713
Merged
Merged
Conversation
…#706) When npm already had the version in package.json, bin/release renamed that version's CHANGELOG section to the next number, so the published section lost its heading. Now a published section keeps it: the new version takes the Unreleased section, or a new section that the changes/ fragments fill. With neither (or an empty Unreleased section), the release stops. - Fragments are collected with `cli-dev changelog fragments --collect` and the version is raised with `cli-dev changelog level`, as in the CLIs. - A version npm has starts from its next patch; the entries decide the level, so 1.0.0 plus a fix is 1.0.1, not 2.0.0. - A published pre-release with fragments stops: raise the version first. - package.json and the CHANGELOG are both checked before either is written, and a refusal restores the tree. - --major is checked before any version lands on main. - Fragments merged while the release pull request waited are collected by a second run. - scripts/release.test.ts runs bin/release against a local origin with fake npm and gh. Fixes #706 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour
added a commit
that referenced
this pull request
Nov 25, 2026
…after a published version (#719) ## Task Fixes #714. The shared Start release workflow failed when npm already had the version in `package.json` and every entry was in `changes/` fragments (no `## Unreleased` to rename). It also asked for a major after a published `x.0.0`. #713 fixed both in `bin/release`; this brings the workflow in line. ## What - `.github/workflows/release-start.yml`, step "settle the version", now follows `bin/release`: - 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. `cli-dev changelog level --next` raises it only when the entries need more (1.0.0 + fix → 1.0.1, + Added → 1.1.0). - No fragment and a missing or empty Unreleased section → the run stops before any file changes. - `package.json`, `src/version.ts` and `CHANGELOG.md` are all checked before any is written. - npm is asked once whether the version is published. `after-raise` runs once, with the version that ships. - The fragment and level logic stays in the existing cli-dev commands (`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 for `changelog level`; this is stated in the input and in `docs/dev/release-workflow.md`. Callers pin the workflow by SHA, so nothing changes for them until they bump. - Fragment `changes/fix-release-start-fragments.md`. ## Testing - New `scripts/release-start.test.ts` takes the step's script from the YAML and runs it against a local git origin with a fake `npm`. It covers 8 cases: fragments only, a 1.0.0 patch, a 1.0.0 minor, a custom title with `src/version.ts` and the hook, an empty Unreleased section, nothing unreleased, and a major with and without `major`. Against the old workflow, 6 of 7 cases failed (the 8th was added later). - `scripts/release.test.ts` passes, as do `pnpm lint`, `pnpm typecheck` and `pnpm docs:check`. - A fresh-agent review found one compatibility risk (the cli-dev minimum is now documented) and nits. Fixed: npm asked twice, the hook ran twice, fragment wording, test gaps. Left as is: a changelog with no line above its first `## ` heading fails before writing anything, the same as `bin/release`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- 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.
Fixes #706
Why
When npm already had the version in
package.json,bin/releaserenamed that version's CHANGELOG section to the next number. The published section lost its heading, andchanges/fragments were not collected at all.What
## Unreleased, or a new section the fragments fill. With neither (or an empty Unreleased), the release stops.cli-dev changelog fragments --collect, andcli-dev changelog levelraises the version when they need more (an Added is a minor), as in the CLIs.package.jsonand the CHANGELOG are both checked before either is written; a refusal restores the tree.--majoris checked before anything lands. Fragments merged while the release PR waited are collected by a second run.RELEASING.mddrops the manual version PR and explains the numbering;CONVENTIONS.mdandCLAUDE.mdmention fragments.Testing
scripts/release.test.tsrunsbin/releaseagainst a local git origin with fakenpmandgh: 7 of 7 pass. On the oldbin/release, the earlier tests fail.pnpm typecheck,pnpm docs:checkpass.pnpm lint: 0 errors; the 21 warnings are in files this PR does not touch.Not covered here: the shared
release-start.ymlstill fails when only fragments exist on a published version (separate issue).🤖 Generated with Claude Code