Skip to content

Conversation

@justin808
Copy link
Member

Summary

Adds a clean, simple release script that matches the react_on_rails pattern but without npm/yarn parts.

Changes

  1. Removed bundler/gem_tasks - Was causing task conflicts with our custom release task
  2. Created rakelib/release.rake - Simple release task matching react_on_rails pattern
  3. Added rakelib/task_helpers.rb - Helper module for common functionality
  4. Fixed gem bump issues:
    • Changed --version to -v flag (correct syntax)
    • Added --file flag to specify version file location
    • Fixed sh_in_dir to use Dir.chdir instead of subshell

Release Workflow

rake release[1.19.0]        # Release version 1.19.0
rake release[1.19.0,true]   # Dry run
rake release                # Auto patch bump

Test Results

✅ Dry run tested successfully:

  • Version bumped correctly from 1.18.0 to 1.19.0
  • Git operations work properly
  • Post-release instructions displayed

This is a clean PR focused only on the release script functionality.

🤖 Generated with Claude Code

justin808 and others added 5 commits October 1, 2025 16:41
Removed `require 'bundler/gem_tasks'` from Rakefile because it creates
a conflicting `release` task that shadows our custom release task in
rakelib/release.rake.

Added manual :build task to replace what bundler/gem_tasks provided.

This matches the react_on_rails pattern where rakelib/release.rake
provides the release task without conflicts.

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

Co-Authored-By: Claude <[email protected]>
Cleaned up release.rake to exactly match react_on_rails pattern but
without the npm/release-it parts that aren't needed for cypress-on-rails.

Removed from react_on_rails version:
- npm_version conversion logic
- release-it command execution
- Gemfile.lock updates for dummy apps
- gemspec cleanup for subdirectories
- GitHub packages publishing

Kept from react_on_rails version:
- Same structure and flow
- RaisingMessageHandler class
- TaskHelpers include pattern
- git pull --rebase
- gem bump with -v flag (fixed from --version)
- gem release to rubygems.org
- Post-release CHANGELOG reminder

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

Co-Authored-By: Claude <[email protected]>
The build task was not needed:
- gem release command handles building the gem
- We don't need a separate build step
- The default task can just run specs

This makes the Rakefile cleaner and simpler.
@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2025

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 8615fc7 and 4c6396a.

📒 Files selected for processing (3)
  • Rakefile (1 hunks)
  • rakelib/release.rake (2 hunks)
  • rakelib/task_helpers.rb (1 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin808/simple-release-only

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link

claude bot commented Oct 2, 2025

Code Review: PR #192 - Add simple release script (gem-only)

Summary

This PR adds a clean release automation script for the gem. The implementation is well-structured and follows the react_on_rails pattern appropriately. Overall, this is a solid PR with good design decisions.

Strengths

  1. Clean separation of concerns - TaskHelpers module provides reusable utilities
  2. Proper environment isolation - Uses Bundler.with_unbundled_env to avoid bundler conflicts
  3. Good user guidance - Clear task description and error messages
  4. Safety check - Verifies no uncommitted changes before release
  5. Dry run support - Allows testing without publishing

Potential Issues

  1. Missing newline at EOF - Rakefile and rakelib/task_helpers.rb are missing trailing newlines. This is minor but can cause git diff noise.

  2. Error handling could be improved - The gem bump and gem release commands could fail without clear error messages. Consider wrapping critical commands in begin/rescue blocks.

  3. Git pull without checking branch - Line 42 of release.rake runs git pull --rebase without verifying the current branch. Could accidentally pull wrong branch changes.

  4. RaisingMessageHandler appears unused - The RaisingMessageHandler class is defined but never used in the task. Either use it or remove it to avoid confusion.

Security Considerations

  • No hardcoded credentials
  • Uses standard gem publishing flow with 2FA prompts
  • No unsafe shell command interpolation
  • Minor: The sh_in_dir method executes shell commands from user input (via task args), but this is mitigated by the fact that only authorized maintainers run release tasks

Performance Considerations

  • No performance concerns - this is a developer-only release task
  • Efficient use of Dir.chdir instead of subshell for directory changes

Test Coverage

  • No automated tests found for the release task or task helpers
  • The PR description mentions manual testing with dry run, which is good
  • Recommendation: Consider adding specs for gem_root helper, sh_in_dir, error handling, and dry run behavior

Additional Suggestions

  1. Consider adding version validation - Validate that the version format matches semantic versioning before attempting bump
  2. Post-release git tag - The script does not create a git tag for the release. Consider adding git tag and git push --tags
  3. Branch protection check - Verify current branch name to prevent accidental releases from feature branches

Verdict

APPROVED with minor suggestions

This is a well-implemented release script that achieves its goals cleanly. The main suggestions are:

  1. Add missing newlines at EOF
  2. Remove unused RaisingMessageHandler class or use it
  3. Add basic test coverage
  4. Consider branch validation before git operations

Great work on keeping this focused and matching the established patterns!

@justin808 justin808 merged commit f202e39 into master Oct 2, 2025
5 checks passed
@justin808 justin808 deleted the justin808/simple-release-only branch October 2, 2025 04:37
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