Skip to content

fix: handle zero PRs in release notes; extract CHANGELOG updater to script#580

Merged
paddymul merged 3 commits intomainfrom
fix/release-notes-zero-prs
Feb 24, 2026
Merged

fix: handle zero PRs in release notes; extract CHANGELOG updater to script#580
paddymul merged 3 commits intomainfrom
fix/release-notes-zero-prs

Conversation

@paddymul
Copy link
Collaborator

Summary

  • Fix sys.exit(1) on zero PRs — a release with no merged PRs is valid; the script now produces a "No notable changes since previous release." entry and exits 0 instead of hard-failing and cascading all downstream steps to skip
  • Fix merged:>= date query — the previous merged:>DATE excluded PRs merged on the tag's creation date; changed to >= so same-day PRs are included
  • Extract CHANGELOG heredoc to scripts/update_changelog.py — replaces the fragile inline python3 - <<'PYEOF' block in release.yml with a testable standalone script
  • Add unit teststests/unit/test_release_scripts.py covers classify_pr, group_prs, generate_plain_notes (normal + empty), and update_changelog; all 8 pass locally

Test plan

  • uv run pytest tests/unit/test_release_scripts.py -v — 8/8 pass
  • Verify generate_plain_notes({}, ...) produces "No notable changes" without crashing
  • Verify update_changelog.py inserts entry after line 1 of CHANGELOG.md

🤖 Generated with Claude Code

- Fix sys.exit(1) when no PRs found — produce "No notable changes" entry
- Fix merged:> query to merged:>= so PRs on tag date are included
- Extract inline CHANGELOG heredoc from release.yml into scripts/update_changelog.py
- Add unit tests for classify_pr, group_prs, generate_plain_notes, update_changelog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9da38d9e16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"gh", "pr", "list",
"--state", "merged",
"--search", f"merged:>{since_date}",
"--search", f"merged:>={since_date}",

Choose a reason for hiding this comment

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

P2 Badge Keep PR search exclusive at release-date boundary

Using merged:>=... with a date-only boundary causes already-released PRs to be reselected on the next release. get_tag_date() truncates the tag timestamp to YYYY-MM-DD, so when the previous tag was created on a day that also had merged PRs, this inclusive query pulls those same-day PRs back into the next changelog/release notes and duplicates entries. Keeping the boundary exclusive (or switching to a full timestamp) avoids this regression.

Useful? React with 👍 / 👎.

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

📦 TestPyPI package published

pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.12.12.dev22371011635

or with uv:

uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.12.12.dev22371011635

MCP server for Claude Code

claude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.12.12.dev22371011635" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table

`get_tag_date()` was truncating the tag creation time to `YYYY-MM-DD`
and `gather_prs()` used `merged:>=DATE` (inclusive).  On the next
release this re-selects every PR merged on that same calendar day,
even if they were already in the previous release.

Fix by returning the full `iso-strict` timestamp from git and switching
the search qualifier back to exclusive `merged:>TIMESTAMP`.  PRs merged
after the tag on the same day are still captured; already-released PRs
are not duplicated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@paddymul paddymul added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 6b9e695 Feb 24, 2026
24 checks passed
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.

1 participant