Skip to content

1.2.x: Backport JRuby 10.0 and Rails 8.0 compatbility#419

Merged
chadlwilson merged 5 commits intojruby:1.2-stablefrom
chadlwilson:1.2-safe-jruby-10
Apr 17, 2026
Merged

1.2.x: Backport JRuby 10.0 and Rails 8.0 compatbility#419
chadlwilson merged 5 commits intojruby:1.2-stablefrom
chadlwilson:1.2-safe-jruby-10

Conversation

@chadlwilson
Copy link
Copy Markdown
Contributor

@chadlwilson chadlwilson commented Apr 17, 2026

Backports #273 (and later minor JRiuby 10 bumps) to the 1.2.x branch by

  • housing a test-only simple stub of the JRuby-10-removed CompatVersion class (used by RackConfig API)
  • removing useless logic that processed CompatVersion

This is a simpler and safer alternative to #360 (which created a dummy CompatVersion class in production code itself), and deals with the concerns there. This involves no such change, and instead disables the problematic RackConfig detail capturing logic on JRuby 10, thus is much safer.

Since CompatVersion has been a no-op on JRuby itself for a very long time, removing the actual implementation on 1.2 does no harm, and API compatibility has been retained. The jruby.compat.version jruby-rack init properly, if set, will just be ignored, and the same RUBY_21 default value from earlier returned.

Additional context

Generally 1.2.x is already working with JRuby 10 if the RackConfig was not used in any way that caused the (removed) CompatVersion class to be loaded. In particular, if there were notfailures during rack initialization there are no known issues with JRuby 10. Unfortunately during dev, people often have startup issues, so they'd get blocked at this problem.

This will make it easier for folks to move to JRuby 10 within Warbler without having to move to jruby-rack 1.3, which can then focus on Rack 3.x support.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports JRuby 10 / Rails 8 compatibility work onto the 1.2.x line by removing the now-problematic CompatVersion handling and expanding the test/appraisal matrix to cover Rails 8 + JRuby 10.

Changes:

  • Removes/neutralizes jruby.compat.version / CompatVersion processing (and avoids JRuby 10 startup-capture failures by disabling config capture on JRuby 10).
  • Adds a Rails 8.0 stub app plus a new Rails 8 appraisal, and updates CI to run against JRuby 10.
  • Updates/adjusts specs to reflect new compat behavior and add regression coverage for exception-capture failures.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/spec/stub/rails80/public/robots.txt Adds Rails 8 stub public asset for integration/appraisal testing.
