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

Deprecate Spree::Deprecation in favor of Spree.deprecator #5289

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented Jul 28, 2023

Summary

After rails/rails#47354, the suggested usage of ActiveSupport::Deprecation has changed and this PR changes our code to reflect that.

TODO:

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.

@kennyadsl kennyadsl self-assigned this Jul 28, 2023
@github-actions github-actions bot added changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Jul 28, 2023
@elia elia self-assigned this Sep 25, 2023
@elia elia force-pushed the kennyadsl/deprecation-updates branch from 798f565 to 6913c87 Compare September 25, 2023 16:45
@elia elia added this to the 4.2 milestone Sep 25, 2023
@elia elia force-pushed the kennyadsl/deprecation-updates branch from 6913c87 to d7b817b Compare September 26, 2023 13:46
@github-actions github-actions bot added the changelog:repository Changes to the repository not within any gem label Sep 26, 2023
@elia elia changed the title Update Deprecation usage to accomodate Rails 7.1 changes Deprecate Spree::Deprecation in favor of Spree.deprecator Sep 26, 2023
@elia elia removed the changelog:repository Changes to the repository not within any gem label Sep 26, 2023
@elia elia marked this pull request as ready for review September 26, 2023 14:01
@elia elia requested a review from a team as a code owner September 26, 2023 14:01
@elia elia force-pushed the kennyadsl/deprecation-updates branch from d7b817b to d928053 Compare September 27, 2023 07:50
@github-actions github-actions bot added the changelog:repository Changes to the repository not within any gem label Sep 27, 2023
@elia elia force-pushed the kennyadsl/deprecation-updates branch from d928053 to fddb31f Compare September 27, 2023 09:29
kennyadsl and others added 4 commits September 27, 2023 11:31
See https://github.com/rails/rails/blob/814f8ee068814e3d4832a607f49f155e02a609c0/activesupport/lib/active_support/deprecation.rb#L6-L34

Add Spree.deprecator to the list of app deprecators as suggested by
Rails, this will allow applying the global deprecation configurations
to our engine deprecations as well.

Eg:

    config.active_support.deprecation = :raise

This will set the deprecation behavior to raise an exception on any of
the deprecators under `Rails.application.deprecators`.
Use autoload to print a deprecation only if the constant is loaded.
@elia elia force-pushed the kennyadsl/deprecation-updates branch from fddb31f to a7dd17b Compare September 27, 2023 09:33
Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

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

👍

@elia elia merged commit 556d11c into solidusio:main Sep 27, 2023
9 checks passed
@elia elia deleted the kennyadsl/deprecation-updates branch September 27, 2023 13:17
@elia elia added changelog:repository Changes to the repository not within any gem and removed changelog:repository Changes to the repository not within any gem labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:repository Changes to the repository not within any gem 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.

4 participants