Skip to content

feat(ci): automated semantic release and versioned Docker tags#144

Merged
k-chrispens merged 3 commits into
mainfrom
kmc/semantic-release
Mar 20, 2026
Merged

feat(ci): automated semantic release and versioned Docker tags#144
k-chrispens merged 3 commits into
mainfrom
kmc/semantic-release

Conversation

@k-chrispens
Copy link
Copy Markdown
Collaborator

@k-chrispens k-chrispens commented Mar 9, 2026

SHOULD ONLY MERGE AFTER #143

Adds python-semantic-release (v10) to automate version bumps, changelog generation, GitHub releases, and versioned Docker image tags. Includes commitizen pre-commit hook for commit message validation and developer documentation for the release process.

Summary by CodeRabbit

  • Documentation

    • Added detailed Release Process and Commit Message (Conventional Commits) guidance.
    • Updated README with commit-hook install instructions and release guidance.
    • Introduced a CHANGELOG placeholder for future release notes.
  • Chores

    • Added an automated Release workflow to compute and publish releases on main.
    • Enhanced CI to publish Docker images on semantic tags with dynamic tags/labels and updated action versions.
    • Integrated commit-msg validation (commitizen) and semantic-release configuration.

@k-chrispens k-chrispens requested review from Copilot and marcuscollins and removed request for Copilot March 9, 2026 21:39
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

Adds automated semantic releases with python-semantic-release, a new GitHub Actions “Release” workflow, commit-msg validation via commitizen, Docker workflow metadata-driven tagging and action upgrades, plus supporting docs/config and a changelog placeholder.

Changes

Cohort / File(s) Summary
Release workflow & config
.github/workflows/release.yml, pyproject.toml, CHANGELOG.md
Adds a Release GitHub Actions workflow that runs python-semantic-release on pushes to main; configures semantic-release in pyproject.toml; adds CHANGELOG.md placeholder.
Docker CI update
.github/workflows/docker.yml
Tightens push path filters, adds push.tags: ['v*.*.*'], upgrades several GitHub Action versions, and integrates docker/metadata-action to generate dynamic image tags/labels used by build-push.
Pre-commit & commit validation
.pre-commit-config.yaml, README.md
Adds commitizen commit-msg hook to pre-commit config and documents Conventional Commits + hook installation in README.
Documentation
AGENTS.md, README.md
Adds a detailed “Release Process” section describing Conventional Commits, release flow, local validation, and PR merge guidance; updates README commit-message guidance.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant Repo as GitHub Repo
  participant Actions as GitHub Actions
  participant PSR as python-semantic-release
  participant VCS as GitHub Releases
  participant DockerWF as Docker Workflow
  participant Registry as Docker Registry

  Dev->>Repo: push to `main` (releasable commits) or push tag `vX.Y.Z`
  Repo->>Actions: trigger `Release` workflow
  Actions->>PSR: run analysis, update version, update CHANGELOG, create tag/commit
  PSR->>VCS: create GitHub Release (if produced)
  Repo->>DockerWF: push tag `v*.*.*` triggers Docker workflow
  DockerWF->>Registry: build & push images using `docker/metadata-action` tags/labels
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • marcuscollins

Poem

🐰
I hopped through commits with a tidy chore,
Tagged the versions, nudged the changelog door,
Hooks set in place, builds hum through the night—
Release bells ringing, versions take flight! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: introducing automated semantic release versioning and dynamic Docker image tagging through updated CI workflows and configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kmc/semantic-release
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 18-22: The checkout step currently creates a shallow clone
(actions/checkout@v6) so tags and full history are missing; update the checkout
action to fetch full history and tags by adding with: fetch-depth: 0 and
fetch-tags: true (keep or remove the subsequent git reset --hard ${{ github.sha
}} as desired), ensuring the pipeline provides the complete commit history and
tags required by python-semantic-release to compute versions and changelogs.

In @.pre-commit-config.yaml:
- Around line 23-27: Add a top-level default_install_hook_types key to
.pre-commit-config.yaml that includes both pre-commit and commit-msg so the
commitizen hook (repo https://github.com/commitizen-tools/commitizen, id:
commitizen) is installed when contributors run pre-commit install; update the
YAML to set default_install_hook_types: [pre-commit, commit-msg] ensuring the
commit-msg hook is installed alongside pre-commit hooks.

