Skip to content

The agent that grows with you

fix(release): --no-changelog no longer raises NameError

ethernete0265925f16e
diff --git a/scripts/release.py b/scripts/release.py
index b90b08436ae..0c29aa70864 100755
--- a/scripts/release.py
+++ b/scripts/release.py
@@ -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)
diff --git a/tests/scripts/test_release_changelog.py b/tests/scripts/test_release_changelog.py
new file mode 100644
index 00000000000..3676498a7fc
--- /dev/null
+++ b/tests/scripts/test_release_changelog.py
@@ -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": "[email protected]",
+ "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