-
-
Notifications
You must be signed in to change notification settings - Fork 638
Rename bundlePath to serverBundleCachePath in node renderer #2008
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 change renames the `bundlePath` configuration option to `serverBundleCachePath` to better describe its purpose and avoid confusion with Shakapacker's public bundle path. Key changes: - Add `serverBundleCachePath` to Config interface - Deprecate `bundlePath` with warning messages - Support both env vars: RENDERER_SERVER_BUNDLE_CACHE_PATH (new) and RENDERER_BUNDLE_PATH (deprecated) - Update all internal code to use new name - Update documentation and examples - Update test files and helper functions The old `bundlePath` option continues to work with a deprecation warning to maintain backwards compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
👋 Thanks for your contribution! This PR will run CI tests based on the files you changed. If some tests are skipped and you want to run the full test suite (including minimum dependency tests), you can use these commands: CI Control Commands
Note:
View CI progress in the Actions tab. |
|
👋 Thanks for opening this PR! 🚀 Running Full CI SuiteBy default, PRs run a subset of CI jobs for faster feedback (latest Ruby/Node versions only). To run the complete CI suite including all dependency combinations and skipped jobs, comment: This will trigger:
The full CI suite takes longer but ensures compatibility across all supported versions before merging. |
|
Warning Rate limit exceeded@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 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 (12)
✨ 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 ReviewThis PR renames 🐛 Critical Bugworker.ts still uses the old property nameFile: The code is destructuring const { bundlePath, logHttpLevel, port, fastifyServerOptions, workersCount } = getConfig();This should be changed to const { serverBundleCachePath, logHttpLevel, port, fastifyServerOptions, workersCount } = getConfig();And the usage on line 154 should also be updated: const destinationPath = path.join(serverBundleCachePath, 'uploads', part.filename);Impact: This will break at runtime since ✅ Strengths
💡 Minor Suggestions1. Add test coverage for deprecation warningsConsider adding tests to verify:
Example test: test('logs deprecation warning when bundlePath is used', () => {
const warnSpy = jest.spyOn(log, 'warn');
buildConfig({ bundlePath: '/tmp/test' });
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('bundlePath is deprecated'));
});2. Consider the deprecation timelineThe Config interface marks
3. Variable naming in vm.tsThe
This would make it clearer they refer to a file path, not the cache directory. This is optional and not required for this PR. 🔍 Security ConsiderationsNo security concerns identified. The change is purely a refactoring of configuration naming. 🎯 Performance ConsiderationsNo performance impact. The change is nominal with minimal overhead from deprecation warnings. 📋 Test CoverageTest coverage is good - all test files have been updated. The only gap is the lack of explicit tests for the deprecation warnings themselves (see suggestion #1 above). ✨ SummaryThis is a well-planned refactoring that improves API clarity. Fix the critical bug in Action items:
🤖 Generated with Claude Code |
…lePath The worker.ts file was still using the old bundlePath property name in two places: 1. When destructuring config from getConfig() 2. When constructing the upload destination path This was a critical runtime bug - when users only set serverBundleCachePath (the new property name), the code would receive undefined for bundlePath, breaking file upload functionality. Changes: - Line 121: Updated destructuring to use serverBundleCachePath - Line 154: Updated path.join call to use serverBundleCachePath 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Code ReviewSummaryThis PR successfully renames ✅ Strengths1. Excellent Backwards Compatibility
2. Comprehensive Documentation Updates
3. Thorough Test Coverage
4. Clear Naming Improvement
5. Consistent Implementation
🔍 Observations & Minor Suggestions1. Deprecation Logic (configBuilder.ts:252-265) // Current implementation
if (
\!config.serverBundleCachePath ||
config.serverBundleCachePath === defaultConfig.serverBundleCachePath
) {
config.serverBundleCachePath = userConfig.bundlePath;
}Suggestion: Consider what happens if a user provides BOTH if ('bundlePath' in userConfig) {
log.warn('bundlePath is deprecated...');
// Warn if both are provided
if ('serverBundleCachePath' in userConfig) {
log.warn('Both bundlePath and serverBundleCachePath provided. Using serverBundleCachePath.');
} else if (\!config.serverBundleCachePath || ...) {
config.serverBundleCachePath = userConfig.bundlePath;
}
}However, this is a very minor edge case and the current implementation is acceptable. 2. Environment Variable Handling (configBuilder.ts:266-271) 3. Function Rename (configBuilder.ts:108) 4. Type Safety 🧪 Test Coverage AssessmentBased on the diff, test coverage appears comprehensive:
Suggestion for additional test: Consider adding an explicit test case for the deprecation warning to ensure it fires correctly: test('warns when using deprecated bundlePath', () => {
const consoleSpy = jest.spyOn(log, 'warn');
buildConfig({ bundlePath: '/some/path' });
expect(consoleSpy).toHaveBeenCalledWith(
expect.stringContaining('bundlePath is deprecated')
);
});Again, this is nice-to-have, not critical, as the deprecation logic is straightforward. 🔒 Security ConsiderationsNo security concerns identified. This is purely a refactoring/renaming change. ✅ ⚡ Performance ConsiderationsNo performance impact. The deprecation checks are minimal (string comparisons) and only run during config initialization. ✅ 📝 Code QualityStyle & Conventions:
Maintainability:
🎯 RecommendationsBefore Merge:
Nice-to-Have (Optional):
🏆 Overall AssessmentQuality Score: 9/10 This is a high-quality PR with:
The implementation is production-ready. The minor suggestions above are optional enhancements, not blockers. Recommendation: ✅ APPROVE (pending mandatory lint checks) Great work on this refactoring! The new naming will definitely reduce confusion for users. 🎉 |
… in Pro package Following the rename in the main package, update the Pro package's node-renderer to use serverBundleCachePath consistently: 1. configBuilder.ts: Add null check when using deprecated bundlePath as fallback 2. vm.ts: Use serverBundleCachePath instead of bundlePath for debug file paths These changes fix TypeScript compilation errors where bundlePath (optional) was being used where a string was required. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Documents the configuration option rename in the CHANGELOG under the Changed section, noting backward compatibility with deprecation warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
This PR renames the
bundlePathconfiguration option toserverBundleCachePathin the node renderer to better describe its purpose and avoid confusion with Shakapacker's public bundle path.Changes
serverBundleCachePathas the new property, deprecatedbundlePathRENDERER_SERVER_BUNDLE_CACHE_PATH(new) andRENDERER_BUNDLE_PATH(deprecated)serverBundleCachePathbundlePathoption continues to work with deprecation warningsWhy this change?
The name
bundlePathwas confusing because:serverBundleCachePathmakes the purpose explicitMigration guide
Users can update their configuration:
Before:
After:
Environment variable:
RENDERER_BUNDLE_PATHRENDERER_SERVER_BUNDLE_CACHE_PATHBoth the old config option and env var will continue to work with deprecation warnings.
Test plan
🤖 Generated with Claude Code
This change is