Skip to content

Conversation

@ebmifa
Copy link
Contributor

@ebmifa ebmifa commented Jan 16, 2026

Summary

  • Refactored release notes script with new gh_api() helper to consolidate GitHub API calls
  • Added list-prs and get-notes commands for CI workflows
  • Added 20 unit tests for the release notes script
  • Renamed workflow to release-notes.yml and added automatic test execution when scripts change

Based on changes from MystenLabs/sui#24989

Test plan

  • All 20 unit tests pass locally (python -m pytest release_notes_test.py -v)
  • CI workflow runs successfully on this PR
  • Verify list-prs and get-notes commands work as expected

🤖 Generated with Claude Code

ebmifa and others added 3 commits January 16, 2026 15:52
- Add gh_api() helper function to consolidate GitHub API calls
- Add list-prs command to list PRs with release notes as JSON
- Add get-notes command to get formatted notes for a PR
- Add pr_has_release_notes() function to check for checked notes
- Refactor extract_notes_for_pr/commit to use gh_api helper
- Wrap execution in if __name__ == "__main__" for module imports
- Add release_notes_test.py with 20 unit tests
- Rename workflow to release-notes.yml
- Add release-notes-script-test job to run tests on script changes
- Add isReleaseNotesScript detection to diffs action

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link
Contributor

@wbbradley wbbradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I left some nits.

json_data = gh_api(f"/repos/MystenLabs/walrus/pulls/{pr}")
if not json_data:
return False
body = json_data.get("body", "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body = json_data.get("body", "")
body = json_data.get("body")

The default argument is not idiomatic in this setting. get will return None if there is no "body".

# Execute the curl command
result = subprocess.run(curl_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
json_data = json.loads(result.stdout)
message = json_data[0].get("body") if json_data else ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ternary operator is not doing anything anymore.

Suggested change
message = json_data[0].get("body") if json_data else ""
message = json_data[0].get("body")

result = subprocess.run(curl_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
json_data = json.loads(result.stdout)
pr = json_data[0].get("number") if json_data else ""
pr = json_data[0].get("number") if json_data else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pr = json_data[0].get("number") if json_data else None
pr = json_data[0].get("number")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants