feat: Versionskandidat statt Bump-pro-Release - VERSION traegt -beta.N, version release fixiert (4.4.0, #42)
CI / verify (push) Successful in 47s
Release / release (push) Successful in 35s

Files changed:
- .gitea/workflows/release.yml
- AGENTS.md
- CHANGES.md
- DEVELOPMENT.md
- README.md
- VERSION
- docs/version-model.md
- instructions/dev/version-parts.md
- tools/CONTRACT.md
- tools/chemenu/commands/dist_cmd.py
- tools/chemenu/commands/docs_verify.py
- tools/chemenu/commands/doctor.py
- tools/chemenu/commands/migrate_cmd.py
- tools/chemenu/commands/version_cmd.py
- tools/chemenu/kb_state.py
- tools/chemenu/tests/test_dist_cmd.py
- tools/chemenu/tests/test_docs_verify.py
- tools/chemenu/tests/test_doctor.py
- tools/chemenu/tests/test_migrate_cmd.py
- tools/chemenu/tests/test_version_cmd.py
- tools/chemenu/version.py
This commit is contained in:
torben committed 2026-09-03 22:19:41 +02:00
1 parent b1883befc7
commit d29d400dd3
21 files changed
+1063 -119

No files matched your search

+28 -9
View File
@@ -190,6 +190,12 @@ def test_this_repos_boundary_is_accounted_for():
def _boundary_tree(tmp_path, monkeypatch, current: str, previous: str, marker: str = ""):
"""A changelog with `current` as the topmost entry and `previous` as the
last release beneath it. `current` is normally an open candidate
(`2.0.0-beta.1`) - the checks compare the newest entry against the **last
release** (`version_mod.last_release`), which skips right past a topmost
entry that is itself already a release (that one's crossing, if any, was
already checked while it was still the open candidate)."""
(tmp_path / "VERSION").write_text(f"{current}\n", encoding="utf-8")
(tmp_path / "CHANGES.md").write_text(
"# Changelog\n\n---\n\n"
@@ -207,28 +213,41 @@ def _boundary_tree(tmp_path, monkeypatch, current: str, previous: str, marker: s
def test_a_breaking_release_without_a_migration_is_reported(tmp_path, monkeypatch):
"""`version check` tells an instance it must migrate; without this, that is
where the trail ends."""
_boundary_tree(tmp_path, monkeypatch, "2.0.0", "1.4.0")
_boundary_tree(tmp_path, monkeypatch, "2.0.0-beta.1", "1.4.0")
issues = docs_verify.check_migration_for_boundary()
assert any("2.0.0" in issue and "must migrate" in issue for issue in issues)
assert any("2.0.0-beta.1" in issue and "must migrate" in issue for issue in issues)
def test_a_compatible_release_needs_no_migration(tmp_path, monkeypatch):
_boundary_tree(tmp_path, monkeypatch, "1.5.0", "1.4.0")
_boundary_tree(tmp_path, monkeypatch, "1.5.0-beta.1", "1.4.0")
assert docs_verify.check_migration_for_boundary() == []
def test_a_fixed_release_is_never_re_checked_against_its_own_crossing(tmp_path, monkeypatch):
"""Regression for finding #2: comparing against the entry *beneath* the
newest one (rather than the last release) would find no boundary between
two betas of the same candidate - and would also, wrongly, re-flag an
already-fixed release forever. Once `current` is itself a release,
`last_release` returns it directly, so there is nothing left to compare."""
_boundary_tree(tmp_path, monkeypatch, "2.0.0", "1.4.0")
assert docs_verify.check_migration_for_boundary() == []
assert docs_verify.check_breaking_change_for_boundary() == []
def test_an_explicit_none_required_marker_satisfies_the_check(tmp_path, monkeypatch):
from chemenu import version as version_mod
_boundary_tree(
tmp_path, monkeypatch, "2.0.0", "1.4.0",
tmp_path, monkeypatch, "2.0.0-beta.1", "1.4.0",
marker=f"{version_mod.MIGRATION_NONE_MARKER} - nothing to change.\n\n",
)
assert docs_verify.check_migration_for_boundary() == []
def test_a_migration_document_satisfies_the_check(tmp_path, monkeypatch):
root = _boundary_tree(tmp_path, monkeypatch, "2.0.0", "1.4.0")
"""The document targets the candidate's *base* (`2.0.0`), not its full
pre-release form - matching what `version bump` looks for."""
root = _boundary_tree(tmp_path, monkeypatch, "2.0.0-beta.1", "1.4.0")
(root / "instructions" / "migrations" / "2.0.0-retype.md").write_text(
"---\ntype: types/instruction.md\nname: 2.0.0-retype\n"
"description: Retype.\nmanual: true\nmigrates_to: 2.0.0\n---\n",
@@ -243,16 +262,16 @@ def test_a_breaking_release_without_a_breaking_note_is_reported(tmp_path, monkey
from chemenu import version as version_mod
_boundary_tree(
tmp_path, monkeypatch, "2.0.0", "1.4.0",
tmp_path, monkeypatch, "2.0.0-beta.1", "1.4.0",
marker=f"{version_mod.MIGRATION_NONE_MARKER} - nothing to change.\n\n",
)
assert docs_verify.check_migration_for_boundary() == []
issues = docs_verify.check_breaking_change_for_boundary()
assert any("2.0.0" in issue and "drop-in" in issue for issue in issues)
assert any("2.0.0-beta.1" in issue and "drop-in" in issue for issue in issues)
def test_a_compatible_release_needs_no_breaking_note(tmp_path, monkeypatch):
_boundary_tree(tmp_path, monkeypatch, "1.5.0", "1.4.0")
_boundary_tree(tmp_path, monkeypatch, "1.5.0-beta.1", "1.4.0")
assert docs_verify.check_breaking_change_for_boundary() == []
@@ -260,7 +279,7 @@ def test_a_breaking_change_marker_satisfies_the_check(tmp_path, monkeypatch):
from chemenu import version as version_mod
_boundary_tree(
tmp_path, monkeypatch, "2.0.0", "1.4.0",
tmp_path, monkeypatch, "2.0.0-beta.1", "1.4.0",
marker=f"{version_mod.BREAKING_CHANGE_MARKER} the feed moved.\n\n",
)
assert docs_verify.check_breaking_change_for_boundary() == []