Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release_complete_prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on:
permissions:
contents: write
issues: write
pull-requests: read

jobs:
complete_prepare:
Expand Down
4 changes: 2 additions & 2 deletions dev/release/gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,9 @@ def get_pr_info(self, pr_num: int) -> PrDict:
pr_num: The PR number.

Returns:
Dictionary containing PR fields (state, isDraft, mergeCommit, etc.).
Dictionary containing PR fields (state, isDraft, mergeCommit, body, etc.).
"""
output = self._gh_pr_view(pr_num, "state", "isDraft", "mergeCommit")
output = self._gh_pr_view(pr_num, "state", "isDraft", "mergeCommit", "body")
return json.loads(output) if output else {}

@override
Expand Down
23 changes: 23 additions & 0 deletions tests/tools/private/release/gh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,29 @@ def test_get_pr_files(gh, auto_patch_cmd_helpers):
)


def test_get_pr_info(gh, auto_patch_cmd_helpers):
auto_patch_cmd_helpers.run_gh.return_value = (
'{"state": "MERGED", "isDraft": false, '
'"mergeCommit": {"oid": "abc1234"}, "body": "Work towards #4175"}'
)
info = gh.get_pr_info(123)
assert info == {
"state": "MERGED",
"isDraft": False,
"mergeCommit": {"oid": "abc1234"},
"body": "Work towards #4175",
}
auto_patch_cmd_helpers.run_gh.assert_called_with(
"pr",
"view",
"123",
"--json=state,isDraft,mergeCommit,body",
"--repo=my-owner/my-repo",
check=True,
capture_output=True,
)


def test_get_pr_files_not_found(gh, auto_patch_cmd_helpers):
auto_patch_cmd_helpers.run_gh.side_effect = subprocess.CalledProcessError(1, ["gh"])
with pytest.raises(GetPrError, match="Failed to get PR #123 on my-owner/my-repo"):
Expand Down
Loading