src/spec/stub/rails80/config/routes.rb Adds Rails 8 stub routing config.
src/spec/stub/rails80/config/puma.rb Adds Rails 8 stub Puma config.
src/spec/stub/rails80/config/master.key Adds Rails 8 stub credentials key (test stub parity with other Rails stubs).
src/spec/stub/rails80/config/locales/en.yml Adds Rails 8 stub locale file.
src/spec/stub/rails80/config/initializers/inflections.rb Adds Rails 8 stub initializer.
src/spec/stub/rails80/config/initializers/filter_parameter_logging.rb Adds Rails 8 stub initializer for filtered params.
src/spec/stub/rails80/config/initializers/content_security_policy.rb Adds Rails 8 stub CSP initializer.
src/spec/stub/rails80/config/environments/test.rb Adds Rails 8 stub test env config.
src/spec/stub/rails80/config/environments/production.rb Adds Rails 8 stub production env config.
src/spec/stub/rails80/config/environments/development.rb Adds Rails 8 stub development env config.
src/spec/stub/rails80/config/environment.rb Adds Rails 8 stub environment bootstrap.
src/spec/stub/rails80/config/credentials.yml.enc Adds Rails 8 stub encrypted credentials (for stub completeness).
src/spec/stub/rails80/config/boot.rb Adds Rails 8 stub boot config.
src/spec/stub/rails80/config/application.rb Adds Rails 8 stub application config.
src/spec/stub/rails80/app/helpers/application_helper.rb Adds Rails 8 stub helper.
src/spec/stub/rails80/app/controllers/application_controller.rb Adds Rails 8 stub controller baseline.
src/spec/ruby/rack/embed/config_spec.rb Updates embed config spec to expect default compat version constant.
src/spec/ruby/rack/config_spec.rb Removes compat-version parsing expectations; asserts compat version is always nil in servlet config.
src/spec/ruby/rack/capture_spec.rb Updates capture assertions and conditions for JRuby 9 vs JRuby 10 behavior.
src/spec/ruby/rack/application_spec.rb Removes compat-version runtime mode test; adds regression coverage for capture failures during init.
src/spec/ruby/jruby/rack/integration_spec.rb Adds Rails 8 integration appraisal and removes compat-version init param wiring.
src/spec/ruby/jruby/rack/error_app_spec.rb Replaces deprecated File.exists? with File.exist?.
src/spec/java/org/jruby/CompatVersion.java Introduces a test-only minimal org.jruby.CompatVersion stub for JRuby 10 test execution.
src/main/ruby/jruby/rack/rack_ext.rb Adjusts RequestHelpers inclusion logic across JRuby versions (9.3 vs others).
src/main/ruby/jruby/rack/core_ext.rb Disables JRubyRackConfig capture module on JRuby 10 to avoid missing CompatVersion issues.
src/main/java/org/jruby/rack/embed/Config.java Removes runtime-derived compat-version state; returns a fixed default compat version.
src/main/java/org/jruby/rack/RackConfig.java Marks getCompatVersion() as deprecated.
src/main/java/org/jruby/rack/DefaultRackConfig.java Removes parsing logic for jruby.compat.version; now returns null.
src/main/java/org/jruby/rack/DefaultRackApplicationFactory.java Stops applying compat version to RubyInstanceConfig; broadens capture exception handling.
gemfiles/rails80_rack22.gemfile Adds Rails 8 + Rack 2.2 appraisal Gemfile.
gemfiles/rails61_rack22.gemfile Adds extra stdlib gems for older Rails appraisals.
gemfiles/rails60_rack22.gemfile Adds extra stdlib gems for older Rails appraisals.
gemfiles/rails52_rack22.gemfile Adds extra stdlib gems for older Rails appraisals.
gemfiles/rails50_rack22.gemfile Adds extra stdlib gems for older Rails appraisals.
README.md Updates compatibility matrix and removes jruby.compat.version documentation.
CHANGELOG.md Notes JRuby 10 / Rails 8 compatibility in unreleased section (and adds an additional entry in 1.2.6).
Appraisals Adds Rails 8 appraisal and per-rails extra gem injection.
.github/workflows/maven.yml Expands CI matrix to include JRuby 10 and Rails 8 appraisal with appropriate exclusions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Appraisals Outdated
Comment thread src/main/ruby/jruby/rack/core_ext.rb Outdated
Comment thread CHANGELOG.md Outdated
Comment thread src/spec/java/org/jruby/CompatVersion.java Outdated
Comment thread src/main/java/org/jruby/rack/DefaultRackApplicationFactory.java
@chadlwilson chadlwilson force-pushed the 1.2-safe-jruby-10 branch 3 times, most recently from 32162db to 176d1ca Compare April 17, 2026 15:12
@chadlwilson chadlwilson requested a review from Copilot April 17, 2026 15:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/jruby/rack/DefaultRackApplicationFactory.java
Comment thread src/spec/ruby/rack/application_spec.rb
…compatibility

This has been set to 2.1 for all supported JRubies for a long time, and the setting did nothing
within JRuby. This change reduces usages, and introduce a stub to allow testing with JRuby 10; where rspec and others logic will still try and locate the class.
(cherry picked from commit d794a22)

# Conflicts:
#	.github/workflows/maven.yml
#	CHANGELOG.md
#	README.md
#	pom.xml
#	src/main/ruby/jruby/rack/version.rb
…re are handled

While this shouldn't happen, currently if it does, the root exception is lost, which can be catastrophic for debugging.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/jruby/rack/RackConfig.java
Comment thread src/main/java/org/jruby/rack/embed/Config.java
@chadlwilson chadlwilson merged commit 0648cca into jruby:1.2-stable Apr 17, 2026
87 checks passed
@chadlwilson chadlwilson deleted the 1.2-safe-jruby-10 branch April 17, 2026 15:27
@chadlwilson chadlwilson added this to the 1.2.7 milestone Apr 17, 2026
@chadlwilson chadlwilson changed the title 1.2: Backport JRuby 10.0 and Rails 8.0 compatbility 1.2.x: Backport JRuby 10.0 and Rails 8.0 compatbility Apr 17, 2026
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.

2 participants