You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve release script with OTP support, reduced verbosity, and faster execution (#2047)
## Summary
Major improvements to the release process addressing all issues found
during production testing.
## Fixed Issues
### 1. ✅ NPM OTP Asked 3 Times
**Before:** User had to enter OTP separately for each of 3 NPM packages
**After:** Use `NPM_OTP=<code> rake release[version]` to reuse OTP
across all NPM publishes
### 2. ✅ Ruby Gem OTP Never Prompted (Crash)
**Before:** `NoMethodError: undefined method 'sh' for module
ReleaseHelpers`
**After:** Fixed by moving helper method to top-level instead of module
function, now has proper access to Rake's `sh` method
### 3. ✅ Git Hooks Add Significant Time
**Before:** Pre-commit and pre-push hooks ran on every git operation
(~10-30 seconds each)
**After:** All git operations now use `LEFTHOOK=0` to skip hooks during
release
### 4. ✅ Logs Excessively Verbose
**Before:** Massive output from bundle install operations
**After:** Uses `--quiet` flag unless `VERBOSE=1` is set
## Key Improvements
### OTP Support
- Add `NPM_OTP` env var to reuse OTP across all 3 NPM package publishes
- Add `RUBYGEMS_OTP` env var to reuse OTP across both gem publishes
- Add `--otp` flag support for `gem release` command
- Helpful messages suggesting OTP env var usage when not provided
### Performance
- Skip git hooks during release (`LEFTHOOK=0`) - saves ~40-60 seconds
total
- Add `--quiet` flag to bundle install commands (unless `VERBOSE=1`)
- Reduce verbose output significantly
### Reliability
- Increase retry delay from 3 to 5 seconds (matches inter-publication
delay)
- More specific exception handling (`Gem::CommandException`, `IOError`
vs `StandardError`)
- Make max_retries configurable via `GEM_RELEASE_MAX_RETRIES` env var
(default: 3)
### Usability
- Add `VERBOSE=1` env var to enable full logging when debugging
- Improved error messages and retry information
- Better documentation with environment variable examples
## Usage Examples
```bash
# Basic release (will prompt for OTP 5 times total: 3 NPM + 2 RubyGems)
rake release[patch]
# Fast release with no OTP prompts
NPM_OTP=123456 RUBYGEMS_OTP=789012 rake release[patch]
# Verbose mode for debugging
VERBOSE=1 rake release[patch]
# Custom retry count
GEM_RELEASE_MAX_RETRIES=5 rake release[patch]
```
## Test Plan
- [x] Code passes `bundle exec rubocop` with no offenses
- [x] Pre-commit hooks pass
- [ ] Manual testing: Next release should complete much faster with
optional OTP env vars
## Breaking Changes
None - all improvements are backward compatible. Existing release
workflow works as before, new features are opt-in via environment
variables.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>
0 commit comments