Configure bumpver for Concourse release pipeline#3882
Configure bumpver for Concourse release pipeline#3882blarghmatey wants to merge 1 commit intomasterfrom
Conversation
|
@blarghmatey I've rebased your PR on the master branch and added a new commit replacing the old semantic version test that was failing, with a new test generated by AI. Let me know what you think of it. |
There was a problem hiding this comment.
Pull request overview
Adds project versioning configuration intended to support automated version bumps in the Concourse release pipeline, and updates the Django VERSION constant and tests to validate the new version format.
Changes:
- Switched the package version in
pyproject.toml(and correspondinguv.lockentry) to a CalVer-like format. - Added a version-bumping tool configuration block in
pyproject.tomlto updatepyproject.toml,mitxpro/settings.py, anduv.lock. - Updated settings tests to validate
settings.VERSIONagainst the configured version pattern and ensure it matchespyproject.toml.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
uv.lock |
Updates the locked local package version for mitxpro. |
pyproject.toml |
Sets the new project version and adds version-bump tool configuration. |
mitxpro/settings_test.py |
Replaces semver validation with checks against the configured version regex and pyproject.toml version. |
mitxpro/settings.py |
Updates the VERSION constant to the new version format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parse = "(?P<release>(?:[1-9][0-9]{3})\\.(?:1[0-2]|[1-9])\\.(?:3[0-1]|[12][0-9]|[1-9]))\\.(?P<build>\\d+)" | ||
| serialize = ["{release}.{build}"] | ||
|
|
||
| [tool.bumpversion.parts.release] | ||
| calver_format = "{YYYY}.{MM}.{DD}" | ||
|
|
There was a problem hiding this comment.
calver_format = "{YYYY}.{MM}.{DD}" implies zero-padded month/day (matching the YYYY.MM.DD.N example in the PR description), but the parse regex only matches non-zero-padded values (e.g., it won't match 2026.04.16.1). This mismatch can cause the version bump tool to fail parsing existing/new versions. Consider updating parse to accept leading zeros (or adjusting calver_format to emit non-padded values) and aligning project.version/settings.VERSION to the chosen canonical format.
| def test_bump_my_version_format(settings): | ||
| """ | ||
| Verify that we have a semantic compatible version. | ||
| Verify that VERSION matches the bump-my-version calver format. | ||
| """ | ||
| semantic_version.Version(settings.VERSION) | ||
| with open("pyproject.toml", "rb") as f: # noqa: PTH123 | ||
| pyproject = tomllib.load(f) | ||
|
|
||
| version_pattern = pyproject["tool"]["bumpversion"]["parse"] |
There was a problem hiding this comment.
The new test name/docstring says "bump-my-version" but the config key it reads is tool.bumpversion. For clarity (and to reduce future confusion when troubleshooting the release pipeline), consider renaming the test/docstring to match the actual tool/config section being used (or vice versa).
| from mitxpro.sentry import init_sentry | ||
|
|
||
| VERSION = "0.193.1" | ||
| VERSION = "2026.4.16.1" |
There was a problem hiding this comment.
VERSION is set to 2026.4.16.1, but the bump config/PR description suggests a YYYY.MM.DD.N scheme (example uses zero-padded month/day). To avoid inconsistent release_version values being exposed via the API/Sentry, please align this constant with the canonical format produced/parsed by the chosen version bump tool.
| VERSION = "2026.4.16.1" | |
| VERSION = "2026.04.16.1" |
| [project] | ||
| name = "mitxpro" | ||
| version = "0.1.0" | ||
| version = "2026.4.16.1" |
There was a problem hiding this comment.
project.version is set to 2026.4.16.1, but the new versioning scheme is described as YYYY.MM.DD.N (example uses zero-padded month/day) and the bump config uses {MM}/{DD}. Please pick a single canonical representation (padded vs non-padded) and keep project.version consistent with what the bump tool will generate/parse.
| [tool.bumpversion] | ||
| commit = false | ||
| tag = false | ||
| parse = "(?P<release>(?:[1-9][0-9]{3})\\.(?:1[0-2]|[1-9])\\.(?:3[0-1]|[12][0-9]|[1-9]))\\.(?P<build>\\d+)" |
There was a problem hiding this comment.
The PR description/test instructions reference bumpver (and [tool.bumpver] is what that tool reads), but the added configuration uses [tool.bumpversion] (bump2version/bump-my-version style). As-is, bumpver update will ignore this config. Please either switch the config section/key names to the tool you intend to use, or update the pipeline/docs to call the tool that reads [tool.bumpversion].
- Add bump-my-version configuration to pyproject.toml with CalVer format - Track version in pyproject.toml [project] section - Track version in uv.lock - Replace test_semantic_version with test_bump_my_version_format Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
71c5208 to
ebff10c
Compare
arslanashraf7
left a comment
There was a problem hiding this comment.
The commands bump-my-version show-bump and bump-my-version show current_version work fine, but some other commands, i.e., bump-my-version --increment patch show don't work, and I think that might be a problem? But I'll let you decide that, or maybe I'm running the wrong command.
|
@blarghmatey If you were planning on merging this PR, I would suggest merging it after #3899, because that is going to get into conflicts if we merge this one before. So, either your PR will have conflicts or the release PR, And I think Its better to address the conflicts in this PR rather than the release PR. |
|
Thanks for the heads up. This is still pending other work and will need to be merged after mitodl/ol-infrastructure#4506 which still needs some planning, so this can wait until after #3899 |
What are the relevant tickets?
N/A
Description (What does it do?)
Adds
[tool.bumpver]configuration topyproject.tomlso the Concourserelease pipeline can update the application version automatically on each
release.
The new version format is
YYYY.MM.DD.N(e.g.,2026.04.16.1), whichreplaces the previous semver-style version strings. This is required by the
Concourse
releaseresource workflow being rolled out inmitodl/ol-infrastructure#4506.
The
VERSIONconstant in Django settings is updated to the initial releaseformat version as part of this change.
How can this be tested?
bumpverinstalled (pip install bumpver), runbumpver update --dryfrom the repo root and confirm it shows the expected diff with no errors.VERSIONin Django settings matchescurrent_versioninpyproject.toml.Additional Context
Part of the Concourse release pipeline modernization — migrating from the Doof
Slack bot to a Concourse-native release workflow using GitHub Issues as
production gates.