Skip to content

Configure bumpver for Concourse release pipeline#3882

Open
blarghmatey wants to merge 1 commit intomasterfrom
configure-bumpver
Open

Configure bumpver for Concourse release pipeline#3882
blarghmatey wants to merge 1 commit intomasterfrom
configure-bumpver

Conversation

@blarghmatey
Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A

Description (What does it do?)

Adds [tool.bumpver] configuration to pyproject.toml so the Concourse
release 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), which
replaces the previous semver-style version strings. This is required by the
Concourse release resource workflow being rolled out in
mitodl/ol-infrastructure#4506.

The VERSION constant in Django settings is updated to the initial release
format version as part of this change.

How can this be tested?

  1. With bumpver installed (pip install bumpver), run bumpver update --dry from the repo root and confirm it shows the expected diff with no errors.
  2. Check that VERSION in Django settings matches current_version in pyproject.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.

@arslanashraf7 arslanashraf7 self-assigned this Apr 17, 2026
Comment thread mitxpro/settings.py Outdated
Copy link
Copy Markdown
Contributor

@arslanashraf7 arslanashraf7 left a comment

Choose a reason for hiding this comment

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

We'll need to run uv.lock to update the lock file as well. A check is failing on that. Also, test_semantic_version will also fail once we pass the python CI build step onto the tests step, as pointed out by Sentry.

@arslanashraf7
Copy link
Copy Markdown
Contributor

arslanashraf7 commented Apr 23, 2026

@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.

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

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 corresponding uv.lock entry) to a CalVer-like format.
  • Added a version-bumping tool configuration block in pyproject.toml to update pyproject.toml, mitxpro/settings.py, and uv.lock.
  • Updated settings tests to validate settings.VERSION against the configured version pattern and ensure it matches pyproject.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.

Comment thread pyproject.toml
Comment on lines +106 to +111
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}"

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread mitxpro/settings_test.py
Comment on lines +159 to +166
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"]
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment thread mitxpro/settings.py
from mitxpro.sentry import init_sentry

VERSION = "0.193.1"
VERSION = "2026.4.16.1"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
VERSION = "2026.4.16.1"
VERSION = "2026.04.16.1"

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml
[project]
name = "mitxpro"
version = "0.1.0"
version = "2026.4.16.1"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml
Comment on lines +103 to +106
[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+)"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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].

Copilot uses AI. Check for mistakes.
- 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>
Copy link
Copy Markdown
Contributor

@arslanashraf7 arslanashraf7 left a comment

Choose a reason for hiding this comment

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

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.

@arslanashraf7
Copy link
Copy Markdown
Contributor

@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.

@blarghmatey
Copy link
Copy Markdown
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants