From 283c0e10eadeeb27f9babfd96d682581187bbebe Mon Sep 17 00:00:00 2001 From: Mike Odnis Date: Mon, 21 Sep 2026 15:40:50 -0400 Subject: [PATCH] fix(changelog): point version links at the per-crate tags that exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every version heading in every generated CHANGELOG.md linked to /releases/tag/ — e.g. /releases/tag/0.4.2. No such tag exists, and none ever has: all 191 tags in this repo are per-crate prefixed (resq-cli-v0.4.2, resq-tui-v0.1.13, ...), because release-plz tags multi-package workspaces with its default git_tag_name template, `{{ package }}-v{{ version }}`, and this repo does not override it. So every link in every per-crate changelog was dead. release-plz always injects `package` (the cargo package name) into the git-cliff template context — unconditionally, via add_package_context in its single changelog construction path — so the heading can reproduce the real tag as `{{ package }}-v{{ version }}`. Verified against release-plz's documented changelog context and against the pinned release-plz 0.3.168 source, not assumed. Dropped the no-op `trim_start_matches(pat="v")` on the display text at the same time: release-plz passes `version` as a bare semver, so the filter never matched anything, and leaving it would have had the two halves of the line disagree about whether `version` carries a `v`. `tag_pattern` is inert here — release-plz builds the release itself and calls git-cliff's changelog API, which never reads it; only the git-cliff CLI's repo scan does. Corrected rather than removed so it describes the tag scheme in use, with a comment recording that it has no effect on what this repo ships. The existing CHANGELOG.md files are left alone; release-plz rewrites each heading as it cuts the next release for that crate. --- cliff.toml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cliff.toml b/cliff.toml index 218652b..d0b63c4 100644 --- a/cliff.toml +++ b/cliff.toml @@ -26,7 +26,7 @@ body = """ {%- endmacro -%} {% if version -%} - ## [{{ version | trim_start_matches(pat="v") }}]({{ self::remote_url() }}/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} + ## [{{ version }}]({{ self::remote_url() }}/releases/tag/{{ package }}-v{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} {% else -%} ## [Unreleased] {% endif -%} @@ -48,7 +48,12 @@ filter_unconventional = true split_commits = false protect_breaking_commits = true filter_commits = true -tag_pattern = "v[0-9].*" +# Inert under release-plz: it builds the release itself and calls git-cliff's +# changelog API, which never reads `tag_pattern` — only the git-cliff CLI's +# repo scan does. Corrected anyway so it describes the scheme release-plz +# actually tags with (`-v`, per its default `git_tag_name`) +# rather than a bare-`v` scheme this repo has never used. +tag_pattern = "^[a-z0-9-]+-v[0-9].*" topo_order = false sort_commits = "newest"