prefer-rails-performance-milestone
Detects repositories that use Rails 7.0.x or 7.1.x with an active CI pipeline and recommends upgrading to Rails 7.2.x for CI performance improvements.
Why This Matters
Rails 7.2 enables YJIT by default in development and test environments
(config.yjit = true). With Ruby 3.3+ YJIT, Rails test suites can run
noticeably faster without rewriting application code.
The benefit depends on the suite. Rails 8.1 changed the default to enable YJIT
only outside local environments (config.yjit = !Rails.env.local?), because
development and test reload code and redefine methods (for example with
mocking), where YJIT is not generally faster. This rule therefore stays scoped
to the 7.0/7.1 → 7.2 milestone and does not push newer Rails majors for YJIT.
Detection
A finding is emitted when all of the following hold:
- The repository uses Rails (detected via
Gemfilegem "rails"). - The Rails version is 7.0.x or 7.1.x (below the 7.2 milestone).
- The Ruby version (from
.ruby-versionorGemfile) is 3.x or compatible. - At least one CI job runs Rails-related commands (
rspec,rails test,rake test,assets:precompile).
Not Triggered When
- Rails 7.2+ is already in use.
- Rails 6.x or older.
- No Rails CI commands are visible in workflows.
- The repository does not use Rails at all.
Resolution
Upgrade Rails:
- gem "rails", "~> 7.1.0"
+ gem "rails", "~> 7.2.0"
Run bundle update rails and address any compatibility notes in the
Rails 7.2 upgrade guide.
Severity
- Warning — when a Rails 7.0/7.1 repository actively runs Rails CI.