Skip to content

fix: derive last release tag from semver tags only - #5

Merged
sks merged 1 commit into
mainfrom
fix-release-tag-discovery
Nov 12, 2026
Merged

sks merged 1 commit into
mainfrom
fix-release-tag-discovery

Conversation

@sks

@sks sks commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Problem

The Release workflow would have failed on the current main: git describe --tags --abbrev=0 returns the moving major tag v1 (both v1 and v0.2.0 sit on the same commit, and describe prefers v1), and classify-commits.py then crashes:

AttributeError: 'NoneType' object has no attribute 'group'   # bump_version regex on "v1"

Verified locally with cut-release.sh --dry-run against main (73e9e84) — crashes before the fix, derives v0.2.1 after.

Fix

  1. 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.
  2. classify-commits.py: bump_version now 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.0
  • Guard: CUT_LAST_TAG=v1 → error: CUT_LAST_TAG is not a semver tag: 'v1' (exit 1)
  • bash -n / ast.parse clean

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.
@sks
sks merged commit 4eae591 into main Nov 12, 2026
3 checks passed
@sks
sks deleted the fix-release-tag-discovery branch November 12, 2026 02:55
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.

1 participant