-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Rails 7.1 support #5359
Rails 7.1 support #5359
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5359 +/- ##
=======================================
Coverage 88.71% 88.71%
=======================================
Files 563 563
Lines 13896 13896
=======================================
Hits 12328 12328
Misses 1568 1568
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
bf51cab
to
66034a9
Compare
specs are almost passing. Figuring out why we now get different apostrophe's back from our api.. Took me a few to figure out why this was not matching:
|
Intentional Rails update:
|
ea5b56a
to
e6ede34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left an initial set of comments; thanks a ton for this great contribution, @peterberkenbosch! ❤️
@@ -4,8 +4,8 @@ module Spree | |||
module Admin | |||
class OrdersController < Spree::Admin::BaseController | |||
before_action :initialize_order_events | |||
before_action :load_order, only: [:edit, :update, :complete, :advance, :cancel, :resume, :approve, :resend, :unfinalize_adjustments, :finalize_adjustments, :cart, :confirm] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good finding! Did you check if we also have a (unused) route for this action?
.circleci/config.yml
Outdated
@@ -347,4 +347,7 @@ workflows: | |||
- test_solidus: | |||
name: *name | |||
matrix: { parameters: { rails: ['7.0'], ruby: ['3.2'], database: ['sqlite'], paperclip: [false] } } | |||
- test_solidus: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good idea to always test against the latest Rails development branch. We should probably also make this check not mandatory in the GH actions report on PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm moving this to a different PR so we can focus on 7.1
0763ba2
to
c6a8a68
Compare
72cc736
to
d8f6fcc
Compare
@peterberkenbosch Hey Peter, did you have any chance to keep up with this? I'd volunteer to continue the work if you want, just let me know please. |
@kennyadsl feel free to pick up. I haven't had the proper focus time to jump on this. Would be nice to have this done. |
Made another pass to fix other deprecation warnings and errors. As far as I can see the biggest thing left are ransack and previews, which require more time. |
537eaf3
to
5ee2c90
Compare
359448b
to
7d91dc7
Compare
This commit removes the following deprecations: DEPRECATION WARNING: Spree::Order model aliases `bill_address`, but `bill_address` is not an attribute. Starting in Rails 7.2, alias_attribute with non-attribute targets will raise. Use `alias_method :billing_address, :bill_address` or define the method manually. DEPRECATION WARNING: Spree::Order model aliases `ship_address`, but `ship_address` is not an attribute. Starting in Rails 7.2, alias_attribute with non-attribute targets will raise. Use `alias_method :shipping_address, :ship_address` or define the method manually. DEPRECATION WARNING: Spree::CreditCard model aliases `cc_type` and has a method called `cc_type=` defined. Starting in Rails 7.2 `brand=` will not be calling `cc_type=` anymore. You may want to additionally define `brand=` to preserve the current behavior.
Apparently now Rails returns the host without the initial .
…cord::Base DEPRECATION WARNING: SchemaMigration no longer inherits from ActiveRecord::Base. If you want to use the default connection, remove this argument. If you want to use a specific connection, instantiate MigrationContext with the connection's schema migration, for example `MigrationContext.new(path, Dog.connection.schema_migration)`. (called from new at /Users/andrea/nebulab/solidus/core/lib/spree/testing_support/dummy_app/rake_tasks.rb:41)
Due to deprecations, with a previous commit we replaced `alias_attribute` calls for these two attributes with `alias_method`, but the latter doesn't fully cover the previous behavior. When `shipping_address` or `billing_address` are passed as attributes, the error `ActiveModel::UnknownAttributeError` is now raised. For this reason, we're starting to replace them with the right association name. We may want to revisit the possibility to still use `billing_address` and `shipping_address` as providing these aliases doesn't seem to be fully viable anymore.
Starting from Rails 7.1, `ActionView::TestCase#output_buffer` uses `ActionView::OutputBuffer` rather than `ActiveSupport::SafeBuffer`. Due to the slightly different behavior, before comparing it to a string we we need first to convert it. See rails/rails@532e39a
In Rails 7.1 AS will check the global configuration when the macro is used.
Adding the previews path after setting the autoload ensures the file is not autoloaded by Zeitwerk. Co-Authored-By: andrea longhi <andrea@spaghetticode.it>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for completing the work here, @elia @spaghetticode!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏👏👏
Great work! Thanks 🙏🏻 |
great!! thanks all for pushing this over the finish line! 🎉 |
Summary
Preparation for supporting Rails 7.1. Very much work in progress, although it looks like the changes needed are minimal so far. The sandbox is running successfully, there are some failing specs that need to be addressed.
One of the current RSpec errors are related to this rails/rails#49591 and it looks that this will be fixed in the upcoming Rails 7.1.2 release.
Ransack is pain still. The custom predicates with formatters is failing hard currently:
core/app/models/spree/product.rb
:Figuring out where this value method call used to be.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: