← worklog

2026-11-20

Adding a proper release pipeline to a shared Kubernetes platform repo

GitOpsFluxCDGitLab CICommitizenPlatform Engineering

Context

The repo holds shared Flux manifests consumed by every EKS cluster in the platform. The pattern is deliberate: sandbox tracks main directly for fast iteration, while integration and production track semver tags for stability. The problem was that the tags side of that contract didn't actually exist — there was no process for cutting them, no changelog, and no guardrails on commit format.

What I built

Conventional commit enforcement on MRs. A commitlint CI job runs on every merge request (skips drafts and schedules) and validates all commits in the branch against the conventional commit spec. PRs with badly-shaped commits fail the pipeline before they can reach main.

Manual release job on main. A release stage job, triggered manually after a merge to main, does exactly three things:

  1. Runs cz bump — detects the highest bump type (patch/minor/major) from commit messages since the last tag, increments the version, and writes the CHANGELOG.
  2. Tags the commit with the new semver.
  3. Pushes both the tag and the updated pyproject.toml via a dedicated release bot token.

The bump commit itself carries [ci skip] so the push doesn't re-trigger the pipeline and loop.

Commitizen config in pyproject.toml. Keeps the version as the single source of truth — cz bump reads and writes it, and tag_format = "v$version" ties the git tag format to it.

Manual override when needed. The pipeline exposes a BUMP_TYPE variable (auto | patch | minor | major). auto is the default and handles almost every case; the override exists for the rare times commit messages don't tell the full story.

Result

Integration and production clusters now consume a stable, explicitly versioned surface. Teams can track what changed between the version they're running and the latest via the generated CHANGELOG, and the release step is a single manual button press in GitLab rather than a manual git dance. The commitlint gate means the changelog is always accurate because the commits feeding it are always structured.