Repository navigation
fix: derive last release tag from semver tags only - #5
Merged
Merged
Conversation
git describe --tags --abbrev=0 can return the moving major tag (v1) instead of a semver tag — it did on main after v0.2.0, crashing the classifier with AttributeError and blocking the Release workflow. Query semver tags merged into the target instead, and fail loudly in classify-commits.py if a non-semver tag ever reaches bump_version.
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.
Problem
The Release workflow would have failed on the current main:
git describe --tags --abbrev=0returns the moving major tagv1(bothv1andv0.2.0sit on the same commit, and describe prefersv1), andclassify-commits.pythen crashes:Verified locally with
cut-release.sh --dry-runagainst main (73e9e84) — crashes before the fix, derives v0.2.1 after.Fix
cut-release.sh: last tag = highest semver tag merged into the target (git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --merged <sha> --sort=-v:refname | head -1) — moving major tags are ignored by construction.classify-commits.py:bump_versionnow exits with a clear error if a non-semver tag ever reaches it, instead of a bare traceback.Testing
GITHUB_REPOSITORY=... GITHUB_SHA=73e9e84 bash .github/scripts/cut-release.sh --dry-run→version: v0.2.1, since: v0.2.0CUT_LAST_TAG=v1→error: CUT_LAST_TAG is not a semver tag: 'v1'(exit 1)bash -n/ast.parseclean