Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock solidus_core.gemspec to ransack '< 4.2' #5812

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

MadelineCollier
Copy link
Contributor

Solidus core's gemspec already required that ransack be '~> 4.0', but the latest version of ransack, v4.2.0, released July 10 2024, introduces a bug. The previous implementation was taking for granted that every predicate would respond to #value, which doesn't seem to be the case when the predicate is an instance of a Arel::SelectManager.

This has already been flagged by @spaghetticode in his PR against ransack: activerecord-hackery/ransack#1468

Since there has been little movement on this PR since January, we should lock to a version that works for us since currently many of our product specs are failing. (eg. spec/models/spree/product_spec.rb:659)

We can remove this lock once the PR is merged and once the above test (and the others that are failing) are able to pass in ransack v4.2.0 or subsequent versions.

Summary

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@MadelineCollier MadelineCollier requested a review from a team as a code owner August 7, 2024 18:02
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Aug 7, 2024
Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

Looks good, though I'd love one or both of:

  • a comment explaining the restriction
  • a PR that reverts this change that explains when it should be merged

Failure: /spec/components/solidus_admin/ui/thumbnail/component_spec.rb:6

Error:

/home/circleci/solidus/admin/spec/components/previews/solidus_admin/ui/thumbnail/component_preview/overview.html.erb:53:
numbered parameter is already used in
/home/circleci/solidus/admin/spec/components/previews/solidus_admin/ui/thumbnail/component_preview/overview.html.erb:52:
outer block here Failure/Error: <% image = Spree::Image.new.tap {
_1.define_singleton_method(:attachment) { attachment } } %>

By replaing the second instance of numbered params, we can avoid this
error with no behavioural or functional changes to the code.

Interestingly though, it was only failing on 2 out of our 8 spec runs,
and it did so consistently.
Solidus core's gemspec already required that ransack be '~> 4.0', but
the latest version of ransack, v4.2.0, released July 10 2024, introduces
a bug. The previous implementation was taking for granted that every
predicate would respond to #value, which doesn't seem to be the case
when the predicate is an instance of a Arel::SelectManager.

This has already been flagged by @spaghetticode in his PR against
ransack: activerecord-hackery/ransack#1468

Since there has been little movement on this PR since January, we should
lock to a version that works for us since currently many of our product
specs are failing. (eg. spec/models/spree/product_spec.rb:659)

We can remove this lock once the PR is merged and once the above test
(and the others that are failing) are able to pass in ransack v4.2.0 or
subsequent versions.
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.78%. Comparing base (f2a32d6) to head (1664d10).
Report is 49 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5812   +/-   ##
=======================================
  Coverage   88.78%   88.78%           
=======================================
  Files         731      731           
  Lines       17057    17057           
=======================================
  Hits        15144    15144           
  Misses       1913     1913           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kennyadsl kennyadsl merged commit b3111b2 into solidusio:main Aug 8, 2024
14 checks passed
@tvdeyen
Copy link
Member

tvdeyen commented Aug 27, 2024

Should have been backported to v4.3

@tvdeyen tvdeyen added the backport-v4.3 Backport this pull-request to v4.3 label Aug 27, 2024
Copy link

💔 All backports failed

Status Branch Result
v4.3 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 5812

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@tvdeyen
Copy link
Member

tvdeyen commented Aug 27, 2024

💚 All backports created successfully

Status Branch Result
v4.3

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v4.3 Backport this pull-request to v4.3 changelog:solidus_admin changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants