Prevent JSON 3.0 from breaking solidus_admin when using Rails 8.0 - #6588
Conversation
|
Weird... Rails 8.1 is supported But I can't update RAILS_VERSION in the docker compose file to 8.1+ and have it resolve the gems. More investigation needed |
|
cc: @AlistairNorman this is an interesting problem. I think Rails 8.0.0 + Solidus + JSON 3.0 is an unsupported combo now regardless Claude suggested this possible solution too but we need to test it better |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6588 +/- ##
========================================
Coverage 92.26% 92.26%
========================================
Files 995 1037 +42
Lines 20453 21241 +788
========================================
+ Hits 18870 19598 +728
- Misses 1583 1643 +60 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Just a small note for context: CI/CD is failing the Dummy App workflow because of this issue. |
efc4c49 to
3b401ff
Compare
|
I added this to the core gemspec as well to fix the dummy app and solidus install runs. According to this issue 8.1 also has issues with json 3 so it makes sense to just pin it to less than 3 for now and we can do that upgrade when all of the issues have been sorted out. |
| s.add_dependency "geared_pagination", "~> 1.1" | ||
| # Rails < 8.1 isn't compatible with json 3.x | ||
| s.add_dependency "json", "< 3" |
There was a problem hiding this comment.
I don't think this change is necessary since solidus_admin depends on solidus_core.
In JSON 3.0.0, passing the `quirks_mode` keyword to methods was changed from a silent failure to a loud failure - ruby/json@ebf0f29 The use of the JSON `quirks_mode` was removed from rails in v8.1.0, however there is still another incompatibility between Rails 8.1 and JSON 3. rails/rails@646f174#diff-c202bc84686ddd83549f9603008d8fb9f394a05e76393ff160b7c9494165fc4a This is a temporary fix to stop JSON from resolving to 3 until JSON and Rails resolve their compatibility issues. Co-Authored-By: Adam Mueller <adam@super.gd> Co-Authored-By: Alistair Norman <alistair@super.gd>
3b401ff to
459445b
Compare
|
Just for transparency/posterity: this was erroneously merged by someone outside core before getting two core team approvals. Oopsy. |
Thanks. I think thats fine. It unblocks lots of other work and does not introduce a new feature. The rule should not be handled that strictly IMO, especially if it's tidying the ecosystem. Keep up the good work @AlistairNorman |
|
Could we also backport this change into the next patch releases? I think |
Summary
In JSON 3.0.0, passing the
quirks_modekeyword to methods was changed from a silent failure to a loud failure -ruby/json@ebf0f29
The use of the JSON
quirks_modewas removed from rails in v8.1.0rails/rails@646f174#diff-c202bc84686ddd83549f9603008d8fb9f394a05e76393ff160b7c9494165fc4a
JSON 3.0.0 was released on September 7th.
A few solidus dependencies require json, and none limit major version upgrades, so new bundle operations (such as recreating the sandbox in docker) would resolve to a JSON version >3
However, our rails version is pinned to 8.0.0 in the docker compose, and attempting to upgrade to 8.1+ in the docker compose results in a failed sandbox creation.
This means we resolve to a active support version < 8.1 that still uses
quirks_mode, but a JSON version > 3 which makes usingquirks_modean error that fails loudly.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: