Skip to content

Test both ends of the activesupport range, not just one - #17

Merged
usiegj00 merged 1 commit into
mainfrom
test-activesupport-json-matrix
Sep 10, 2026
Merged

usiegj00 merged 1 commit into
mainfrom
test-activesupport-json-matrix

Conversation

@usiegj00

Copy link
Copy Markdown
Contributor

Ports the fix from buildio/idrac#26 after finding the same exposure here.

ActiveSupport::JSON::Encoding::JSONGemEncoder#stringify calls JSON.generate(..., quirks_mode: true); json 3 removed the keyword. activesupport 8.1 is the first release that stopped passing it, so activesupport 7.x + json 3 raises ArgumentError: unknown keyword: quirks_mode on any hash.to_json — at runtime, not just in specs.

This gemspec allows activesupport >= 7.0, so the combination is reachable for users; the lockfile just happened to sit on a working pair. CI now covers both ends:

leg activesupport json
default 8.1.3.1 3.0.2
legacy 7.2.3.2 2.21.2

Both green locally. README documents the pair. Gemfile, workflow and docs only — no release needed.

activesupport below 8.1 encodes JSON with JSON.generate(..., quirks_mode:
true), and json 3 removed that keyword, so any hash.to_json raises
ArgumentError on that pair. The gemspec allows activesupport >= 7.0, so
both ends need covering rather than whichever the lockfile happens to
hold.

The Gemfile takes both versions from ACTIVESUPPORT_VERSION and
JSON_VERSION, defaulting to the modern pair, and CI runs a matrix over
activesupport >= 8.1 with json 3 and activesupport ~> 7.2 with json 2.
The README states the incompatible pair, since it affects anyone loading
active_support/core_ext, not only this gem.

Same change as buildio/idrac#26.
@usiegj00
usiegj00 merged commit 6e73ab4 into main Sep 10, 2026
2 checks passed
@usiegj00
usiegj00 deleted the test-activesupport-json-matrix branch September 10, 2026 16:34
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