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

[Fix #903] Fix deprecation warning in LogSubscriber in Rails 7.1 #907

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

alejandroperea
Copy link
Contributor

@alejandroperea alejandroperea commented Dec 6, 2023

Fixes #903

color method was changed in Rails 7.1, introducing a mode_options hash instead of a position parameter just for bold option.

This PR checks the ActiveSupport version and calls color method with the proper parameters.

Also, I've added the configuration for executing the CI for Rails 7.1 version


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the changelog if the new code introduces user-observable changes. See changelog entry format for details.

@alejandroperea alejandroperea changed the title [Fix #903] Fix deprecation warning in LogSubscriber when updating to … [Fix #903] Fix deprecation warning in LogSubscriber in Rails 7.1 Dec 6, 2023
@alejandroperea alejandroperea requested a review from a team as a code owner December 6, 2023 09:41
@konalegi
Copy link

konalegi commented Dec 6, 2023

Great, thank you for the PR, could you please update the change log as well? Thank you! Something like this /~https://github.com/toptal/chewy/pull/892/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR7. Once CI pass, I guess I'm fine with merge.

@alejandroperea alejandroperea force-pushed the fix-deprecation-warning branch from 9c310f0 to 8bbd11b Compare December 6, 2023 10:14
@alejandroperea
Copy link
Contributor Author

@konalegi I've squashed the changes with the CHANGELOG.

The 7.1 builds were failing because of this:

/~https://github.com/toptal/chewy/pull/907/files#diff-de55eb9d876f7c9af5c2ed3ad73de1336e1ceadd73284015bfccf5d435e58de3R3

As it was unable to require active_support/deprecation. I don't know if this is OK for now (as chewy it is not using any deprecation). Or maybe is it better to remove it and rethink it when chewy needs to add a deprecation.

Let me know what you think 👍

CHANGELOG.md Outdated Show resolved Hide resolved
lib/chewy.rb Outdated Show resolved Hide resolved
@konalegi
Copy link

konalegi commented Dec 6, 2023

Let me know what you think 👍
It's fine as long as we need to support different versions and CI is green (In CI we trust).

But please, fix a minor issue that I've commented in your PR

@alejandroperea alejandroperea force-pushed the fix-deprecation-warning branch 2 times, most recently from 7dbe1bf to c50b58e Compare December 6, 2023 10:31
@alejandroperea
Copy link
Contributor Author

@konalegi Changes done 👍 I think you have to trigger the workflows. Let's see what happens

@alejandroperea
Copy link
Contributor Author

It doesn't work and makes total sense, as it is needed to load the deprecators, depending the version one or another.

If today I have time, I will take a deeper look and come back to you.

@alejandroperea alejandroperea force-pushed the fix-deprecation-warning branch from c50b58e to 57fa8bc Compare December 6, 2023 11:11
@alejandroperea
Copy link
Contributor Author

alejandroperea commented Dec 6, 2023

@konalegi I was looking for the same error in other gems. Based on what CocoaPods did and the official documentation, I believe requiring the bare minimum with require 'active_support' and then the extensions needed, it fixes the problem.

@konalegi
Copy link

konalegi commented Dec 6, 2023

@alejandroperea I'll take a look, I don't know what exactly adds require 'active_support' don't really want to include some extra stuff, that we don't really need. I'll take a look in 4-5 hours.

@alejandroperea
Copy link
Contributor Author

alejandroperea commented Dec 6, 2023

Sure @konalegi , no hurries! What I understand from the documentation, it only loads the bare minimum and some entry points for being able to load then the needed extensions, but not 100% sure.

Now the tests are passing. Let me know if you need further changes or investigation 👍

@@ -1,3 +1,4 @@
require 'active_support'
Copy link

Choose a reason for hiding this comment

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

Copy link

@konalegi konalegi left a comment

Choose a reason for hiding this comment

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

Nice, thank you!

@konalegi
Copy link

konalegi commented Dec 6, 2023

I'll try to gather 2nd review, if not, will merge later.

@alejandroperea
Copy link
Contributor Author

Thanks for checking it @konalegi !

@konalegi konalegi merged commit 317dd93 into toptal:master Dec 6, 2023
16 checks passed
@alejandroperea alejandroperea deleted the fix-deprecation-warning branch December 6, 2023 17:06
@konalegi
Copy link

konalegi commented Dec 6, 2023

@alejandroperea
Copy link
Contributor Author

Thank you so much @konalegi !

jqr pushed a commit to connectedbits/chewy that referenced this pull request Feb 6, 2024
jqr pushed a commit to connectedbits/chewy that referenced this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning when upgrading to Rails 7.1
2 participants