1.2.x: Backport JRuby 10.0 and Rails 8.0 compatbility#419
1.2.x: Backport JRuby 10.0 and Rails 8.0 compatbility#419chadlwilson merged 5 commits intojruby:1.2-stablefrom
Conversation
6818184 to
912bd0f
Compare
There was a problem hiding this comment.
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/CompatVersionprocessing (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.
32162db to
176d1ca
Compare
176d1ca to
b51d335
Compare
There was a problem hiding this comment.
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.
…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
(cherry picked from commit 7e9bb85)
…re are handled While this shouldn't happen, currently if it does, the root exception is lost, which can be catastrophic for debugging.
b51d335 to
2a7882c
Compare
There was a problem hiding this comment.
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.
Backports #273 (and later minor JRiuby 10 bumps) to the 1.2.x branch by
CompatVersionThis is a simpler and safer alternative to #360 (which created a dummy
CompatVersionclass in production code itself), and deals with the concerns there. This involves no such change, and instead disables the problematicRackConfigdetail 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.2does no harm, and API compatibility has been retained. Thejruby.compat.versionjruby-rack init properly, if set, will just be ignored, and the sameRUBY_21default value from earlier returned.Additional context
Generally 1.2.x is already working with JRuby 10 if the
RackConfigwas not used in any way that caused the (removed)CompatVersionclass 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.