Pin json below 3.0 for the test suite - #766
Merged
Merged
Conversation
json 3.0.0 removed the quirks_mode option, but ActiveSupport 7.2.3.x still passes it to JSON.generate. Once ActiveSupport's JSON extensions are loaded, Hash#to_json raises "ArgumentError: unknown keyword: quirks_mode". In the test suite ActiveSupport is only loaded when spec/persistence/cookie_adapter_spec.rb requires "rails", so specs that serialize JSON fail only when that file runs earlier in the random order. ActiveSupport 7.2.4 no longer passes quirks_mode, but it caps connection_pool below 3. On Ruby >= 3.2, Bundler resolves connection_pool 3.x with ActiveSupport 7.2.3.2 instead, so the affected jobs are Ruby >= 3.2 with Rails 7.x. Ruby 3.1 resolves ActiveSupport 7.2.4, and Rails 8.x does not pass quirks_mode either. This only affects the development Gemfile, not the gemspec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snaka
force-pushed
the
fix/pin-json-below-3
branch
from
September 27, 2026 02:46
c79a0cd to
1e107ea
Compare
andrehjr
pushed a commit
that referenced
this pull request
Sep 27, 2026
Gemfile.lock is not committed, so a new dependency release can break the build while main stays unchanged. The json 3.0 release did exactly that: it broke the Rails 7.x jobs on main (see #766), but no push to main has happened since, so CI never showed it. Add a weekly scheduled run so such breakage shows up without waiting for the next push. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andrehjr
approved these changes
Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
json 3.0.0 (released 2026-09-07) removed the
quirks_modeoption, but ActiveSupport 7.2.3.x still passes it toJSON.generate. Once ActiveSupport's JSON extensions are loaded,Hash#to_jsonraises:mainhas not changed since its last green run (2026-08-09,fa42fc0). That run predates json 3.0. BecauseGemfile.lockis not committed, a new run on the same commit now resolves json 3.0.2.Which jobs are affected
quirks_mode, but it capsconnection_pool < 3. On Ruby >= 3.2, Bundler resolvesconnection_pool 3.xtogether with ActiveSupport 7.2.3.2 instead.quirks_mode.The failure depends on spec order. ActiveSupport is only loaded when
spec/persistence/cookie_adapter_spec.rbrunsrequire "rails", so specs that serialize JSON fail only when that file runs earlier under the random order. Runningcookie_adapter_spec.rbthenexperiment_storage_spec.rbwith--order definedreproduces it consistently on Ruby 3.2 and 3.3 with Rails 7.x.Change
This PR adds
gem "json", "< 3"to the developmentGemfileonly. The gemspec is unchanged, so gem users are not affected.Verification
push: https://github.com/snaka/split/actions/runs/36289493495main, Ruby 3.3 +RAILS_VERSION=7.1fails with the error above. With this change, it passes (522 examples, 0 failures).Note (not addressed here)
gem "rails", "~> #{ENV.fetch('RAILS_VERSION', '8.0')}"expands to~> 7.1, which allows 7.2, so the "Rails 7.1" jobs actually resolve Rails 7.2.🤖 Generated with Claude Code