-
-
Notifications
You must be signed in to change notification settings - Fork 638
Refine release script error handling and retry logic #2046
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
**Problem:** The release script was failing when publishing Ruby gems because OTP codes were being reused or expiring between NPM and RubyGems publications. The script would fail with "Your OTP code is incorrect" after successfully publishing NPM packages. **Solution:** 1. Added retry logic with up to 3 attempts for each gem publication 2. Added explicit 5-second delay between gem publications to prevent OTP code reuse 3. Added clear prompts reminding users to generate fresh OTP codes 4. Created ReleaseHelpers module to reduce code nesting and improve maintainability **Changes:** - Created `ReleaseHelpers.publish_gem_with_retry` helper method - Added retry logic for both react_on_rails and react_on_rails_pro gems - Added 5-second delay between gem publications - Improved error messages with actionable guidance - Maintained RuboCop compliance (no block nesting violations) **Benefits:** - More robust release process that handles transient OTP failures - Clear user guidance on generating fresh OTP codes - Automatic retry on failure (reduces manual intervention) - Better separation between OTP-requiring operations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Improvements to publish_gem_with_retry helper: - More specific exception handling: Catch Gem::CommandException and IOError instead of broad StandardError to avoid catching unintended exceptions - Increase retry delay from 3 to 5 seconds to match inter-publication delay and provide better OTP timing consistency - Move module_function declaration before method definition for cleaner style - Make max_retries configurable via GEM_RELEASE_MAX_RETRIES environment variable while maintaining default of 3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Rate limit exceeded@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 53 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 - PR #2046: Refine release script error handling and retry logicOverviewThis PR refactors the ✅ Positives
|
…se-otp-timing * origin/master: (27 commits) Fix doctor command false version mismatch for beta/prerelease versions (#2064) Fix beta/RC version handling in generator (#2066) Document Rails Engine development nuances and add tests for automatic rake task loading (#2067) Add /run-skipped-tests as alias for /run-skipped-ci (#XXXX) (#2068) Fix: Add Rails 5.2-6.0 compatibility for compact_blank (#2058) Break CI circular dependency with non-docs change (#2065) Fix CI safety check to evaluate latest workflow attempt (#2062) Fix yalc publish (#2054) Add Shakapacker 9.0+ private_output_path integration for server bundles (#2028) Consolidate all beta versions into v16.2.0.beta.10 (#2057) Improve reliability of CI debugging scripts (#2056) Clarify monorepo changelog structure in documentation (#2055) Bump version to 16.2.0.beta.10 Bump version to 16.2.0.beta.9 Fix duplicate rake task execution by removing explicit task loading (#2052) Simplify precompile hook and restore Pro dummy app to async loading (#2053) Add Shakapacker precompile hook with ReScript support to Pro dummy app (#1977) Guard master docs-only pushes and ensure full CI runs (#2042) Refactor: Extract JS dependency management into shared module (#2051) Add workflow to detect invalid CI command attempts (#2037) ... # Conflicts: # rakelib/release.rake
Code Review for PR #2046SummaryThis PR improves the release script's OTP handling and retry logic. The changes are well-considered and address real pain points in the gem publishing process. ✅ Strengths
🔍 Minor Observations
🧪 Test CoverageThe PR description mentions:
Suggestions for testing:
🔒 Security Considerations✅ No security concerns:
⚡ Performance Considerations✅ Acceptable:
📋 Code Quality & Best Practices✅ Excellent adherence to:
🎯 Final VerdictLGTM! 👍 This PR improves the release process robustness without introducing risks. The changes are:
The current code in master appears to have additional enhancements (OTP parameter support) beyond the original PR, which is even better. 💡 Optional Future EnhancementsConsider for future PRs (not blockers):
Generated with Claude Code |
|
Closing this PR as the changes have already been incorporated into master via PR #2047. The release.rake file is now identical between this branch and master after merging the latest master changes. |
Summary
Improves the
publish_gem_with_retryhelper in the release script with more robust error handling and better OTP timing.Key Improvements
More specific exception handling: Now catches
Gem::CommandExceptionandIOErrorinstead of broadStandardError, avoiding catching unintended exceptions likeNoMethodErrororTypeErrorIncreased retry delay: Changed from 3 to 5 seconds to match the inter-publication delay (line 270), providing better consistency for OTP operations and reducing timing-related failures
Cleaner module style: Moved
module_functiondeclaration before method definition for more conventional Ruby styleConfigurable retry count: Made
max_retriesconfigurable viaGEM_RELEASE_MAX_RETRIESenvironment variable while maintaining the sensible default of 3Test Plan
bundle exec rubocopwith no offensesRelated
Addresses code review feedback on PR #2029 about improving OTP handling robustness.
🤖 Generated with Claude Code