-
-
Notifications
You must be signed in to change notification settings - Fork 639
Skip version validation when package.json doesn't exist during setup #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This fixes an error that occurs when running `rake shakapacker:install` on a fresh Rails application. The validation was introduced in commit 0d87ea7 and runs during Rails initialization via an `after_initialize` hook. The problem: `shakapacker:install` needs to load the Rails environment before it can create package.json, but the version validation runs during environment loading and fails because package.json doesn't exist yet. The fix: Skip validation if package.json doesn't exist yet. This allows installation tasks to complete successfully while still validating versions on normal Rails application startup. This issue was reported in CI logs where `rake shakapacker:install` would fail with "package.json file not found" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Warning Rate limit exceeded@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 43 seconds before requesting another review. ⌛ 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. 📒 Files selected for processing (1)
✨ 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 |
Code Review: Skip version validation when package.json doesn't exist during setupSummaryThis PR adds a guard clause to skip version validation when ✅ Strengths
🔍 Code Quality AssessmentCorrectnessThe implementation is correct and follows Rails patterns:
Style & Conventions✅ Follows project conventions per CLAUDE.md:
📝 Suggestions for Improvement1. Test Coverage
|
Summary
Fixes an error that occurs when running
rake shakapacker:installon a fresh Rails application. The version validation was introduced in commit 0d87ea7 (#1881) and runs during Rails initialization via anafter_initializehook.Problem
shakapacker:installneeds to load the Rails environment before it can create package.json, but the version validation runs during environment loading and fails because package.json doesn't exist yet.Error message:
Solution
Skip validation if package.json doesn't exist yet. This allows installation tasks to complete successfully while still validating versions on normal Rails application startup.
Root Cause Analysis
shakapacker:installrake task needs to load the Rails environment to run (viaconfig/environment.rb)Testing
bundle exec rubocoppassesjustin808/shakapacker-9.3.0(commit 42c109c)Related
This fix was already implemented in the
justin808/shakapacker-9.3.0branch (commit 42c109c) but hadn't been merged to master yet.🤖 Generated with Claude Code
This change is