Improve release script: remove OTP sleep, conditional changelog message#2587
Improve release script: remove OTP sleep, conditional changelog message#2587
Conversation
- Remove unnecessary 5-second sleep between gem publishes. The retry logic already handles OTP failures by prompting for a fresh code. - Make the "Next steps" changelog message conditional: show a checkmark when the changelog section already exists, only suggest updating it when the section is missing. - Replace heredoc-based message with direct puts for cleaner formatting. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughModified the release task in rakelib/release.rake to remove a 5-second OTP delay before publishing, replace the release completion message with line-by-line output, and add conditional messaging based on whether a CHANGELOG.md section exists for the released version. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR makes two focused improvements to Key points:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Release complete] --> B[sync_github_release_after_publish]
B --> C{CHANGELOG section\nexists?}
C -- No --> D[Print: Skipping GitHub release\nReturn early]
C -- Yes --> E[Create/Update GitHub Release]
E --> F[extract_changelog_section\ncalled AGAIN line 915]
D --> F
F --> G{has_changelog_section\ntruthiness check}
G -- truthy\nnon-nil string,\nincludes empty string --> H["✓ CHANGELOG.md section found\nfor {version}"]
G -- nil --> I[Print Next steps:\nOption A: /update-changelog\nOption B: Manual steps]
Last reviewed commit: 30823d5 |
| changelog_path = File.join(monorepo_root, "CHANGELOG.md") | ||
| has_changelog_section = extract_changelog_section(changelog_path: changelog_path, version: released_gem_version) |
There was a problem hiding this comment.
Redundant extract_changelog_section file read
extract_changelog_section is already called internally by sync_github_release_after_publish (line 477 of the same file). This means CHANGELOG.md is read and parsed twice in a row with identical arguments. The result from that internal call is discarded and not returned to the caller.
Since this is a release script (not a hot path), the double file read isn't a correctness issue, but it is unnecessary. Consider refactoring sync_github_release_after_publish to return the extracted section so it can be reused, or caching the result:
# Instead of calling extract_changelog_section a second time, refactor
# sync_github_release_after_publish to return the section it already extracts.
changelog_section = sync_github_release_after_publish(...)
has_changelog_section = !changelog_section.nil?Alternatively, just call extract_changelog_section once before sync_github_release_after_publish and pass the result in.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| if has_changelog_section | ||
| puts "Changelog: ✓ CHANGELOG.md section found for #{released_gem_version}" | ||
| else | ||
| puts "Next steps:" | ||
| puts " Option A - Use Claude Code (recommended):" | ||
| puts " Run /update-changelog to analyze commits, write entries, and create a PR" | ||
| puts "" | ||
| puts " Option B - Manual:" | ||
| puts " 1. Ensure CHANGELOG.md entries are complete" | ||
| puts " 2. Push any follow-up changelog fixes if needed" | ||
| end | ||
| puts "" |
There was a problem hiding this comment.
Empty changelog section treated as present
extract_changelog_section returns the content of the section as a string (or nil when no header is found). If the header ### [x.y.z] exists but has no body, the function returns "" (an empty string after .strip). In Ruby, "" is truthy, so if has_changelog_section evaluates to true and the script prints "✓ CHANGELOG.md section found" even when the section contains no actual release notes.
This is the same assumption made by sync_github_release_after_publish, so the behaviour is at least consistent. However, it can give a false sense of completeness. Consider an explicit nil? check or checking !has_changelog_section.to_s.empty? to distinguish a missing section from an empty one:
if has_changelog_section && !has_changelog_section.empty?
puts "Changelog: ✓ CHANGELOG.md section found for #{released_gem_version}"
else
# show next-steps prompt
end
Post-merge ReviewOverall this is a clean improvement — removing the Bug: empty changelog section shows false-positive ✓
A minimal fix is to check for a non-empty string: has_changelog_section = extract_changelog_section(changelog_path: changelog_path, version: released_gem_version)
# ...
if has_changelog_section && !has_changelog_section.empty?Or change Inefficiency: CHANGELOG.md is read twice
Minor:
|
| 1. Ensure CHANGELOG.md entries are complete | ||
| 2. Push any follow-up changelog fixes if needed | ||
| changelog_path = File.join(monorepo_root, "CHANGELOG.md") | ||
| has_changelog_section = extract_changelog_section(changelog_path: changelog_path, version: released_gem_version) |
There was a problem hiding this comment.
Potential false-positive: extract_changelog_section returns "" (empty string) when the ### [X.Y.Z] header exists but has no body content. Since "" is truthy in Ruby, has_changelog_section will be truthy and the if branch below will print ✓ CHANGELOG.md section found even for a completely empty section.
Consider guarding with:
| has_changelog_section = extract_changelog_section(changelog_path: changelog_path, version: released_gem_version) | |
| has_changelog_section = extract_changelog_section(changelog_path: changelog_path, version: released_gem_version) | |
| has_changelog_section = nil if has_changelog_section&.empty? |
Or alternatively, fix extract_changelog_section to return nil when the stripped content is blank.
| changelog_path = File.join(monorepo_root, "CHANGELOG.md") | ||
| has_changelog_section = extract_changelog_section(changelog_path: changelog_path, version: released_gem_version) |
There was a problem hiding this comment.
Duplicate CHANGELOG.md read: sync_github_release_after_publish (called two lines above) already calls extract_changelog_section on the same file internally (release.rake:477). This reads and parses the file a second time for no additional benefit.
A cleaner solution would be for sync_github_release_after_publish to return the section string so the caller can reuse it, avoiding the double I/O.
…k cleanup (#2596) ## Summary - Added missing changelog entries for PRs #2439, #2477, #2554 - Stamped version header for 16.4.0.rc.9 (collapsed rc.8 into rc.9) - **Fixed rake task bug**: `collapse_prerelease_sections` removed section headers but left behind orphaned compare links at the bottom of CHANGELOG.md. Added `cleanup_collapsed_prerelease_links` to remove these links and update `[unreleased]` to compare from the last stable version. ## Changes 1. **CHANGELOG.md**: New entries + rc.9 stamp + removed orphaned `[16.4.0.rc.8]` link 2. **update_changelog.rake**: Added `cleanup_collapsed_prerelease_links` function, called from `prepare_changelog_for_auto_version` 3. **update_changelog_rake_helpers_spec.rb**: 3 new tests covering link cleanup (multi-prerelease chain, single prerelease, no prereleases) ## Skipped PRs (not user-visible) - #2593 — test only (lock instrumentation) - #2591 — test only (Jest clearMocks) - #2588 — internal refactoring (Thor shell output) - #2584 — docs restructuring - #2587 — internal tooling (release script) - #2589 — docs fix (JWT claim name) - #2586 — docs/CI (dead link removal) ## Test plan - [x] All 13 rake helper tests pass (3 new) - [ ] CI passes - [ ] After merge, run `rake release` to publish 16.4.0.rc.9 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed bin/setup failing in pnpm workspace member directories. * **New Features** * Added host configuration option for the Node Renderer Fastify worker. * **Improvements / Changed** * Automatic installation of react_on_rails_pro enabled for --rsc/--pro flags. * Clarified Pro-installation signaling related to immediate hydration warnings. * Updated changelog to include RC9 entries and ensure Unreleased links point to the correct base. * **Documentation** * Added startup warning and remediation guidance for unsafe compression middleware callbacks. * **Tests** * Added tests covering changelog prerelease-link cleanup behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
…k cleanup (#2596) ## Summary - Added missing changelog entries for PRs #2439, #2477, #2554 - Stamped version header for 16.4.0.rc.9 (collapsed rc.8 into rc.9) - **Fixed rake task bug**: `collapse_prerelease_sections` removed section headers but left behind orphaned compare links at the bottom of CHANGELOG.md. Added `cleanup_collapsed_prerelease_links` to remove these links and update `[unreleased]` to compare from the last stable version. ## Changes 1. **CHANGELOG.md**: New entries + rc.9 stamp + removed orphaned `[16.4.0.rc.8]` link 2. **update_changelog.rake**: Added `cleanup_collapsed_prerelease_links` function, called from `prepare_changelog_for_auto_version` 3. **update_changelog_rake_helpers_spec.rb**: 3 new tests covering link cleanup (multi-prerelease chain, single prerelease, no prereleases) ## Skipped PRs (not user-visible) - #2593 — test only (lock instrumentation) - #2591 — test only (Jest clearMocks) - #2588 — internal refactoring (Thor shell output) - #2584 — docs restructuring - #2587 — internal tooling (release script) - #2589 — docs fix (JWT claim name) - #2586 — docs/CI (dead link removal) ## Test plan - [x] All 13 rake helper tests pass (3 new) - [ ] CI passes - [ ] After merge, run `rake release` to publish 16.4.0.rc.9 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed bin/setup failing in pnpm workspace member directories. * **New Features** * Added host configuration option for the Node Renderer Fastify worker. * **Improvements / Changed** * Automatic installation of react_on_rails_pro enabled for --rsc/--pro flags. * Clarified Pro-installation signaling related to immediate hydration warnings. * Updated changelog to include RC9 entries and ensure Unreleased links point to the correct base. * **Documentation** * Added startup warning and remediation guidance for unsafe compression middleware callbacks. * **Tests** * Added tests covering changelog prerelease-link cleanup behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
…k cleanup (#2596) ## Summary - Added missing changelog entries for PRs #2439, #2477, #2554 - Stamped version header for 16.4.0.rc.9 (collapsed rc.8 into rc.9) - **Fixed rake task bug**: `collapse_prerelease_sections` removed section headers but left behind orphaned compare links at the bottom of CHANGELOG.md. Added `cleanup_collapsed_prerelease_links` to remove these links and update `[unreleased]` to compare from the last stable version. ## Changes 1. **CHANGELOG.md**: New entries + rc.9 stamp + removed orphaned `[16.4.0.rc.8]` link 2. **update_changelog.rake**: Added `cleanup_collapsed_prerelease_links` function, called from `prepare_changelog_for_auto_version` 3. **update_changelog_rake_helpers_spec.rb**: 3 new tests covering link cleanup (multi-prerelease chain, single prerelease, no prereleases) ## Skipped PRs (not user-visible) - #2593 — test only (lock instrumentation) - #2591 — test only (Jest clearMocks) - #2588 — internal refactoring (Thor shell output) - #2584 — docs restructuring - #2587 — internal tooling (release script) - #2589 — docs fix (JWT claim name) - #2586 — docs/CI (dead link removal) ## Test plan - [x] All 13 rake helper tests pass (3 new) - [ ] CI passes - [ ] After merge, run `rake release` to publish 16.4.0.rc.9 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed bin/setup failing in pnpm workspace member directories. * **New Features** * Added host configuration option for the Node Renderer Fastify worker. * **Improvements / Changed** * Automatic installation of react_on_rails_pro enabled for --rsc/--pro flags. * Clarified Pro-installation signaling related to immediate hydration warnings. * Updated changelog to include RC9 entries and ensure Unreleased links point to the correct base. * **Documentation** * Added startup warning and remediation guidance for unsafe compression middleware callbacks. * **Tests** * Added tests covering changelog prerelease-link cleanup behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
Summary
/update-changelogwhen missingputscalls for cleaner formattingTest plan
🤖 Generated with Claude Code
Note
Medium Risk
Touches the release automation path for publishing gems/npm packages; removing the inter-gem delay and changing post-release messaging could affect real release runs if OTP timing/CLI behavior differs from assumptions.
Overview
Removes the fixed 5-second pause between publishing
react_on_railsandreact_on_rails_progems, relying on the existing retry/OTP re-prompt flow instead.Refactors the end-of-release output from a heredoc into explicit
putscalls and makes the changelog guidance conditional: prints a success line whenCHANGELOG.mdalready contains the released version section, otherwise prints the “Next steps” instructions.Written by Cursor Bugbot for commit 30823d5. Configure here.
Summary by CodeRabbit