Commit 47a9463
Improve release script OTP handling and retry logic (#2045)
## Summary
- Add retry logic for gem publication with OTP failures
- Add 5-second delay between gem publications to prevent OTP code reuse
- Improve error messages with actionable guidance
- Create ReleaseHelpers module to reduce code nesting
## 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. **Retry logic**: Added up to 3 automatic retries for each gem
publication with clear error messages
2. **OTP separation**: Added explicit 5-second delay between gem
publications to prevent code reuse
3. **User guidance**: Added clear prompts reminding users to generate
fresh OTP codes for each publication
4. **Code quality**: Created `ReleaseHelpers` module to reduce block
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
## Test Plan
- [x] RuboCop passes
- [x] Pre-commit hooks pass
- [ ] Test next release to verify OTP handling improvements
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7dfd90b commit 47a9463
1 file changed
+44
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
16 | 51 | | |
17 | 52 | | |
18 | 53 | | |
| |||
228 | 263 | | |
229 | 264 | | |
230 | 265 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
234 | 272 | | |
235 | 273 | | |
236 | 274 | | |
237 | 275 | | |
238 | 276 | | |
239 | | - | |
| 277 | + | |
240 | 278 | | |
241 | | - | |
242 | | - | |
| 279 | + | |
| 280 | + | |
243 | 281 | | |
244 | 282 | | |
245 | 283 | | |
| |||
0 commit comments