SWITCHING_CI_CONFIGS.md
This guide explains how to switch between different CI test configurations locally to replicate CI failures.
# Check your current configuration
bin/ci-switch-config status
# Switch to minimum dependencies (Ruby 3.2, Node 20)
bin/ci-switch-config minimum
# Switch back to latest dependencies (Ruby 3.4, Node 22)
bin/ci-switch-config latest
The project runs tests against two configurations:
--frozen-lockfileSwitch to minimum when:
dummy-app-integration-tests (3.2, 20, minimum) but passes on latestSwitch to latest when:
You must have a version manager installed to manage Ruby and Node versions. The script supports:
# Install mise
brew install mise
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc
source ~/.zshrc
# mise automatically reads from .tool-versions
# Install asdf
brew install asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ~/.zshrc
source ~/.zshrc
# Install plugins
asdf plugin add ruby
asdf plugin add nodejs
# Install rvm for Ruby
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
# Install nvm for Node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Add to shell config (the installer usually does this automatically)
Important Notes:
bin/ci-switch-config status
This shows:
bin/ci-switch-config minimum
This will:
.tool-versions with Ruby 3.2.8 and Node 20.18.1script/convert to downgrade dependencies:
node_modules and pnpm-lock.yaml--frozen-lockfileAfter switching, run:
# Reload your shell to pick up new Ruby/Node versions
cd <project-root>
mise current # For mise users
# asdf current # For asdf users
# rvm current && nvm current # For rvm+nvm users
# Build and test
rake node_package
cd react_on_rails/spec/dummy
bin/shakapacker-precompile-hook
RAILS_ENV=test bin/shakapacker
cd ../..
bundle exec rake run_rspec:all_dummy
bin/ci-switch-config latest
This will:
.tool-versions with Ruby 3.4.3 and Node 22.12.0script/convert)node_modules and pnpm-lock.yaml--frozen-lockfileAfter switching, run:
# Reload your shell to pick up new Ruby/Node versions
cd <project-root>
mise current # For mise users
# asdf current # For asdf users
# rvm current && nvm current # For rvm+nvm users
# Build and test
rake node_package
cd react_on_rails/spec/dummy
bin/shakapacker-precompile-hook
RAILS_ENV=test bin/shakapacker
cd ../..
bundle exec rake run_rspec:all_dummy
When switching to minimum, these files are modified:
.tool-versions - Ruby/Node versionsGemfile.development_dependencies - Shakapacker gem versionpackage.json - React versions, dev dependencies removedreact_on_rails/spec/dummy/package.json - React and Shakapacker versionspackages/react-on-rails-pro/package.json - Test scripts modifiednode_modules/, pnpm-lock.yaml - Cleaned and regeneratedreact_on_rails/spec/dummy/node_modules/, react_on_rails/spec/dummy/pnpm-lock.yaml - Cleaned and regeneratedWhen switching to latest, these files are restored from git.
# 1. Check current config
bin/ci-switch-config status
# 2. Switch to minimum
bin/ci-switch-config minimum
# 3. Reload shell
cd <project-root>
# 4. Verify versions changed
ruby --version # Should show 3.2.x
node --version # Should show v20.x
# 5. Build and test
rake node_package
cd react_on_rails/spec/dummy
bin/shakapacker-precompile-hook
RAILS_ENV=test bin/shakapacker
cd ../..
# 6. Run the failing tests
bundle exec rake run_rspec:all_dummy
# 7. Fix the issue
# 8. Switch back when done
bin/ci-switch-config latest
# Test in latest (current default)
bin/ci-switch-config status
bundle exec rake run_rspec:all_dummy
# Switch and test in minimum
bin/ci-switch-config minimum
rake node_package
cd react_on_rails/spec/dummy && bin/shakapacker-precompile-hook && RAILS_ENV=test bin/shakapacker && cd ../..
bundle exec rake run_rspec:all_dummy
# Switch back
bin/ci-switch-config latest
After switching, you need to reload your shell:
cd <project-root>
# The cd command will trigger mise/asdf to load the new versions
ruby --version # Verify it changed
If your version manager doesn't automatically switch:
For mise:
mise install # Install missing versions from mise.toml or .tool-versions
For asdf:
asdf install # Install missing versions from .tool-versions
asdf reshim ruby
asdf reshim nodejs
For rvm + nvm:
# Install and use specific Ruby version
rvm install 3.2.8 # or 3.4.3
rvm use 3.2.8
# Install and use specific Node version
nvm install 20.18.1 # or 22.12.0
nvm use 20.18.1
# Verify versions
ruby --version
node --version
If you get package resolution errors:
# Clean everything and try again
rm -rf node_modules pnpm-lock.yaml react_on_rails/spec/dummy/node_modules react_on_rails/spec/dummy/pnpm-lock.yaml
pnpm install -r
cd react_on_rails/spec/dummy && pnpm install
The script will warn you if you have uncommitted changes. You can:
If git restore doesn't work:
# Manually restore from git
git restore Gemfile.development_dependencies package.json react_on_rails/spec/dummy/package.json packages/react-on-rails-pro/package.json
# Then run latest again
bin/ci-switch-config latest
This script works well with the other CI debugging tools:
# 1. Check what failed in CI
bin/ci-rerun-failures
# 2. If it's a minimum config failure, switch
bin/ci-switch-config minimum
# 3. Run the specific failing tests
pbpaste | bin/ci-run-failed-specs
# 4. Switch back when done
bin/ci-switch-config latest
CLAUDE.md - Main development guide with CI debugging infobin/ci-rerun-failures - Re-run only failed CI jobs locallybin/ci-run-failed-specs - Run specific failing RSpec examplesbin/ci-local - Smart test detection based on changes