Skip to content

Commit 7dda4c5

Browse files
committed
Delegate Core release notes to sdk-rust
1 parent 75720d9 commit 7dda4c5

3 files changed

Lines changed: 35 additions & 27 deletions

File tree

.github/scripts/release_verify.py

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -294,37 +294,23 @@ def _sdk_core_release_notes(version: str, path: str) -> list[str]:
294294
f"Submodule {path!r} is not initialized; checkout with submodules"
295295
)
296296

297-
log_args = [
298-
"log",
299-
"--format=%H%x00%h%x00%s",
300-
"--reverse",
301-
f"{previous_commit}..{current_commit}",
302-
]
303297
try:
304-
log_output = _git(log_args, cwd=submodule_path)
298+
notes = _sdk_core_changelog_entries(
299+
previous_commit,
300+
current_commit,
301+
submodule_path,
302+
)
305303
except subprocess.CalledProcessError:
306304
_git(["fetch", "--quiet", "origin", "main"], cwd=submodule_path)
307-
log_output = _git(log_args, cwd=submodule_path)
308-
if not log_output:
305+
notes = _sdk_core_changelog_entries(
306+
previous_commit,
307+
current_commit,
308+
submodule_path,
309+
)
310+
if not notes:
309311
return []
310312

311-
lines = ["### SDK Core", ""]
312-
changelog_entries = _sdk_core_changelog_entries(
313-
previous_commit,
314-
current_commit,
315-
submodule_path,
316-
)
317-
if changelog_entries:
318-
lines.extend(["#### Changelog", "", *changelog_entries, ""])
319-
lines.extend(["#### Commits", ""])
320-
for line in log_output.splitlines():
321-
full_hash, short_hash, subject = line.split("\0", 2)
322-
subject = _link_sdk_core_prs(_clean_commit_subject(subject))
323-
lines.append(
324-
f"- [`{short_hash}`](https://github.com/temporalio/sdk-rust/commit/"
325-
f"{full_hash}) {subject}"
326-
)
327-
return lines
313+
return ["### SDK Core", "", *notes]
328314

329315

330316
def changelog_notes(args: argparse.Namespace) -> None:

tests/test_prepare_release.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,28 @@ def check_output(args: list[str], *, cwd: pathlib.Path, **_kwargs: object) -> st
6363
]
6464

6565

66+
def test_sdk_core_release_notes_embed_core_output(
67+
monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path
68+
) -> None:
69+
release_verify = _release_verify_module()
70+
(tmp_path / ".git").mkdir()
71+
monkeypatch.setattr(release_verify, "_previous_release_tag", lambda _version: "old")
72+
monkeypatch.setattr(release_verify, "_gitlink", lambda revision, _path: revision)
73+
monkeypatch.setattr(
74+
subprocess,
75+
"check_output",
76+
lambda *_args, **_kwargs: "#### Commits\n\n- Core commit\n",
77+
)
78+
79+
assert release_verify._sdk_core_release_notes("1.30.0", str(tmp_path)) == [
80+
"### SDK Core",
81+
"",
82+
"#### Commits",
83+
"",
84+
"- Core commit",
85+
]
86+
87+
6688
def test_finalize_changelog_release() -> None:
6789
text = "## [Unreleased]\n\n### Added\n\n- A thing.\n"
6890
assert "## [1.30.0] - 2026-06-18" in finalize_changelog_release(

0 commit comments

Comments
 (0)