fix(release): stop shipping an empty changelog on the tag-push route - #49
Merged
Conversation
v0.3.1's release notes went out with no entries at all and a self-referential
`compare/v0.3.1...v0.3.1` link.
`--unreleased` means "commits belonging to no tag". On the tag-push route the
tag already points at HEAD when the workflow runs, so nothing is unreleased and
git-cliff renders an empty body. v0.3.0 escaped this only because it came
through workflow_dispatch. Resolve an explicit <prev>..<tag> range instead, and
keep --unreleased solely for the case where the tag does not exist yet.
The compare link was broken independently: cliff.toml emitted
`{{ previous.version }}...{{ version }}` verbatim, but the two callers disagree
on the `v` prefix — release-plz passes `0.3.2`, release.yml passes `v0.3.2`
(which is why the heading already trims it). Tags carry the `v`, so the
release-plz half produced 404s. Normalise both sides, then re-add the `v`.
Also warn when the generated changelog has no entries: v0.3.1 shipped one and
nothing anywhere said so.
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.
v0.3.1's published release notes have no changelog entries at all, and a self-referential compare link:
Two independent bugs
1.
--unreleasedis wrong for the tag-push route. It means "commits belonging to no tag". Onpush: tags:the tag already points at HEAD when the job runs, so nothing qualifies and the body renders empty. v0.3.0 escaped only because it came throughworkflow_dispatch(release-plz tags first, then dispatches). Fixed by resolving an explicit<prev>..<tag>range, keeping--unreleasedsolely for when the tag does not exist yet.2. The compare link 404s from the release-plz side.
cliff.tomlemitted{{ previous.version }}...{{ version }}verbatim, but the two callers disagree on thevprefix — release-plz passes0.3.2,release.ymlpassesv0.3.2(which is exactly why the heading already has atrim_start_matches). Tags carry thev. Normalised both sides.Verification
Reproduced the CI condition exactly, in a worktree detached at
v0.3.1(so HEAD == tag, as in the failing run):## What's in 0.3.1+compare/v0.3.1...v0.3.1, zero entriescompare/v0.3.0...v0.3.1Both caller contexts render the prefix correctly now:
--tag 0.3.2) →compare/v0.3.1...v0.3.2v0.3.0..v0.3.1) →compare/v0.3.0...v0.3.1And the links resolve:
v0.3.0...v0.3.1→ 200, the old0.3.0...0.3.1→ 404.Run with real
git-cliffagainst this repo's actual history, not a fixture.Not covered here
The already-published v0.3.1 notes stay wrong until someone regenerates them — that is a separate, outward-facing edit I have not made.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.