feat: make the release tag and release name formats configurable - #24
Merged
Merged
Conversation
philasmar
force-pushed
the
asmarp/configurable-tag-format
branch
from
September 2, 2026 20:31
6b7dd00 to
7acc30c
Compare
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.
Why
AutoVer tags a release by date (
release_2026-09-02). That works when the tag isjust a marker, but it can't tell a consumer whether adopting a release will break
them. A repository whose releases are consumed by reference - a shared CI
templates repo pinned as
ref: v1.4.0, for instance - needs the tag itself tocarry the version.
This makes the tag and release name formats configurable, so a release can be
identified by version instead of only by date.
What
{ "TagFormat": "v{major}.{minor}.{patch}[-{prerelease}]" }Placeholders for the version components, prerelease label, date parts and
iteration, with
[...]optional groups that render only when what's inside themhas a value - which is how one format covers both
v1.4.0andv1.4.0-beta.1,or both
release_2026-09-02andrelease_2026-09-02_2.ReleaseNameFormatis optional and followsTagFormat's family, so setting onlyTagFormatis enough.Defaults are unchanged. A repository that sets neither option keeps tagging
and naming releases exactly as before.
A tag is read back, not just written
AutoVer uses tag history to work out which release was most recent, and from that
the commit range a changelog covers. So a format has to be invertible, and the
rules enforce that when the configuration is read rather than part-way through a
release:
disagree on a backport)
actually rendering a probe and parsing it, rather than by enumerating the ways a
format can be ambiguous
project file is written, since the release commit is created before the tag
Fixes found along the way
ordinal string compare put
beta.10belowbeta.2, and1.4.0below1.4.0-beta.1. This backedGetNextMaxVersion, so it could pick the wrong"highest" version.
1.0.0-alpha-1was dropped entirelywhen parsing, because the split required exactly two parts. A version-based tag
renders from that parse, so the label would have been lost from the tag name.
release_2026-09-02instead of
Release 2026-09-02) on the first release of a new date. Only theno-prior-tags and same-date paths had coverage, so this had gone unnoticed.
rather than the highest-ordering one. These differ after a backport, and
autover changelogcommits the CHANGELOG itself - moving HEAD off the taggedcommit before the name and tag are read back for the release.
Docs
The README is reworked for GA: the "not ready for use beyond experimentation"
notice is gone, and it gains an install section, a getting-started walkthrough, a
commands reference, a configuration reference, and Dockerfile support (previously
undocumented). Also documents migrating an existing repository, including the two
things that bite: commit the
autover.jsonchange before releasing (changelogloads config as of the release tag), and bridge the range boundary if you use a
commits-based changelog.
Testing
189unit and82integration tests pass. New coverage includes the releasebranch/merge-commit topology, the Dockerfile path, format migration in both
changelog modes, and failure cases asserting nothing is committed and no file is
modified when a format is rejected.