In `@AGENTS.md`:
- Around line 225-231: The fenced code block in AGENTS.md (the snippet starting
with backticks showing the commit message template) is missing a language tag;
add a fence language (e.g., change the opening triple backticks to "```text") so
markdownlint warnings stop and the block is properly highlighted.

In `@README.md`:
- Around line 33-35: The fenced code block shown as ``` should include a
language identifier to satisfy markdownlint MD040; update the opening fence from
``` to ```text so the block is explicitly marked as text (i.e., change the code
fence around the snippet `<type>(<scope>): <summary>` to use the language
`text`).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37d72f25-fd83-45ec-933e-5c5366f25da1

📥 Commits

Reviewing files that changed from the base of the PR and between 982d643 and 3f8d182.

📒 Files selected for processing (7)
  • .github/workflows/docker.yml
  • .github/workflows/release.yml
  • .pre-commit-config.yaml
  • AGENTS.md
  • CHANGELOG.md
  • README.md
  • pyproject.toml

Comment thread .github/workflows/release.yml
Comment thread .pre-commit-config.yaml
Comment thread AGENTS.md
Comment thread README.md
@k-chrispens k-chrispens linked an issue Mar 10, 2026 that may be closed by this pull request
paths:
- 'pyproject.toml'
- 'pixi.lock'
- 'src/**'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances should we rebuild the container? Maybe talk to Michael about this? I don't have strong opinions, but it isn't cost free to rebuild.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rebuild on release, which is what this sets up, but we could also build more frequently? Previously we were rebuilding every time one of these files were changed, which will get a bit excessive potentially especially a bit later on.

images: ${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix doesn't seem to have an associated value, should it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously there was no prefix to the sha256 value in the image, but the new metadata action version by default includes "sha" as the prefix so that's why I set to empty here

push:
branches: [main]
paths:
- 'pyproject.toml'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment on this file: have to tested that it works?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good question for Michael too. The only way to test it really is to push to main I think, though I can also look into ways that it might be simulated?

Comment thread .github/workflows/release.yml
Comment thread AGENTS.md

### Conventional Commits (Required)

All commit messages **must** follow the [Conventional Commits](https://www.conventionalcommits.org/) format:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should start squashing commits and generating a good single commit message for each PR (and reject PRs that try to do too much at once)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will change the merge requirements on the repo

@marcuscollins marcuscollins self-requested a review March 13, 2026 23:52
k-chrispens and others added 2 commits March 18, 2026 07:36
Adds python-semantic-release (v10) to automate version bumps, changelog
generation, GitHub releases, and versioned Docker image tags. Includes
commitizen pre-commit hook for commit message validation and developer
documentation for the release process.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces automated versioning/releases via python-semantic-release and updates CI to publish Docker images with semver-based tags, alongside developer docs and commit message enforcement.

Changes:

  • Add python-semantic-release configuration and a GitHub Actions “Release” workflow to automate version bumps, changelog updates, tags, and GitHub releases.
  • Update Docker workflow to publish latest/SHA/semver-tagged images (including tag-triggered builds).
  • Add Conventional Commits documentation + commitizen commit-msg hook, and introduce a CHANGELOG.md placeholder.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pyproject.toml Adds python-semantic-release to dev deps and configures semantic-release behavior.
pixi.lock Locks new transitive dependencies pulled in by semantic-release (and related resolution changes).
README.md Documents commit-msg hook installation and Conventional Commits expectations.
CHANGELOG.md Adds a placeholder file for semantic-release changelog updates.
AGENTS.md Documents the automated release process and commit message requirements.
.pre-commit-config.yaml Adds commitizen hook for commit message validation at commit-msg stage.
.github/workflows/release.yml Adds an automated semantic release workflow on main pushes.
.github/workflows/docker.yml Updates Docker build/publish to use metadata-action tags and trigger on semver tags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread AGENTS.md Outdated
Comment thread .github/workflows/release.yml
Comment on lines 9 to +16
push:
branches: [main]
paths:
- 'pyproject.toml'
- 'pixi.lock'
- 'src/**'
- 'scripts/**'
- 'Dockerfile'
- 'docker-entrypoint.sh'
- '.github/workflows/docker.yml'
tags:
- 'v*.*.*'
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this workflow runs on both pushes to main and v*.*.* tag pushes, any Dockerfile-only change merged to main will publish new images as well (even if no release tag is created). If the intent is “publish only on releases”, consider removing the branches: [main] trigger and relying solely on tag pushes.

Copilot uses AI. Check for mistakes.
with:
images: ${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metadata config always emits a latest tag. If this workflow also runs on main pushes, those branch builds can overwrite latest even when no release tag is produced. Consider emitting latest only for semver tag builds, and using a separate tag (e.g. main/edge) for branch builds.

Suggested change
type=raw,value=latest
type=raw,value=latest,enable={{is_tag && matches(tag, '^v[0-9]+\\.[0-9]+\\.[0-9]+$')}}
type=raw,value=edge,enable={{is_default_branch}}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 275-278: The README/AGENTS.md fragment incorrectly references the
`pre-commit` tool; update the command to use the project's `prek` tool and the
project's pixi invocation pattern (e.g., the existing example uses `pixi run -e
<env> prek ...`), so replace the line `pixi run pre-commit install --hook-type
commit-msg` with the equivalent `pixi run -e [model]-dev prek install
--hook-type commit-msg` (or the appropriate env name used elsewhere in
AGENTS.md) so the documented pre-commit hook installation uses `prek`
consistently with the rest of the docs.

In `@README.md`:
- Around line 181-183: The fenced code block containing the commit message
template "<type>(<scope>): <summary>" in README.md lacks a language identifier
and triggers markdownlint MD040; update that fenced block to include the
language specifier "text" (i.e., change the opening fence from ``` to ```text)
so the snippet is treated as plain text rather than code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7231145b-bfe2-4a7c-9b7b-9831c2d0482f

📥 Commits

Reviewing files that changed from the base of the PR and between 3f8d182 and 0c4e9c8.

⛔ Files ignored due to path filters (1)
  • pixi.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • .github/workflows/docker.yml
  • .github/workflows/release.yml
  • .pre-commit-config.yaml
  • AGENTS.md
  • CHANGELOG.md
  • README.md
  • pyproject.toml
✅ Files skipped from review due to trivial changes (3)
  • CHANGELOG.md
  • pyproject.toml
  • .pre-commit-config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/docker.yml

Comment thread AGENTS.md
Comment thread README.md
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
AGENTS.md (1)

244-250: ⚠️ Potential issue | 🟡 Minor

Add a language identifier to the fenced code block.

The fenced code block showing the commit message template is missing a language identifier. Add text after the opening triple backticks to satisfy markdownlint and improve syntax highlighting.

📝 Proposed fix
-```
+```text
 <type>(<optional scope>): <summary>
 
 [optional body]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 244 - 250, The fenced code block that shows the
commit message template is missing a language identifier; update the opening
triple-backtick for the commit message template (the block containing
"<type>(<optional scope>): <summary>") to include the language identifier "text"
(i.e., change ``` to ```text) so markdownlint passes and syntax highlighting is
applied.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@AGENTS.md`:
- Around line 244-250: The fenced code block that shows the commit message
template is missing a language identifier; update the opening triple-backtick
for the commit message template (the block containing "<type>(<optional scope>):
<summary>") to include the language identifier "text" (i.e., change ``` to
```text) so markdownlint passes and syntax highlighting is applied.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eda78260-c251-40ec-858b-7004eb14907e

📥 Commits

Reviewing files that changed from the base of the PR and between 0c4e9c8 and cf07c3a.

📒 Files selected for processing (1)
  • AGENTS.md

@k-chrispens k-chrispens merged commit b1594a8 into main Mar 20, 2026
4 checks passed
@k-chrispens k-chrispens deleted the kmc/semantic-release branch March 20, 2026 23:59
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.

Add semantic versioning and associated release bot

3 participants