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

Allow Rails 7.2 #5843

Merged
merged 9 commits into from
Nov 1, 2024
Merged

Allow Rails 7.2 #5843

merged 9 commits into from
Nov 1, 2024

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Aug 29, 2024

Summary

Allows to update host apps to Rails 7.2.

The only change is that we need to raise the minimum version of Ruby to 3.1, but since it is EOL anyway
it should not be a big deal for anyone.

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.

@tvdeyen tvdeyen self-assigned this Aug 29, 2024
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_sample Changes to the solidus_sample gem changelog:solidus Changes to the solidus meta-gem changelog:solidus_admin labels Aug 29, 2024
Copy link
Contributor

@MadelineCollier MadelineCollier left a comment

Choose a reason for hiding this comment

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

How should we handle the error we get with Ransack 4.2 and above? It doesn't look like there has been any movement on the PR to fix the issue.

@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 11, 2024

How should we handle the error we get with Ransack 4.2 and above? It doesn't look like there has been any movement on the PR to fix the issue.

That's a very good question. I need to read on the issue first in order to make an opinion. Since I use Ransack 4.2 with great success in several other apps and engines I am not sure why this is an issue in Solidus at all.

@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 11, 2024

I looked into the problem and I am sure I can replace the custom ransacker with normal ransack. PR upcoming maybe tomorrow

Copy link
Contributor

@MadelineCollier MadelineCollier left a comment

Choose a reason for hiding this comment

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

Nice, thanks for addressing the root cause ❤️

@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 12, 2024

Nice, thanks for addressing the root cause ❤️

Should be fixed by #5853

@tvdeyen tvdeyen force-pushed the rails-7.2 branch 3 times, most recently from 6ac936c to a5637df Compare September 12, 2024 09:38
@tvdeyen tvdeyen added this to the 4.4 milestone Oct 9, 2024
Copy link
Contributor

@forkata forkata left a comment

Choose a reason for hiding this comment

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

Great work here @tvdeyen! We may be blocked by the solidus_starter_frontend that is causing issues bundling due to cannonical_rails 😞 I believe there hasn't been a release that includes this PR yet. There is an open issue for it here.

.circleci/config.yml Outdated Show resolved Hide resolved
@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 16, 2024

Great work here @tvdeyen! We may be blocked by the solidus_starter_frontend that is causing issues bundling due to cannonical_rails 😞 I believe there hasn't been a release that includes this PR yet. There is an open issue for it here.

Thanks Chris, I really need to come back to this some day.

I can try to ping Denis if he is willing to release version of canonical_rails, but honestly I would like to get rid of it.

Canonical tags are rarely necessary nowadays and probably causing more problems to your SEO if not done right (and I have been bitten by this gem's wrong canonical tags it generates). Maybe I find some time to get rid of it in the starter frontend.

@forkata
Copy link
Contributor

forkata commented Oct 16, 2024

@tvdeyen I completely agree with you on the unnecessary dependency on canonical_rails. I would be happy to support with trying to remove that dependency from the starter frontend if you don't have time to tackle that?

@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 18, 2024

@tvdeyen I completely agree with you on the unnecessary dependency on canonical_rails. I would be happy to support with trying to remove that dependency from the starter frontend if you don't have time to tackle that?

@forkata sure, that would be really helpful!

@tvdeyen tvdeyen force-pushed the rails-7.2 branch 3 times, most recently from cd00f02 to 0294c66 Compare October 18, 2024 19:23
@jumph4x
Copy link
Contributor

jumph4x commented Oct 23, 2024

Apologies for the delays on this. Getting it handled right now.

Though I understand it might get dropped as a dep. No matter, releasing a patch bump is a good idea: https://rubygems.org/gems/canonical-rails/versions/0.2.16

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.58%. Comparing base (f4c1cee) to head (e0b78d0).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
.../solidus/install/app_templates/frontend/starter.rb 0.00% 1 Missing ⚠️
.../lib/spree/testing_support/dummy_app/migrations.rb 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5843      +/-   ##
==========================================
+ Coverage   89.31%   89.58%   +0.27%     
==========================================
  Files         712      783      +71     
  Lines       16187    17989    +1802     
==========================================
+ Hits        14457    16116    +1659     
- Misses       1730     1873     +143     

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

@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 30, 2024

Apologies for the delays on this. Getting it handled right now.

Though I understand it might get dropped as a dep. No matter, releasing a patch bump is a good idea: https://rubygems.org/gems/canonical-rails/versions/0.2.16

Thanks, Denis! No worries.

@tvdeyen tvdeyen marked this pull request as ready for review October 30, 2024 09:42
@tvdeyen tvdeyen requested a review from a team as a code owner October 30, 2024 09:42
@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 30, 2024

@solidusio/core-team this is now ready for review.

We still need a merge ofhttps://github.com/solidusio/solidus_starter_frontend/pull/374 that allows Rails 7.2 in order to make the solidus-installer tests pass in this branch. This is kind of a chicken egg situation. The PR in solidus_starter_frontend runs with this branch to make it's tests green and vice versa. I still think we should merge the solidus_starter_frontend PR first so we can revert back to main in the starter frontend app template and this change in the solidus-starter PR

WDYT?

@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 30, 2024

I extracted the Ruby 3.1 bump into a separate PR for better visibility

We need at least v3.7 of awesome_nested_set for Rails 7.2 support
Rails 7.2 removed migration_context from ActiveRecord::Base.connection
Without that ActiveRecord 7.2 expects a DB table
for it.
This installs the master branch of canonical-rails.
Necessary for Rails 7.2 compatibility.
We updated to Rails 7.2 and need to update the
cache version.
Rails 8.0 removes the option to remove keyword
arguments for defingin enums.
How has this ever worked this way?
This is a flaky test, so give Capybara it bit more time
to find the button.
@github-actions github-actions bot removed changelog:solidus_api Changes to the solidus_api gem changelog:solidus_sample Changes to the solidus_sample gem changelog:solidus Changes to the solidus meta-gem changelog:solidus_admin labels Oct 31, 2024
@tvdeyen tvdeyen merged commit 78e5f28 into solidusio:main Nov 1, 2024
15 of 16 checks passed
@tvdeyen tvdeyen deleted the rails-7.2 branch November 1, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants