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

add Faraday#Deprecate to 1.x #1438

Merged
merged 6 commits into from
Aug 8, 2022

Conversation

hyuraku
Copy link
Contributor

@hyuraku hyuraku commented Aug 4, 2022

Description

add Faraday#Deprecate to hide deprecate method's warning message

Fixes #1410

Todos

List any remaining work that needs to be done, i.e:

  • Tests
  • Documentation

Additional Notes

Copy link
Member

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

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

Thank you for bringing this back @hyuraku.
There are some changes that I wouldn't expect in this PR, please see my comment below.
Do you also think you could add some test coverage to check the warnings are correctly output when the skip is disabled?

lib/faraday/error.rb Outdated Show resolved Hide resolved
lib/faraday/deprecate.rb Outdated Show resolved Hide resolved
lib/faraday/deprecate.rb Outdated Show resolved Hide resolved
@iMacTia
Copy link
Member

iMacTia commented Aug 5, 2022

Thank you for addressing all the comments @hyuraku 🙌!
Are you planning to add unit tests as well as I mentioned above?

Do you also think you could add some test coverage to check the warnings are correctly output when the skip is disabled?

@hyuraku
Copy link
Contributor Author

hyuraku commented Aug 5, 2022

@iMacTia

check the warnings are correctly output when the skip is disabled?

I want to add the test when the skip is disabled? to spec/faraday/connection_spec.rb.

@iMacTia
Copy link
Member

iMacTia commented Aug 5, 2022

Or better, a generic test around the Faraday::Deprecate#deprecate method 👍!
If we know that works as expected (e.g. with an anonymous class defined in the specs), we don't need to test it everywhere we use it

Copy link
Member

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

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

Just realised we can now remove the require from error.rb as well

@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'faraday/deprecate'
Copy link
Member

Choose a reason for hiding this comment

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

This is not necessary anymore 🙌 !

@hyuraku
Copy link
Contributor Author

hyuraku commented Aug 6, 2022

@iMacTia
I added the spec for Faraday::Deprecate#deprecate; could you review this PR?

@hyuraku hyuraku changed the title add Faraday#Deprecate add Faraday#Deprecate to 1.x Aug 6, 2022
Copy link
Member

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

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

Fantastic work @hyuraku and great test coverage 💯👏
The rubocop offence is unrelated to the PR itself, I'll test this locally and merge if all tests are passing 👍

@iMacTia
Copy link
Member

iMacTia commented Aug 8, 2022

All tests pass locally ✅ 🎉

@kyrofa
Copy link

kyrofa commented Aug 9, 2022

Thank you both!

Copy link

@kenichi-sonoda kenichi-sonoda left a comment

Choose a reason for hiding this comment

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

Sorry, mistake

please delete this message🙏

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.

4 participants