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

Breaking change for fastlane in 0.16.1 #1036

Closed
janpio opened this issue Sep 28, 2019 · 7 comments
Closed

Breaking change for fastlane in 0.16.1 #1036

janpio opened this issue Sep 28, 2019 · 7 comments

Comments

@janpio
Copy link

janpio commented Sep 28, 2019

(Note: Read all the comments first before thinking about the actual problems, possible this here in the issue itself is not the real problem or error)

Basic Info

  • Faraday Version: 0.16.1
  • Ruby Version: 2.3

Issue description

fastlane is using faraday (and after breaking on error classes in general with 0.16.0 which fortunately were quickly fixed by 0.16.1) we are encountering new problems with 0.16.1 when running our tests:

  1) Spaceship::Client retry re-raises when retry limit reached throwing Faraday::TimeoutError
     Failure/Error:
       stub_request(:get, test_uri).
         to_raise(error).times(times).then.
         to_return(status: status, body: body)

     NoMethodError:
       undefined method `to_ary' for Faraday::TimeoutError:Class
     # ./.bundle/ruby/2.3.0/gems/faraday-0.16.1/lib/faraday/deprecated_constant.rb:42:in `method_missing'
     # ./.bundle/ruby/2.3.0/gems/webmock-2.3.2/lib/webmock/request_stub.rb:32:in `flatten'
     # ./.bundle/ruby/2.3.0/gems/webmock-2.3.2/lib/webmock/request_stub.rb:32:in `to_raise'
     # ./spaceship/spec/client_spec.rb:34:in `stub_client_request'
     # ./spaceship/spec/client_spec.rb:108:in `block (4 levels) in <top (required)>'

https://circleci.com/gh/fastlane/fastlane/35752

I am not a ruby developer, so I might be missing something really obvious here - please let me know if this is the case. From my naive understanding, it might be that #1030 did not at back all the previous behavior (that fastlane unfortunately relies on).

(This is not happening with Ruby 2.5 which we are also testing.)

@janpio
Copy link
Author

janpio commented Sep 28, 2019

To add on the fun, we are also testing on Windows with ruby 2.4.6p354 (2019-04-01 revision 67394) [x64-mingw32]. There the same tests are failing, but with different error messages:

  1) Spaceship::Client retry re-raises when retry limit reached throwing Faraday::TimeoutError
     Failure/Error:
       expect do
         subject.req_home
       end.to raise_error(thrown)
       expected Faraday::TimeoutError, got #<RuntimeError: can't modify frozen String> with backtrace:
         # ./spaceship/lib/spaceship/client.rb:811:in `force_encoding'
         # ./spaceship/lib/spaceship/client.rb:811:in `log_response'
         # ./spaceship/lib/spaceship/client.rb:846:in `block in send_request'
         # ./spaceship/lib/spaceship/client.rb:620:in `with_retry'
         # ./spaceship/lib/spaceship/client.rb:844:in `send_request'
         # ./spaceship/lib/spaceship/client.rb:688:in `request'
         # ./spaceship/spec/client_spec.rb:8:in `req_home'
         # ./spaceship/spec/client_spec.rb:111:in `block (5 levels) in <top (required)>'
         # ./spaceship/spec/client_spec.rb:110:in `block (4 levels) in <top (required)>'
     # ./spaceship/spec/client_spec.rb:110:in `block (4 levels) in <top (required)>'
  2) Spaceship::Client retry retries when Faraday::TimeoutError error raised
     Failure/Error: request(:get, TestClient.hostname)
     RuntimeError:
       can't modify frozen String
     # ./spaceship/lib/spaceship/client.rb:811:in `force_encoding'
     # ./spaceship/lib/spaceship/client.rb:811:in `log_response'
     # ./spaceship/lib/spaceship/client.rb:846:in `block in send_request'
     # ./spaceship/lib/spaceship/client.rb:620:in `with_retry'
     # ./spaceship/lib/spaceship/client.rb:844:in `send_request'
     # ./spaceship/lib/spaceship/client.rb:688:in `request'
     # ./spaceship/spec/client_spec.rb:8:in `req_home'
     # ./spaceship/spec/client_spec.rb:118:in `block (4 levels) in <top (required)>'

https://ci.appveyor.com/project/KrauseFx/fastlane/builds/27733501

As it's in the same area of the code and also mentions Faraday::TimeoutError (at least the first time) I assume this is caused by a similar underlying problem.

@janpio
Copy link
Author

janpio commented Sep 28, 2019

Ahem, we are now also seeing test failures with Ruby 2.5 (and not on Ruby 2.3 any more):

  1) Spaceship::Client retry re-raises when retry limit reached throwing Faraday::TimeoutError
     Failure/Error:
       expect do
         subject.req_home
       end.to raise_error(thrown)

       expected Faraday::TimeoutError, got #<FrozenError: can't modify frozen String> with backtrace:
         # ./spaceship/lib/spaceship/client.rb:811:in `force_encoding'
         # ./spaceship/lib/spaceship/client.rb:811:in `log_response'
         # ./spaceship/lib/spaceship/client.rb:846:in `block in send_request'
         # ./spaceship/lib/spaceship/client.rb:620:in `with_retry'
         # ./spaceship/lib/spaceship/client.rb:844:in `send_request'
         # ./spaceship/lib/spaceship/client.rb:688:in `request'
         # ./spaceship/spec/client_spec.rb:8:in `req_home'
         # ./spaceship/spec/client_spec.rb:111:in `block (5 levels) in <top (required)>'
         # ./spaceship/spec/client_spec.rb:110:in `block (4 levels) in <top (required)>'
     # ./spaceship/spec/client_spec.rb:110:in `block (4 levels) in <top (required)>'

  2) Spaceship::Client retry retries when Faraday::TimeoutError error raised
     Failure/Error: request(:get, TestClient.hostname)

     FrozenError:
       can't modify frozen String
     # ./spaceship/lib/spaceship/client.rb:811:in `force_encoding'
     # ./spaceship/lib/spaceship/client.rb:811:in `log_response'
     # ./spaceship/lib/spaceship/client.rb:846:in `block in send_request'
     # ./spaceship/lib/spaceship/client.rb:620:in `with_retry'
     # ./spaceship/lib/spaceship/client.rb:844:in `send_request'
     # ./spaceship/lib/spaceship/client.rb:688:in `request'
     # ./spaceship/spec/client_spec.rb:8:in `req_home'
     # ./spaceship/spec/client_spec.rb:118:in `block (4 levels) in <top (required)>'

https://circleci.com/gh/fastlane/fastlane/35783

Totally not clear to me why this is happening, doesn't make sense to me. But the error messages here are consitent to the ones we are seeing on Windows - so maybe the first one was a fluke or... I have no idea seriously 🤷‍♀

@janpio janpio changed the title Breaking change for fastlane tests in 0.16.1 Breaking change for fastlane in 0.16.1 Sep 28, 2019
@janpio
Copy link
Author

janpio commented Sep 28, 2019

This also breaks fastlane in production for users, e.g. fastlane/fastlane#15397

@janpio
Copy link
Author

janpio commented Sep 28, 2019

For now we decided to pin < 0.16.0 until this is figured out: fastlane/fastlane@596a388

@BobbyMcWho
Copy link
Contributor

BobbyMcWho commented Sep 28, 2019

Same issue as #1033, I have a pending PR to fix it

@janpio
Copy link
Author

janpio commented Sep 28, 2019

Thanks @BobbyMcWho, I saw #1033 but didn't make the connection as the error message(s) was so different. Hope your PR #1035 will make it to 0.16.2 soon 🚀

@janpio
Copy link
Author

janpio commented Sep 29, 2019

Replaced by #1038

@janpio janpio closed this as completed Sep 29, 2019
joshdholtz pushed a commit to BobbyMcWho/fastlane that referenced this issue Oct 13, 2019
relates to:
lostisland/faraday#1036
fastlane#15398

Version 0.16.0 of faraday removed (0.16.2 re-added) backwards compatibility
of Faraday::Error namespaced errors. This namespace will be removed as of
Faraday 1.0 release.
joshdholtz pushed a commit to fastlane/fastlane that referenced this issue Oct 13, 2019
)

* Update deprecated Faraday Error namespacing

relates to:
lostisland/faraday#1036
#15398

Version 0.16.0 of faraday removed (0.16.2 re-added) backwards compatibility
of Faraday::Error namespaced errors. This namespace will be removed as of
Faraday 1.0 release.

* faraday_middleware does not match versions with faraday

* Fix mutating frozen string literal

* Add missing faraday_middleware require

* match faraday_middleware to faraday pessimistic

* temp test of new faraday versions

* Remove temp branches

* Remove uneccesary space

* Rebase
minuscorp pushed a commit to minuscorp/fastlane that referenced this issue Jul 18, 2020
…tlane#15403)

* Update deprecated Faraday Error namespacing

relates to:
lostisland/faraday#1036
fastlane#15398

Version 0.16.0 of faraday removed (0.16.2 re-added) backwards compatibility
of Faraday::Error namespaced errors. This namespace will be removed as of
Faraday 1.0 release.

* faraday_middleware does not match versions with faraday

* Fix mutating frozen string literal

* Add missing faraday_middleware require

* match faraday_middleware to faraday pessimistic

* temp test of new faraday versions

* Remove temp branches

* Remove uneccesary space

* Rebase
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

No branches or pull requests

2 participants