Skip to content

Commit 4fd67f7

Browse files
committed
Use standardized changelog release behavior
1 parent 2f98864 commit 4fd67f7

4 files changed

Lines changed: 29 additions & 5 deletions

File tree

‎changelog/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ Review the assembled notes before merging the release PR.
5050
Assembly creates a dated section at the top of the changelog, groups notes in the
5151
category order above, and sorts filenames within each category. Empty categories
5252
are omitted. Each nonempty line becomes one list item, in the order it appears
53-
in the fragment. Older releases are preserved. Empty releases and
54-
duplicate versions are rejected. Fragments are retained if validation or lockfile
53+
in the fragment. Breaking changes use `### :boom: Breaking Changes`. Older releases
54+
are preserved. Empty releases are allowed; duplicate versions are rejected.
55+
Fragments are retained if validation or lockfile
5556
refresh fails. A changelog validation failure leaves the version and lockfile
5657
updates in the local worktree; inspect or restore those changes before retrying.
5758
File-system errors can leave partial changelog preparation as well; preparation

‎scripts/changelog.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,5 @@ def prepare_changelog(
5050
version,
5151
"--date",
5252
release_date.isoformat(),
53-
"--breaking-heading",
54-
":boom: Breaking Changes",
5553
],
5654
)

‎tests/test_prepare_release.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@ def run_tool(_root: pathlib.Path, args: list[str]) -> str:
8181
)
8282

8383

84+
@pytest.mark.parametrize("core_notes", ["", "#### Fixed\n\n- Core fix.\n"])
85+
def test_empty_python_release_notes_allow_core_only_releases(
86+
monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path, core_notes: str
87+
) -> None:
88+
release_verify = _release_verify_module()
89+
90+
def run_tool(_root: pathlib.Path, args: list[str]) -> str:
91+
return "" if args[0] == "notes" else core_notes
92+
93+
monkeypatch.setattr(release_verify, "run_tool", run_tool)
94+
output = tmp_path / "notes.md"
95+
release_verify.changelog_notes(
96+
argparse.Namespace(
97+
version="1.35.0",
98+
changelog="CHANGELOG.md",
99+
sdk_core_path="core",
100+
output=str(output),
101+
)
102+
)
103+
expected = "## Notable Changes\n\n"
104+
if core_notes:
105+
expected += "\n### SDK Core\n\n" + core_notes
106+
assert output.read_text() == expected
107+
108+
84109
def test_shared_tool_preserves_failure_diagnostics(
85110
monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path
86111
) -> None:

0 commit comments

Comments
 (0)