Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.249.1
2026.4.16.1
2 changes: 1 addition & 1 deletion micromasters/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
get_string)
from micromasters.sentry import init_sentry

VERSION = "0.0.0" # Default version
VERSION = "2026.4.16.1" # Default version
version_file = Path(os.getcwd()) / "VERSION"
if version_file.is_file():
with open(version_file, encoding="UTF-8") as file:
Expand Down
18 changes: 11 additions & 7 deletions micromasters/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import sys
from unittest import mock

import semantic_version
import re
import tomllib

from ddt import data, ddt
from django.conf import settings
from django.core import mail
Expand Down Expand Up @@ -152,9 +154,11 @@ def test_opensearch_index_pr_build(self):
settings_vars = self.reload_settings()
assert settings_vars['OPENSEARCH_INDEX'] == index_name

@staticmethod
def test_semantic_version():
"""
Verify that we have a semantic compatible version.
"""
semantic_version.Version(settings.VERSION)
def test_bump_my_version_format(self):
"""Verify that VERSION matches the bump-my-version calver format."""
with open("pyproject.toml", "rb") as f: # noqa: PTH123
pyproject = tomllib.load(f)
version_pattern = pyproject["tool"]["bumpversion"]["parse"]
package_version = pyproject["project"]["version"]
assert settings.VERSION == package_version
assert re.fullmatch(version_pattern, settings.VERSION)
35 changes: 34 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "micromasters"
version = "0.0.1"
version = "2026.4.16.1"
requires-python = ">=3.11"
dependencies = [
"django>=5.2,<5.3",
Expand Down Expand Up @@ -79,3 +79,36 @@ dev = [
"isort",
"semantic-version",
]

[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+)"
serialize = ["{release}.{build}"]
Comment on lines +83 to +87
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The [tool.bumpversion] configuration in pyproject.toml is missing the required current_version key, which will cause the bump-my-version tool to fail during the release process.
Severity: HIGH

Suggested Fix

Add the current_version key to the [tool.bumpversion] section in pyproject.toml. The value should be set to the project's current version, for example: current_version = "0.1.0".

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: pyproject.toml#L83-L87

Potential issue: The `[tool.bumpversion]` configuration in `pyproject.toml` is missing
the required `current_version` key. The `bump-my-version` tool relies on this key to
substitute the `{current_version}` placeholder in its search-and-replace patterns. The
automated release pipeline executes `bumpver update`, which will fail during
configuration parsing or when attempting to evaluate the search patterns, thus breaking
the automated release process this pull request is intended to enable.


[tool.bumpversion.parts.release]
calver_format = "{YYYY}.{MM}.{DD}"

[tool.bumpversion.parts.build]
first_value = "1"

[[tool.bumpversion.files]]
filename = "micromasters/settings.py"
search = 'VERSION = "{current_version}"'
replace = 'VERSION = "{new_version}"'

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "uv.lock"
search = """
name = "micromasters"
version = "{current_version}"
source = {{ virtual = "." }}"""
replace = """
name = "micromasters"
version = "{new_version}"
source = {{ virtual = "." }}"""
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading