Skip to content

feat(release)!: one version from the git tag, semver bumps from PR titles, generated release notes - #430

Merged
ishandhanani merged 4 commits into
mainfrom
idhanani/unify-versioning
Sep 13, 2026
Merged

ishandhanani merged 4 commits into
mainfrom
idhanani/unify-versioning

Conversation

@ishandhanani

@ishandhanani ishandhanani commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Why

Six version-like numbers, one of which moved. pyproject.toml and srtctl.__version__ said 0.3.0, the Cargo workspace 0.1.0, release assets carried no version, recipe.lock.yaml recorded a commit but no version, and the release bump depended on a new-feature label nobody set (the 2.0 stack shipped as v1.0.103).

What

The git tag is the single source of truth; everything else is derived.

Surface Before After
Python package hand-edited 0.3.0 hatch-vcs from the tag; srtctl --version prints version, commit, schema and lockfile versions
Rust binaries 0.1.0 report the tag from --version (SRTCTL_RELEASE_VERSION build arg); baseline 2.0.0
Lockfile / resource snapshot srtctl_commit plus srtctl_version
Bump rule new-feature label conventional-commit PR title: <type>!: or BREAKING CHANGE: = major, feat: = minor, else patch
Tag timing after the build before the build, so wheel, binaries and release agree; the release job asserts they do
Release notes GitHub's flat list git-cliff, grouped Breaking / Features / Bug fixes / Docs / ..., compare link, version header
PR titles free-form pr-title.yaml (amannn/action-semantic-pull-request) enforces conventional commits

User-facing impact

None for running srtctl. Installs pull one extra small build dependency (hatch-vcs). A tree without git metadata installs and reports 0.0.0+unknown (verified). Contributors must use conventional-commit PR titles.

Validation

  • Full suite green in CI; new tests/test_versioning.py covers the version module, --version, the lockfile stamp, and the bump script (seed / patch / minor / major, .post and -rc tags).
  • cargo check --workspace --locked and cargo fmt --check clean; SRTCTL_RELEASE_VERSION=9.9.9 cargo run -- --version prints 9.9.9.
  • uv sync --no-dev from a git archive tree: srtctl 0.0.0+unknown; recipe schema 1, 2; lockfile v2.
  • git cliff v1.0.101..HEAD renders the expected grouping locally.

On merge

The title carries !, so the workflow cuts v2.0.0 from 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 if srtctl --version on the tagged checkout disagrees with the tag.

Follow-up to #407.

…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 ishandhanani changed the title feat(release): one version from the git tag, semver bumps from PR titles, generated release notes feat(release)!: one version from the git tag, semver bumps from PR titles, generated release notes Sep 13, 2026
@ishandhanani
ishandhanani marked this pull request as ready for review September 13, 2026 22:11
@ishandhanani
ishandhanani merged commit cafff03 into main Sep 13, 2026
11 checks passed
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