Skip to main content

Release pipeline

Maintainer workflow for releasing a2c-pre-commit-hooks. This repository is consumed via Git URL + tag in .pre-commit-config.yaml — there is no PyPI or package-registry publish step.

Aligned with superbuild-workflow where practical: curated changelog, bump_release.py, and tag verification in CI.

Prerequisites

  • Protected refs (GitLab → Settings → Repository):
    • Branches: master, develop
    • Tags: v* (optional but recommended for release hygiene)

Changelog policy

CHANGELOG.md follows Keep a Changelog.

  • Maintain ## [Unreleased] on develop as hooks and tooling land.
  • At release, python scripts/bump_release.py:
    • sets src/a2c_pre_commit_hooks/__init__.py __version__
    • moves unreleased notes into ## [X.Y.Z] - YYYY-MM-DD
    • updates footer compare/tag links
    • creates chore(release): Bump version to X.Y.Z commit

Release steps

  1. Land changes on develop; keep CHANGELOG.md curated.
  2. Wait for green CI on develop (pre-commit, unit).
  3. Run python scripts/bump_release.py (add --tag to create the annotated tag locally).
  4. Push develop, ff-merge to master and wait for green CI on master.
  5. Tag and push from master: git push origin vX.Y.Z

Branch pipeline jobs

JobWhenPurpose
pre-commitMR, develop, masterRun .pre-commit-config.yaml (git installed when missing)
unitMR, develop, masterpytest + coverage

Tag pushes do not re-run branch jobs — validation already happened on master before tagging.

Tag pipeline jobs

JobWhenPurpose
release:verifytag vX.Y.ZTag matches __version__; editable install; check-changelog --help

Failed tag pipeline (e.g. v0.1.0)

A tag pipeline uses the .gitlab-ci.yml at the tagged commit, not the current branch tip. If v0.1.0 failed, it was tagged at 470c586 before CI fixes landed; the old ruff job failed and release:verify never ran.

Fix going forward: branch jobs are skipped on tags; only release:verify runs.

Fix an already-pushed tag:

  1. Ensure master is green with the fixed CI.

  2. Either release v0.1.1 (recommended — run bump_release.py and push the new tag), or move v0.1.0 to the current master tip if you intentionally keep version 0.1.0:

    git checkout master
    git pull origin master
    git tag -d v0.1.0
    git tag -a v0.1.0 -m "Release 0.1.0"
    git push origin :refs/tags/v0.1.0
    git push origin v0.1.0

    Moving a published tag rewrites history for consumers who pinned rev: v0.1.0; prefer a patch release when possible.

Version source of truth

  • src/a2c_pre_commit_hooks/__init__.py__version__
  • Git tag vX.Y.Z must match __version__ (enforced by release:verify)

Local dry-run

pip install -e ".[dev]"
python scripts/bump_release.py --dry-run
python scripts/verify_release_version.py v0.1.0
check-changelog --help

Consuming repos after release

Tell consumers to bump rev in .pre-commit-config.yaml to the new tag:

rev: v0.2.0

Pre-commit installs this repository from Git at that ref; no pip index is involved. Consumers may need pre-commit clean after major hook upgrades.