Skip to content

Commit fae01ab

Browse files
authored
Fix release changelog verification (#1780)
* Fix release changelog verification * Install protoc for release verification
1 parent 75f7c92 commit fae01ab

3 files changed

Lines changed: 37 additions & 5 deletions

File tree

‎.github/scripts/release_verify.py‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,18 @@ def _sdk_core_release_notes(version: str, path: str) -> list[str]:
308308
)
309309
except subprocess.CalledProcessError:
310310
_git(["fetch", "--quiet", "origin", "main"], cwd=submodule_path)
311-
notes = _sdk_core_changelog_entries(
312-
previous_commit,
313-
current_commit,
314-
submodule_path,
315-
)
311+
try:
312+
notes = _sdk_core_changelog_entries(
313+
previous_commit,
314+
current_commit,
315+
submodule_path,
316+
)
317+
except subprocess.CalledProcessError as error:
318+
output = error.output.strip() if error.output else str(error)
319+
raise RuntimeError(
320+
"SDK Core changelog-release-notes failed after fetching origin/main:\n"
321+
f"{output}"
322+
) from error
316323
if not notes:
317324
return []
318325

‎.github/workflows/release-publish.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ jobs:
124124
ref: ${{ github.sha }}
125125
fetch-depth: 0
126126
submodules: recursive
127+
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
128+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
129+
with:
130+
# Keep the generated Core protobuf code compatible with CI.
131+
version: "23.x"
132+
repo-token: ${{ secrets.GITHUB_TOKEN }}
127133
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
128134
with:
129135
python-version: "3.11"

‎tests/test_prepare_release.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,25 @@ def test_sdk_core_release_notes_embed_core_output(
9191
]
9292

9393

94+
def test_sdk_core_release_notes_preserves_generator_failure_output(
95+
monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path
96+
) -> None:
97+
release_verify = _release_verify_module()
98+
(tmp_path / ".git").mkdir()
99+
monkeypatch.setattr(release_verify, "_previous_release_tag", lambda _version: "old")
100+
monkeypatch.setattr(release_verify, "_gitlink", lambda revision, _path: revision)
101+
monkeypatch.setattr(release_verify, "_git", lambda *_args, **_kwargs: "")
102+
error = subprocess.CalledProcessError(101, ["cargo"], output="compiler output")
103+
monkeypatch.setattr(
104+
release_verify,
105+
"_sdk_core_changelog_entries",
106+
lambda *_args: (_ for _ in ()).throw(error),
107+
)
108+
109+
with pytest.raises(RuntimeError, match="compiler output"):
110+
release_verify._sdk_core_release_notes("1.30.0", str(tmp_path))
111+
112+
94113
def test_finalize_changelog_release() -> None:
95114
text = "## [Unreleased]\n\n### Added\n\n- A thing.\n"
96115
assert "## [1.30.0] - 2026-06-18" in finalize_changelog_release(

0 commit comments

Comments
 (0)