sul-dlss / sdr-client

SDR API client (in Ruby)
https://sul-dlss.github.io/sdr-api/
Other
0 stars 1 forks source link

connection: use new faraday syntax to avoid warnings #165

Closed ndushay closed 3 years ago

ndushay commented 3 years ago

Why was this change made?

To avoid this:

WARNING: `Faraday::Connection#authorization` is deprecated; it will be removed in version 2.0.
While initializing your connection, use `#request(:authorization, ...)` instead.
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
WARNING: `Faraday::Connection#authorization` is deprecated; it will be removed in version 2.0.
While initializing your connection, use `#request(:authorization, ...)` instead.
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
WARNING: `Faraday::Connection#authorization` is deprecated; it will be removed in version 2.0.
While initializing your connection, use `#request(:authorization, ...)` instead.
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.

How was this change tested?

analogous change made in infra-int tests

Which documentation and/or configurations were updated?

ndushay commented 3 years ago

@jcoyne I was only thinking about stopping the warnings. Do you want me to upgrade faraday also? Seems like more of a patch party thing, no?

jcoyne commented 3 years ago

@ndushay it looks to me like you are relying on new syntax in Faraday that is only available in certain versions. So, we should encode which version we are expecting that feature to be in the gemspec. Otherwise they could use an old version of Faraday that doesn't support this syntax.

ndushay commented 3 years ago

@jcoyne I only updated the apps that were giving the warnings. :-) This one definitely was, in the integraton tests.

ndushay commented 3 years ago

AFAICT, this was always ok syntax; I gave up hunting through the release changes and the code after finding the below:

We're covered by the version we have, per Faraday's own documents:

from: image

image

The recent change is only to add the deprecation warnings, which spam out quite a bit

image

I looked at https://github.com/lostisland/faraday/blame/main/lib/faraday/connection.rb in blame mode and was not further illuminated, btw.