feat(ci): automated semantic release and versioned Docker tags#144
Conversation
📝 WalkthroughWalkthroughAdds 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip You can get early access to new features in CodeRabbit.Enable the |
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
.github/workflows/docker.yml.github/workflows/release.yml.pre-commit-config.yamlAGENTS.mdCHANGELOG.mdREADME.mdpyproject.toml
| paths: | ||
| - 'pyproject.toml' | ||
| - 'pixi.lock' | ||
| - 'src/**' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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= |
There was a problem hiding this comment.
prefix doesn't seem to have an associated value, should it?
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
General comment on this file: have to tested that it works?
There was a problem hiding this comment.
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?
|
|
||
| ### Conventional Commits (Required) | ||
|
|
||
| All commit messages **must** follow the [Conventional Commits](https://www.conventionalcommits.org/) format: |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Yes, I will change the merge requirements on the repo
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.
3f8d182 to
0c4e9c8
Compare
There was a problem hiding this comment.
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.mdplaceholder.
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.
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'pyproject.toml' | ||
| - 'pixi.lock' | ||
| - 'src/**' | ||
| - 'scripts/**' | ||
| - 'Dockerfile' | ||
| - 'docker-entrypoint.sh' | ||
| - '.github/workflows/docker.yml' | ||
| tags: | ||
| - 'v*.*.*' |
There was a problem hiding this comment.
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.
| with: | ||
| images: ${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=raw,value=latest |
There was a problem hiding this comment.
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.
| 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}} |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
pixi.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
.github/workflows/docker.yml.github/workflows/release.yml.pre-commit-config.yamlAGENTS.mdCHANGELOG.mdREADME.mdpyproject.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
There was a problem hiding this comment.
♻️ Duplicate comments (1)
AGENTS.md (1)
244-250:⚠️ Potential issue | 🟡 MinorAdd a language identifier to the fenced code block.
The fenced code block showing the commit message template is missing a language identifier. Add
textafter 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.
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
Chores