From 42a39290afe19e052023b1061e12784349b7d99d Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:37:27 -0700 Subject: [PATCH 1/8] test(fixtures): update changelog generator to match adjusted default template --- tests/fixtures/git_repo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fixtures/git_repo.py b/tests/fixtures/git_repo.py index 0c8faeeb5..048f77b3a 100644 --- a/tests/fixtures/git_repo.py +++ b/tests/fixtures/git_repo.py @@ -1689,7 +1689,7 @@ def build_version_entry_markdown( # Add breaking changes to the end of the version entry if brking_descriptions: - version_entry.append("### BREAKING CHANGES\n") + version_entry.append("### Breaking Changes\n") version_entry.extend([*sorted(brking_descriptions), ""]) return str.join("\n", version_entry) @@ -1822,7 +1822,7 @@ def build_version_entry_restructured_text( # Add breaking changes to the end of the version entry if brking_descriptions: - version_entry.append("BREAKING CHANGES") + version_entry.append("Breaking Changes") version_entry.append("-" * len(version_entry[-1]) + "\n") version_entry.extend([*sorted(brking_descriptions), ""]) @@ -2067,7 +2067,7 @@ def build_version_entry_markdown( # Add breaking changes to the end of the version entry if brking_descriptions: - version_entry.append("### BREAKING CHANGES\n") + version_entry.append("### Breaking Changes\n") version_entry.extend([*sorted(brking_descriptions), ""]) return str.join("\n", version_entry) From c18d18789e778502962749d444f7d11b3dd1e897 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:38:14 -0700 Subject: [PATCH 2/8] test(release-notes): update test cases to match adjusted default template --- .../semantic_release/changelog/test_release_notes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/semantic_release/changelog/test_release_notes.py b/tests/unit/semantic_release/changelog/test_release_notes.py index f0c959c27..2b95ec827 100644 --- a/tests/unit/semantic_release/changelog/test_release_notes.py +++ b/tests/unit/semantic_release/changelog/test_release_notes.py @@ -211,7 +211,7 @@ def test_default_release_notes_template_w_a_brk_description( url=brk_fix_commit_url, ), "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -323,7 +323,7 @@ def test_default_release_notes_template_w_multiple_brk_changes( url=brk_feat_commit_url, ), "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -770,7 +770,7 @@ def test_default_release_notes_template_w_a_notice( url=notice_commit_url, ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -880,7 +880,7 @@ def test_default_release_notes_template_w_a_notice_n_brk_change( url=notice_commit_url, ), "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -891,7 +891,7 @@ def test_default_release_notes_template_w_a_notice_n_brk_change( change_desc=brk_fix_brking_description.capitalize().rstrip(), ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -997,7 +997,7 @@ def test_default_release_notes_template_w_multiple_notices( url=refactor_commit_url, ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( From fd4c542ff01ceb99b2eb47871d67be9035e03dac Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:38:27 -0700 Subject: [PATCH 3/8] test(changelog): update test cases to match adjusted default template --- .../changelog/test_default_changelog.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/semantic_release/changelog/test_default_changelog.py b/tests/unit/semantic_release/changelog/test_default_changelog.py index e3c01b7d7..adbbdc241 100644 --- a/tests/unit/semantic_release/changelog/test_default_changelog.py +++ b/tests/unit/semantic_release/changelog/test_default_changelog.py @@ -180,7 +180,7 @@ def test_default_changelog_template_w_a_brk_change( f"- **{brk_fix_commit_obj.scope}**: {brk_fix_description.capitalize()}", f" ([`{brk_fix_commit_obj.commit.hexsha[:7]}`]({brk_fix_commit_url}))", "", - "### BREAKING CHANGES", + "### Breaking Changes", "", # Currently does not consider the 100 character limit because the current # descriptions are short enough to fit in one line @@ -317,7 +317,7 @@ def test_default_changelog_template_w_multiple_brk_changes( f"- {brk_feat_description.capitalize()}", f" ([`{brk_feat_commit_obj.commit.hexsha[:7]}`]({brk_feat_commit_url}))", "", - "### BREAKING CHANGES", + "### Breaking Changes", "", # Currently does not consider the 100 character limit because the current # descriptions are short enough to fit in one line @@ -638,7 +638,7 @@ def test_default_changelog_template_w_a_notice( f"- **{notice_commit_obj.scope}**: {notice_commit_description.capitalize().rstrip()}", f" ([`{notice_commit_obj.commit.hexsha[:7]}`]({notice_commit_url}))", "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -787,7 +787,7 @@ def test_default_changelog_template_w_a_notice_n_brk_change( ), f" ([`{notice_commit_obj.commit.hexsha[:7]}`]({notice_commit_url}))", "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -798,7 +798,7 @@ def test_default_changelog_template_w_a_notice_n_brk_change( change_desc=brk_fix_brking_description.capitalize().rstrip(), ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -947,7 +947,7 @@ def test_default_changelog_template_w_multiple_notices( ), f" ([`{refactor_notice_commit_obj.commit.hexsha[:7]}`]({refactor_commit_url}))", "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( From b28dc2dc516890fc3ea6293cc549a1205b4228c1 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:33:00 -0700 Subject: [PATCH 4/8] fix(changelog-rst): standardize heading format for extra release information --- .../data/templates/angular/rst/.components/changes.rst.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 b/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 index 2ff88c892..c6ef1cced 100644 --- a/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +++ b/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 @@ -18,7 +18,7 @@ Bug Fixes * Fix bug (`#11`_, `8a7b8ec`_) -BREAKING CHANGES +Breaking Changes ---------------- * With the change _____, the change causes ___ effect. Ultimately, this section @@ -28,7 +28,7 @@ BREAKING CHANGES * **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -ADDITIONAL RELEASE INFORMATION +Additional Release Information ------------------------------ * This is a release note that provides additional information about the release @@ -124,7 +124,7 @@ ADDITIONAL RELEASE INFORMATION %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "BREAKING CHANGES\n" +}}{{ "Breaking Changes\n" }}{{ '----------------\n' }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) @@ -158,7 +158,7 @@ ADDITIONAL RELEASE INFORMATION %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "ADDITIONAL RELEASE INFORMATION\n" +}}{{ "Additional Release Information\n" }}{{ "------------------------------\n" }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) From 1e9e04600c928ba0facc3df2aa4d21b5fc6b051b Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:33:16 -0700 Subject: [PATCH 5/8] fix(changelog-md): standardize heading format for extra release information --- .../data/templates/angular/md/.components/changes.md.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 b/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 index bf4cd98b5..b2b89ff12 100644 --- a/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 +++ b/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 @@ -18,7 +18,7 @@ EXAMPLE: - Fix bug ([#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### BREAKING CHANGES +### Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional @@ -27,7 +27,7 @@ EXAMPLE: - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### ADDITIONAL RELEASE INFORMATION +### Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. @@ -96,7 +96,7 @@ EXAMPLE: %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "### BREAKING CHANGES\n" +}}{{ "### Breaking Changes\n" }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) }}{# @@ -129,7 +129,7 @@ EXAMPLE: %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "### ADDITIONAL RELEASE INFORMATION\n" +}}{{ "### Additional Release Information\n" }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) }}{# From 5b334bb2ff32cdc57794252670f99a775c57d57a Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:33:29 -0700 Subject: [PATCH 6/8] fix(release-notes): standardize heading format for extra release information --- .../data/templates/angular/md/.release_notes.md.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 b/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 index 8bfd679cc..7fe7d9228 100644 --- a/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 +++ b/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 @@ -14,13 +14,13 @@ _This release is published under the MIT License._ - Fix bug (#11, [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### BREAKING CHANGES +### Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional scope prefix like the commit messages above. - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### ADDITIONAL RELEASE INFORMATION +### Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. From 18a51a2b4b72e2d919e695e62a545325baa94418 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:39:02 -0700 Subject: [PATCH 7/8] docs(commit-parsing): update reference to section name of additional release info --- docs/commit_parsing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/commit_parsing.rst b/docs/commit_parsing.rst index 25e70eb45..65e523d98 100644 --- a/docs/commit_parsing.rst +++ b/docs/commit_parsing.rst @@ -423,7 +423,7 @@ a ``release_notices`` attribute that is a tuple of string paragraphs to identify release notice. In the default changelog and release notes template, these release notices will be -formatted into their own section called **ADDITIONAL RELEASE INFORMATION**. Each will +formatted into their own section called **Additional Release Information**. Each will include any commit scope defined and each release notice in alphabetical order. ---- From 31266e75cd7f73663141f9ae07e7f073e9ff0097 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Mon, 10 Feb 2025 23:28:37 -0700 Subject: [PATCH 8/8] chore(psr-changelog-tpls): standardize all headings & resolve additnl release info usage --- config/release-templates/.components/changes.md.j2 | 10 +++++----- config/release-templates/.components/changes.rst.j2 | 8 ++++---- config/release-templates/.release_notes.md.j2 | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/release-templates/.components/changes.md.j2 b/config/release-templates/.components/changes.md.j2 index 87d600924..d2a062d9a 100644 --- a/config/release-templates/.components/changes.md.j2 +++ b/config/release-templates/.components/changes.md.j2 @@ -19,7 +19,7 @@ EXAMPLE: - Fix bug ([#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### 💥 BREAKING CHANGES +### 💥 Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional @@ -28,7 +28,7 @@ EXAMPLE: - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### 💡 ADDITIONAL RELEASE INFORMATION +### 💡 Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. @@ -65,7 +65,7 @@ EXAMPLE: #}{% set breaking_commits = [] %}{% set notice_commits = [] %}{% for commits in commit_objects.values() -%}{% set valid_commits = commits | rejectattr("error", "defined") +%}{% set valid_commits = commits | rejectattr("error", "defined") | list %}{# # Filter out breaking change commits that have no breaking descriptions #}{% set _ = breaking_commits.extend( valid_commits | selectattr("breaking_descriptions.0") @@ -94,7 +94,7 @@ EXAMPLE: %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "### %s BREAKING CHANGES\n" | format(emoji_map["breaking"]) +}}{{ "### %s Breaking Changes\n" | format(emoji_map["breaking"]) }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) }}{# @@ -118,7 +118,7 @@ EXAMPLE: %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "### %s ADDITIONAL RELEASE INFORMATION\n" | format(emoji_map["release_note"]) +}}{{ "### %s Additional Release Information\n" | format(emoji_map["release_note"]) }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) }}{# diff --git a/config/release-templates/.components/changes.rst.j2 b/config/release-templates/.components/changes.rst.j2 index ba9180e87..90434bfdb 100644 --- a/config/release-templates/.components/changes.rst.j2 +++ b/config/release-templates/.components/changes.rst.j2 @@ -20,7 +20,7 @@ * Fix bug (`#11`_, `8a7b8ec`_) -💥 BREAKING CHANGES +💥 Breaking Changes ------------------- * With the change _____, the change causes ___ effect. Ultimately, this section @@ -30,7 +30,7 @@ * **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -💡 ADDITIONAL RELEASE INFORMATION +💡 Additional Release Information --------------------------------- * This is a release note that provides additional information about the release @@ -132,7 +132,7 @@ %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "%s BREAKING CHANGES\n" | format(emoji_map["breaking"]) +}}{{ "%s Breaking Changes\n" | format(emoji_map["breaking"]) }}{{ '-------------------\n' }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) @@ -157,7 +157,7 @@ %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "%s ADDITIONAL RELEASE INFORMATION\n" | format(emoji_map["release_note"]) +}}{{ "%s Additional Release Information\n" | format(emoji_map["release_note"]) }}{{ "---------------------------------\n" }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) diff --git a/config/release-templates/.release_notes.md.j2 b/config/release-templates/.release_notes.md.j2 index 584269ead..ee9fde4c4 100644 --- a/config/release-templates/.release_notes.md.j2 +++ b/config/release-templates/.release_notes.md.j2 @@ -15,13 +15,13 @@ _This release is published under the MIT License._ - Fix bug ([PR#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### 💥 BREAKING CHANGES +### 💥 Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional scope prefix like the commit messages above. - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### 💡 ADDITIONAL RELEASE INFORMATION +### 💡 Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix.