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

Test: fix compatibility with (latest) Faraday 2.x #14184

Closed
wants to merge 1 commit into from

Conversation

kares
Copy link
Contributor

@kares kares commented May 30, 2022

Release notes

[rn:skip]

What does this PR do?

Test fix - due recent upgrade to JRuby 9.3 (Ruby 2.6) we started using (latest) Faraday 2.x which changed the conn.request :basic_auth API and is failing:

12:54:14          Failure/Error: conn.request :basic_auth, 'john-doe', 'open-sesame'
12:54:14          
12:54:14          Faraday::Error:
12:54:14            :basic_auth is not registered on Faraday::Request
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/faraday-2.3.0/lib/faraday/middleware_registry.rb:57:in `lookup_middleware'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/faraday-2.3.0/lib/faraday/rack_builder.rb:242:in `use_symbol'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/faraday-2.3.0/lib/faraday/rack_builder.rb:103:in `request'
12:54:14          # ./logstash-core/spec/logstash/webserver_spec.rb:186:in `block in <main>'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/faraday-2.3.0/lib/faraday/connection.rb:91:in `initialize'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/faraday-2.3.0/lib/faraday.rb:98:in `new'
12:54:14          # ./logstash-core/spec/logstash/webserver_spec.rb:185:in `block in <main>'
12:54:14          # ./logstash-core/spec/logstash/webserver_spec.rb:155:in `block in <main>'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/webmock-3.14.0/lib/webmock/rspec.rb:37:in `block in <main>'
12:54:14          # ./spec/spec_helper.rb:66:in `block in <main>'
12:54:14          # ./logstash-core/lib/logstash/util.rb:43:in `set_thread_name'
12:54:14          # ./spec/spec_helper.rb:65:in `block in <main>'
12:54:14          # ./spec/spec_helper.rb:58:in `block in <main>'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/rspec-wait-0.0.9/lib/rspec/wait.rb:46:in `block in <main>'
12:54:14          # ./vendor/bundle/jruby/2.6.0/gems/logstash-devutils-2.4.0-java/lib/logstash/devutils/rspec/spec_helper.rb:61:in `block in <main>'
12:54:14          # ./lib/bootstrap/rspec.rb:36:in `<main>'

Upstream details on the issue:

You were previously able to call authorization, basic_auth and token_auth against the Connection object, but this helper methods have now been dropped. Instead, you should be using the equivalent middleware, as explained in this page.
For more details, see lostisland/faraday#1306

@jsvd
Copy link
Member

jsvd commented May 30, 2022

the elasticsearch-transport gem we use still relies on faraday ~> 1 https://rubygems.org/gems/elasticsearch-transport
we may have to downgrade faraday in core until the ES ruby client folks upgrade the dependency.

@kares
Copy link
Contributor Author

kares commented May 30, 2022

oh thanks - should have checked that (this came up as a nested side thingy).
thought it's only used for testing but the explicit dependency changes everything.

replacement at #14185

@kares kares closed this May 30, 2022
@kares kares deleted the fix-faraday branch May 30, 2022 11:57
@kares kares mentioned this pull request May 30, 2022
5 tasks
@kares
Copy link
Contributor Author

kares commented May 30, 2022

upstream issue: elastic/elasticsearch-ruby#1805

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.

None yet

2 participants