Skip to content

fix(release): take the previous version from tags that exist - #658

Merged
jjjermiah merged 1 commit into
mainfrom
fix-release-prev
Nov 11, 2026
Merged

jjjermiah merged 1 commit into
mainfrom
fix-release-prev

Conversation

@jjjermiah

@jjjermiah jjjermiah commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Closes #657. Evidence is in the commit body.

Summary by CodeRabbit

  • Chores
    • Release note generation now skips changelog versions without matching tags and selects the first eligible tagged version as the previous release.
    • If the changelog’s linked previous version has no tag, release processing falls back to the newest valid earlier version tag.
    • Releases are rejected if no previous version can be identified or if the release version does not exceed it.

release.ts read the previous version from the CHANGELOG [Unreleased] compare link, and
release-notes.ts from the next heading down. A release that failed after its commit reached main
(0.65.0 CI, 0.65.1 Publish) left a heading and link for a tag that never existed. The next
release then failed on git log v0.65.0..HEAD, and Publish failed with "tag v0.65.0 is not in this
clone". Recovery needed a hand-edited link (#653) and an extra patch release (0.65.2).

release.ts now uses the linked version only when its tag exists, else the newest v* tag below the
new version. release-notes.ts walks the headings below the section to the first with a tag.
Rejected: a CHANGELOG-only fix, which leaves the next failed release to break the same way.

Validation: release-notes.ts 0.65.1 now gives "Full diff v0.64.0...v0.65.1" (it exited 1 before).
release.ts --dry-run with the link set to nonexistent v0.65.9 resolves the previous version to
0.65.2. bun run typecheck passes.

Closes #657
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The release scripts now skip changelog version headings without matching tags. If the changelog-linked previous version has no tag, release.ts selects the newest valid semver tag below the release version or reports an error if none exists.

Changes: Release tag resolution

Layer / File(s) Summary
Select an existing previous version
.github/scripts/release-notes.ts, .github/scripts/release.ts
release-notes.ts scans later changelog headings for the first version with an existing tag. release.ts checks the linked tag and falls back to the newest valid semver tag below the release version. It fails if no fallback tag exists.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Merge Risk: Low · up to 7b066

The release scripts now pick a previous version from tags that exist, which addresses the reported release failure. Before merging, the author should still add the pre-tag release-notes dry run and the missing-tag regression test requested in #657, and make the tag check namespace-safe. These gaps limit recurrence protection but are unlikely to cause a broken release on their own.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jjjermiah
jjjermiah merged commit 21309e9 into main Nov 11, 2026
12 checks passed
@jjjermiah
jjjermiah deleted the fix-release-prev branch November 11, 2026 15:27
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: an unpublished version in CHANGELOG breaks the next release and the Publish notes step

1 participant