Files
inbuxa-server/tools/release/changelog-check.py
T
jcoffey-dev 86930642c7
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 9m46s
CHANGELOG: entries for the 2026 series since 2026.10.19, kept current by CI
The file still carried the upstream changelog from the 0.16.27 import;
none of the 2026 releases since had an entry. It now has one for each,
2026.10.19 to 2026.11.10, written from their release notes, the same
text as on main. The inherited 0.16.x history stays in git (`git show
v2026.10.19:CHANGELOG.md`).

tools/release/changelog-check.py fails when CHANGELOG.md has no
`## [VERSION]` heading for brand_version!, and fork-checks runs it in
both CI workflows, so a version PR has to add its entry.
2026-11-10 13:02:31 -07:00

46 lines
1.3 KiB
Python
Executable File

#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2026 Coffey Labs LLC
# SPDX-License-Identifier: AGPL-3.0-only
"""Fail when CHANGELOG.md has no entry for the 2026 series' current version.
tools/release/changelog-check.py
The version is brand_version! in crates/types/src/branding.rs; the entry is a
`## [VERSION]` heading. The version PR that sets a version adds its entry, and
fork-checks runs this so one without it can't merge. main does the same with
tools/release/version.py --changelog.
Standard library only.
"""
import re
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def brand_version(text):
m = re.search(r'macro_rules! brand_version \{\s*\(\) => \{\s*"([^"]+)"', text)
if not m:
raise ValueError("no brand_version! in branding.rs")
return m.group(1)
def changelog_versions(text):
return re.findall(r"(?m)^## \[([^\]]+)\]", text)
def main():
shown = brand_version((ROOT / "crates/types/src/branding.rs").read_text())
if shown not in changelog_versions((ROOT / "CHANGELOG.md").read_text()):
print(f"CHANGELOG.md has no entry for {shown}. Add a `## [{shown}] - YYYY-MM-DD`", file=sys.stderr)
print("section to the version PR that sets it.", file=sys.stderr)
return 1
print(shown)
return 0
if __name__ == "__main__":
sys.exit(main())