Skip to content

fix: push main before generating release notes#49

Merged
markshust merged 1 commit into
developfrom
feature/release-script-push-before-notes
May 1, 2026
Merged

fix: push main before generating release notes#49
markshust merged 1 commit into
developfrom
feature/release-script-push-before-notes

Conversation

@markshust
Copy link
Copy Markdown
Collaborator

Summary

Cutting 0.4.0 exposed a timing bug in bin/release.sh. The script was calling GitHub's releases/generate-notes API before pushing main, so the API saw no commits between 0.3.1 and remote main and returned an empty body. Both the CHANGELOG.md entry and the GitHub Release body for 0.4.0 came back blank.

Fix: push main to the remote first, then call the API, then commit the changelog, then push main again with the tag. main now gets pushed twice per release (once with the develop merge, once with the changelog commit) — that's the cost of keeping CHANGELOG.md and the GitHub Release body identical.

Also restores the 0.4.0 entry in CHANGELOG.md to match the GitHub Release body, which was hand-patched after the failed run.

Test plan

  • bash -n bin/release.sh syntax clean
  • End-to-end verification with the next release (0.4.1) — first real run of the corrected flow

Side note

While recovering 0.4.0 we noticed gh api releases/generate-notes silently omitted PR #42 because GitHub's stored mergeCommitSha for that PR didn't match the actual commit on main. That's a pre-existing GitHub-side quirk, not something this PR addresses — release.sh has no signal to detect it. Worth spot-checking the generated notes against git log --first-parent --merges after each future release until we know how often it happens.

🤖 Generated with Claude Code

The generate-notes GitHub API walks commits on the remote, so it silently
omits any merges that have not been pushed yet. Cutting 0.4.0 produced an
empty changelog entry and an empty GitHub Release body for this reason —
release.sh merged develop into main locally, then called the API before
pushing. From the API's perspective there were no commits between 0.3.1
and remote main.

Push main first, then generate, then commit the changelog and push the
tag. main now gets pushed twice per release (once with the merge, once
with the changelog commit), which is the cost of keeping CHANGELOG.md
and the GitHub Release body identical.

Also restores the 0.4.0 entry in CHANGELOG.md to match the GitHub
Release body for that tag (manually patched after the failed run).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label May 1, 2026
@markshust markshust merged commit 53d1804 into develop May 1, 2026
1 check passed
@markshust markshust deleted the feature/release-script-push-before-notes branch May 1, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant