fix(release): --no-changelog no longer raises NameError
generate_changelog() defined all_authors and teknium_aliases inside the 'if not no_changelog' block but read them after it. The canary tests stub generate_changelog, so nothing ran the real path.
This commit is contained in:
@@ -2426,11 +2426,11 @@ def generate_changelog(commits, tag_name, semver, repo_url="https://github.com/N
|
||||
lines.append("> for Hermes Agent. See below for everything included in this initial release.")
|
||||
lines.append("")
|
||||
|
||||
all_authors = set()
|
||||
teknium_aliases = {"@teknium1"}
|
||||
if not no_changelog:
|
||||
# Group commits by category
|
||||
categories = defaultdict(list)
|
||||
all_authors = set()
|
||||
teknium_aliases = {"@teknium1"}
|
||||
|
||||
for commit in commits:
|
||||
categories[commit["category"]].append(commit)
|
||||
|
||||
17
tests/scripts/test_release_changelog.py
Normal file
17
tests/scripts/test_release_changelog.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""--no-changelog keeps the release body's frame and drops the commit sections."""
|
||||
|
||||
|
||||
def test_no_changelog_keeps_the_frame_without_commit_sections():
|
||||
from scripts import release
|
||||
|
||||
commits = [{
|
||||
"sha": "a" * 40, "short_sha": "a" * 8, "author_name": "Dev", "author_email": "dev@example.test",
|
||||
"subject": "feat: something (#5)", "category": "features", "github_author": "@dev", "coauthors": [],
|
||||
}]
|
||||
|
||||
body = release.generate_changelog(commits, "rc.1-v1.2.4", "1.2.4", repo_url="https://github.com/o/r",
|
||||
prev_tag="v1.2.3", no_changelog=True)
|
||||
|
||||
assert "Something" not in body and "@dev" not in body
|
||||
assert "<!-- HERMES_BUILDS_TABLE -->" in body
|
||||
assert "https://github.com/o/r/compare/v1.2.3...rc.1-v1.2.4" in body
|
||||
Reference in New Issue
Block a user