Skip to content

fix(release): release-start.yml agrees with bin/release on fragments after a published version - #719

Merged
leemour merged 2 commits into
mainfrom
fix/release-start-fragments
Nov 25, 2026
Merged

leemour merged 2 commits into
mainfrom
fix/release-start-fragments

Conversation

@leemour

@leemour leemour commented Nov 25, 2026

Copy link
Copy Markdown
Member

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

leemour and others added 2 commits November 25, 2026 02:14
…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>
@leemour
leemour merged commit 0ceb369 into main Nov 25, 2026
10 checks passed
@leemour
leemour deleted the fix/release-start-fragments branch November 25, 2026 01:28
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-start.yml fails when only changes/ fragments exist on a published version

1 participant