Skip to content

Cover Rails 8.1 - #17

Merged
Fivell merged 1 commit into
masterfrom
ci/rails-8-1
Oct 1, 2026
Merged

Fivell merged 1 commit into
masterfrom
ci/rails-8-1

Conversation

@Fivell

@Fivell Fivell commented Oct 1, 2026

Copy link
Copy Markdown
Member

Rails 8.1 has been out for a while (8.1.4 at time of writing) and the matrix did not cover it. Adding it fails immediately, and not because of anything in this gem:

NameError:
  undefined local variable or method `stale_when_importmap_changes'
  for class ApplicationController
# spec/rails/rails-8.1.4/app/controllers/application_controller.rb:6

rails new on 8.1 emits that macro into the generated ApplicationController. It comes from importmap-rails. This dummy app runs on Sprockets — sprockets-rails + sass-rails, because that is what Active Admin 3 needs — so the gem is absent and the app raises at boot, before a single example runs. Sprockets is fine; the generated scaffold is what assumes importmap.

--skip-javascript stops the macro being generated. This is the same fix active_admin_import already uses for its 8.1 leg.

One difference worth checking rather than assuming: that repo's specs run on rack_test and never execute JavaScript, so losing JS setup costs it nothing. This suite drives real Chrome through cuprite. Verified it is still fine — app/assets/javascripts/active_admin.js is created by active_admin:install, not by rails new, so --skip-javascript does not touch the bundle the specs exercise.

Checked locally before pushing:

Rails result
7.1.0 19 examples, 0 failures
8.0.0 19 examples, 0 failures
8.1.4 19 examples, 0 failures

Active Admin 3.2 is excluded on 8.1 for the same reason it is already excluded on 8.0 — it predates Rails 8 support.

Note on the versions being tested

Worth stating plainly, though this PR does not act on it. As of today:

Rails EOL
7.1 2025-10-01
7.2 2026-08-09
8.0 2026-11-07
8.1 2027-10-10

So two of the three legs this matrix had were already past end of life, and the current series was untested. This PR fixes the second half. Dropping the EOL legs is a separate decision — 7.1 is the floor the gemspec declares, so dropping it from CI should come with raising that floor, which is a user-visible change and belongs in its own PR.

The matrix stopped at 8.0. Adding 8.1 fails before any example runs:

  NameError: undefined local variable or method
  `stale_when_importmap_changes' for class ApplicationController

rails new on 8.1 emits that macro into the generated ApplicationController.
It comes from importmap-rails, and this dummy app runs on Sprockets because
that is what Active Admin 3 needs, so the gem is absent and the app raises
at boot. Sprockets is not the problem; the generated scaffold assuming
importmap is.

Skip JavaScript during generation so the macro never appears. The sibling
active_admin_import uses the same fix, with the caveat that its specs run
on rack_test. This suite drives real Chrome, so the relevant question is
whether anything the specs need goes missing: it does not, because
app/assets/javascripts/active_admin.js comes from active_admin:install
rather than from rails new. Confirmed green on 7.1, 8.0 and 8.1.

Active Admin 3.2 is excluded on 8.1 for the reason it is already excluded
on 8.0: it predates Rails 8 support.
@Fivell
Fivell merged commit 79288c8 into master Oct 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant