Improve release-task dry-run UX and AUTO_CONFIRM docs#981
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 improves the dry-run experience for Shakapacker's release tasks by adding explicit "skipping confirmation" messages when prompts are bypassed during dry-run, printing the would-run
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant create_release as create_release task
participant confirm as confirm_or_abort!
participant publish as publish_or_update_github_release
participant gh_cmd as github_release_command (new helper)
participant GitHub as GitHub API
User->>create_release: rake create_release[...,true]
alt CHANGELOG version found (dry_run=true)
create_release->>create_release: puts "DRY RUN: Skipping confirmation prompt..."
Note right of create_release: Previously called confirm_or_abort!
end
alt patch version fallback (dry_run=true)
create_release->>create_release: puts "DRY RUN: Skipping confirmation prompt..."
end
create_release->>publish: publish_or_update_github_release(dry_run: true)
publish->>gh_cmd: github_release_command(notes_file_path: "<release-notes-file>")
gh_cmd->>GitHub: gh release view (new API call in dry-run)
GitHub-->>gh_cmd: exists? true/false
gh_cmd-->>publish: ["gh", "release", "create/edit", ...]
publish->>User: DRY RUN: Would run: gh release create/edit ...
Last reviewed commit: 0aedeee |
ReviewOverall the changes are clean and well-motivated — the dry-run UX improvement and NotesDry-run always previews
Docs: The new |
| abort "❌ Git tag #{tag.inspect} was not found locally or remotely. Verify the tag exists before syncing GitHub release." | ||
| end | ||
|
|
||
| def github_release_command(gem_root: nil, release_context:, notes_file_path:, probe_existing: true) |
There was a problem hiding this comment.
The gem_root: keyword is required here even when probe_existing: false, where it's never used. The dry-run caller passes gem_root: gem_root purely to satisfy the signature.
An earlier iteration of this PR used gem_root: nil with an internal guard, which was more expressive — callers that don't need the probe don't need to pass gem_root at all. Consider restoring that pattern:
| def github_release_command(gem_root: nil, release_context:, notes_file_path:, probe_existing: true) | |
| def github_release_command(gem_root: nil, release_context:, notes_file_path:, probe_existing: true) |
And add back the guard before the probe:
abort "❌ Internal error: github_release_command requires gem_root when probe_existing is true." unless gem_rootThis makes the API more honest about which argument is actually required and when.
| ) | ||
| puts "DRY RUN: Would create or update GitHub release #{release_context[:tag]}#{release_context[:prerelease] ? ' (prerelease)' : ''}" | ||
| puts "DRY RUN: Would run: #{Shellwords.join(preview_command)}" |
There was a problem hiding this comment.
The three-line dry-run block is functional, but the first and third lines express the same caveat in slightly different ways. The third line is the more precise one.
Consider collapsing to avoid the redundancy and potential confusion about what the command preview actually represents:
| ) | |
| puts "DRY RUN: Would create or update GitHub release #{release_context[:tag]}#{release_context[:prerelease] ? ' (prerelease)' : ''}" | |
| puts "DRY RUN: Would run: #{Shellwords.join(preview_command)}" | |
| puts "DRY RUN: Would run (assuming new release): #{Shellwords.join(preview_command)}" | |
| puts "DRY RUN: If the release already exists, the live run will use `gh release edit` instead." |
Dropping the first generic "Would create or update" line keeps the output focused on what's actionable — the actual command.
ReviewClean, low-risk improvement to the release tooling UX. The refactoring into IssuesMinor API inconsistency — see inline on Dry-run output redundancy — see inline on the three-line dry-run block. The first and third lines both hedge about create-vs-edit; collapsing to two lines with a clearer label ("assuming new release") avoids the redundancy. Looks good
|
| ) | ||
| puts "DRY RUN: Would create or update GitHub release #{release_context[:tag]}#{release_context[:prerelease] ? ' (prerelease)' : ''}" | ||
| puts "DRY RUN: Would run: #{Shellwords.join(preview_command)}" | ||
| puts "DRY RUN: If the release already exists, the live run will use `gh release edit` instead." |
There was a problem hiding this comment.
The dry-run always shows the gh release create command (because probe_existing: false), but the follow-up note on this very line tells the user the live run might use gh release edit instead. This means the "Would run:" line can be actively misleading when the release already exists.
Two options to consider:
Option A – Probe existence during dry-run too (same as the live path), passing gem_root:
| puts "DRY RUN: If the release already exists, the live run will use `gh release edit` instead." | |
| preview_command = github_release_command( | |
| gem_root: gem_root, | |
| release_context: release_context, | |
| notes_file_path: "<release-notes-file>", | |
| probe_existing: true | |
| ) |
This shows the exact command that would run, at the cost of one extra gh release view call.
Option B – Keep probe_existing: false but be explicit that only the create form is shown:
| puts "DRY RUN: If the release already exists, the live run will use `gh release edit` instead." | |
| puts "DRY RUN: Would create or update GitHub release #{release_context[:tag]}#{release_context[:prerelease] ? ' (prerelease)' : ''}" | |
| puts "DRY RUN: Would run (create form; edit form used if release already exists): #{Shellwords.join(preview_command)}" |
Less network traffic, still honest about the uncertainty.
| create_command << "--prerelease" if release_context[:prerelease] | ||
| return create_command unless probe_existing | ||
|
|
||
| abort "❌ Internal error: github_release_command requires gem_root when probe_existing is true." unless gem_root |
There was a problem hiding this comment.
The gem_root: nil default combined with a runtime abort when probe_existing: true is a mixed API contract. A caller who forgets gem_root: gets a Ruby nil rather than an ArgumentError, and the error won't surface until after the gh release view probe is attempted (which would pass nil to chdir:).
Consider making gem_root required when probe_existing is true by documenting the intent more clearly, or splitting into two methods. That said, since this is internal release tooling and the abort message is clear, this is low severity.
Review SummaryOverall this is a nice UX improvement to the release tooling — explicit dry-run messaging and the Two inline comments posted:
No security or performance concerns — the changes are isolated to release rake tasks and documentation. |
### Summary Adds the v9.7.0 changelog section with release notes for all user-visible changes since v9.6.1: - **Added**: rspack v2 support (PR #975) - **Fixed**: Config exporter path traversal and annotation format validation (PR #914) - **Fixed**: `webpack-subresource-integrity` v5 named export handling (PR #978, fixes #972) Version diff links at the bottom of the file are updated accordingly. ### Pull Request checklist - [x] ~Add/update test to cover these changes~ - [x] ~Update documentation~ - [x] Update CHANGELOG file ### Other Information Non-user-visible PRs (#920, #965, #970, #971, #977, #979, #981, #982) were intentionally excluded per changelog policy. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only change updating `CHANGELOG.md`; no runtime code or dependency changes are introduced in this PR. > > **Overview** > Adds a new `v9.7.0` section to `CHANGELOG.md` documenting user-visible changes (rspack v2 support and two fixes around config export security/validation and `webpack-subresource-integrity` v5 exports). > > Updates the compare links at the bottom so `[Unreleased]` now compares from `v9.7.0`, and adds the new `[v9.7.0]` tag link. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8942a43. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added rspack v2 support * **Bug Fixes** * Improved security and validation handling <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
## Summary - add explicit dry-run messaging when confirmation prompts are skipped in `create_release` - print the would-run GitHub release CLI command during dry-run release sync - refactor GitHub release command construction into a helper for consistency - document `AUTO_CONFIRM=true` usage in `docs/releasing.md` and note dry-run prompt behavior ## Testing - `bundle exec rubocop rakelib/release.rake` - `yarn prettier --check docs/releasing.md` Refs #947. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes are limited to release tooling UX and documentation, with no runtime application behavior impact. The main risk is minor confusion if the new dry-run messaging or `gh` command preview is incorrect. > > **Overview** > Improves the release rake tasks’ *dry-run UX* by emitting explicit messages when confirmation prompts are skipped and by printing the exact `gh release` command that would run when syncing GitHub releases. > > Refactors GitHub release command construction into a shared `github_release_command` helper for consistent create/edit behavior, and updates `docs/releasing.md` to document `AUTO_CONFIRM=true` for non-interactive maintainer runs and note the enhanced dry-run output. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0aedeee. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
### Summary Adds the v9.7.0 changelog section with release notes for all user-visible changes since v9.6.1: - **Added**: rspack v2 support (PR #975) - **Fixed**: Config exporter path traversal and annotation format validation (PR #914) - **Fixed**: `webpack-subresource-integrity` v5 named export handling (PR #978, fixes #972) Version diff links at the bottom of the file are updated accordingly. ### Pull Request checklist - [x] ~Add/update test to cover these changes~ - [x] ~Update documentation~ - [x] Update CHANGELOG file ### Other Information Non-user-visible PRs (#920, #965, #970, #971, #977, #979, #981, #982) were intentionally excluded per changelog policy. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only change updating `CHANGELOG.md`; no runtime code or dependency changes are introduced in this PR. > > **Overview** > Adds a new `v9.7.0` section to `CHANGELOG.md` documenting user-visible changes (rspack v2 support and two fixes around config export security/validation and `webpack-subresource-integrity` v5 exports). > > Updates the compare links at the bottom so `[Unreleased]` now compares from `v9.7.0`, and adds the new `[v9.7.0]` tag link. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8942a43. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added rspack v2 support * **Bug Fixes** * Improved security and validation handling <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
Summary
create_releaseAUTO_CONFIRM=trueusage indocs/releasing.mdand note dry-run prompt behaviorTesting
bundle exec rubocop rakelib/release.rakeyarn prettier --check docs/releasing.mdRefs #947.
Note
Low Risk
Low risk: changes are limited to release tooling UX and documentation, with no runtime application behavior impact. The main risk is minor confusion if the new dry-run messaging or
ghcommand preview is incorrect.Overview
Improves the release rake tasks’ dry-run UX by emitting explicit messages when confirmation prompts are skipped and by printing the exact
gh releasecommand that would run when syncing GitHub releases.Refactors GitHub release command construction into a shared
github_release_commandhelper for consistent create/edit behavior, and updatesdocs/releasing.mdto documentAUTO_CONFIRM=truefor non-interactive maintainer runs and note the enhanced dry-run output.Written by Cursor Bugbot for commit 0aedeee. Configure here.