Skip to content

Conversation

@villelaitila
Copy link
Contributor

@villelaitila villelaitila commented Dec 16, 2025

Summary

  • Fixed critical bug where --yes flag would skip waiting for PR merge, causing tags to be created on the wrong commit
  • Added polling mechanism using gh CLI to automatically detect when PR is merged
  • This was the root cause of v1.2.0 being tagged incorrectly (tag pointed to pre-version-bump commit)

Changes

  • Added json and time imports for polling functionality
  • Modified wait_for_pr_merge() to accept branch_name parameter
  • Added _poll_for_pr_merge() helper that:
    • Polls gh pr view every 10 seconds
    • Times out after 60 minutes
    • Detects merged state (state == "MERGED")
    • Errors if PR is closed without merging
  • Now requires gh CLI when using --yes flag (needed to verify merge status)

Test plan

  • Tested with v1.2.1 release (found and fixed the merged vs state field issue)
  • Run python3 scripts/release.py --bump patch --dry-run to verify script still works
  • Test --yes flag with actual release to verify polling works

🤖 Generated with Claude Code

Previously, using --yes would skip waiting for PR merge entirely,
causing the tag to be created on the wrong commit (before the
version bump was merged). This was the root cause of v1.2.0 being
tagged incorrectly.

Changes:
- Add polling mechanism using gh CLI to check PR merge status
- Require gh CLI when using --yes (needed to verify merge)
- Poll every 10 seconds with 60 minute timeout
- Detect if PR is closed without merging and error appropriately
- Use correct gh CLI field (state=="MERGED") instead of non-existent "merged" field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@softagram-bot
Copy link

Looking good 🎉

See the full Softagram report

@villelaitila villelaitila merged commit 2e9b483 into softagram:main Dec 16, 2025
1 check 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.

2 participants