CI Perf Lint

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:

  1. The repository uses Rails (detected via Gemfile gem "rails").
  2. The Rails version is 7.0.x or 7.1.x (below the 7.2 milestone).
  3. The Ruby version (from .ruby-version or Gemfile) is 3.x or compatible.
  4. At least one CI job runs Rails-related commands (rspec, rails test, rake test, assets:precompile).

Not Triggered When

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