feat(release)!: one version from the git tag, semver bumps from PR titles, generated release notes - #430
Merged
Conversation
…les, generated release notes Before this there were six version-like numbers and only the GitHub release tag ever moved: pyproject said 0.3.0, srtctl.__version__ said 0.3.0, the Cargo workspace said 0.1.0, release assets carried no version, and the lockfile recorded a commit but no version. The bump size came from a `new-feature` label nobody set, so the 2.0 schema shipped as v1.0.103. The git tag is now the single source of truth: - Python: hatch-vcs derives the package version from the tag (`dynamic = ["version"]`, post-release scheme, `0.0.0+unknown` without git metadata). `srtctl.__version__` reads it back; `srtctl --version` prints version, commit, and the recipe-schema and lockfile versions it speaks. - Rust: tachometer-scraper and cpu-power-exporter report the release tag from --version; the release build passes it as SRTCTL_RELEASE_VERSION (Dockerfile ARG). Cargo baseline moves 0.1.0 -> 1.1.0. - Run artifacts: recipe.lock.yaml and resource_snapshot.json carry srtctl_version next to srtctl_commit. - release.yaml: the bump comes from the merged PR's conventional-commit title (`<type>!:`/BREAKING CHANGE -> major, feat -> minor, else patch; .github/scripts/next_version.sh); the tag is created on the merge commit before anything builds, so wheel, binaries, and release agree; the release job asserts `srtctl --version` matches the tag; notes are generated by git-cliff (cliff.toml) grouped Breaking / Features / Bug fixes / ... with a compare link, prefixed by the version line. - pr-title.yaml enforces conventional-commit titles on every PR. - CI checkouts use fetch-depth 0 so hatch-vcs sees tags. - CONTRIBUTING.md documents the scheme. Tests: tests/test_versioning.py covers the version module, --version, the lockfile stamp, the bump script (seed/patch/minor/major, .post and -rc tags), and the title check. Full suite 2393 passed; cargo check and cargo fmt clean; a no-git install verified to report 0.0.0+unknown; git-cliff rendered locally against v1.0.101..HEAD.
ishandhanani
marked this pull request as ready for review
September 13, 2026 22:11
ishandhanani
requested review from
alec-flowers,
csahithi and
nlevin-ui
as code owners
September 13, 2026 22:11
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
Six version-like numbers, one of which moved.
pyproject.tomlandsrtctl.__version__said0.3.0, the Cargo workspace0.1.0, release assets carried no version,recipe.lock.yamlrecorded a commit but no version, and the release bump depended on anew-featurelabel nobody set (the 2.0 stack shipped asv1.0.103).What
The git tag is the single source of truth; everything else is derived.
0.3.0srtctl --versionprints version, commit, schema and lockfile versions0.1.0--version(SRTCTL_RELEASE_VERSIONbuild arg); baseline2.0.0srtctl_commitsrtctl_versionnew-featurelabel<type>!:orBREAKING CHANGE:= major,feat:= minor, else patchpr-title.yaml(amannn/action-semantic-pull-request) enforces conventional commitsUser-facing impact
None for running srtctl. Installs pull one extra small build dependency (
hatch-vcs). A tree without git metadata installs and reports0.0.0+unknown(verified). Contributors must use conventional-commit PR titles.Validation
tests/test_versioning.pycovers the version module,--version, the lockfile stamp, and the bump script (seed / patch / minor / major,.postand-rctags).cargo check --workspace --lockedandcargo fmt --checkclean;SRTCTL_RELEASE_VERSION=9.9.9 cargo run -- --versionprints9.9.9.uv sync --no-devfrom agit archivetree:srtctl 0.0.0+unknown; recipe schema 1, 2; lockfile v2.git cliff v1.0.101..HEADrenders the expected grouping locally.On merge
The title carries
!, so the workflow cutsv2.0.0from the merge commit: the package, the binaries, the lockfile stamp and the release all read 2.0.0, matching the 2.0 recipe schema that landed in #407. This is the first run of the new release workflow; the release job fails loudly ifsrtctl --versionon the tagged checkout disagrees with the tag.Follow-up to #407.