Azure / azure-storage-ruby

Microsoft Azure Storage Library for Ruby
http://azure.github.io/azure-storage-ruby/
84 stars 150 forks source link

Upgrade to faraday 2.0.0 #227

Open honeyankit opened 1 year ago

honeyankit commented 1 year ago

Hello,

We are using azure-storage-blob with ruby on rails dependabot application in order to create resources in Azure. The version of azure-storage-blob used is 2.0 which depends on azure-storage-common which depends on Faraday version 1.0.0.

azure-storage-blob (2.0.3) --> azure-storage-common (2.0.4) --> Faraday (1.0.0)

This is causing an issue as we are using faraday-retry 2.0.0 which depends on faraday 2.0 and we cannot downgrade to faraday 1.0.0 as it will break of things for us.

Logs from the bundle update command:

Bundler could not find compatible versions for gem "faraday":
  In snapshot (Gemfile.lock):
    faraday (= 2.6.0)

  In Gemfile:
    azure-storage-blob (~> 2.0) was resolved to 2.0.3, which depends on
      azure-storage-common (~> 2.0) was resolved to 2.0.4, which depends on
        faraday (~> 1.0)

    faraday-retry (~> 2.0.0) was resolved to 2.0.0, which depends on
      faraday (~> 2.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

Could you please review and try to fix this issue? Thanks in advance!

Ankit

honeyankit commented 1 year ago

I have created a draft PR (https://github.com/Azure/azure-storage-ruby/pull/228) to update the Faraday version to 2.0 for azure-storage-common. If the testing mentioned in the doc is sufficient ?

honeyankit commented 1 year ago

Faraday upgrade docs.

honeyankit commented 1 year ago

After upgrading the faraday to 2.0, the faraday_middleware is complaining to use faraday 1.0.

$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Bundler could not find compatible versions for gem "faraday":
  In Gemfile:
    faraday (~> 2.0)

    faraday_middleware (~> 1.0.0.rc1) was resolved to 1.0.0, which depends on
      faraday (~> 1.0)
honeyankit commented 1 year ago

Based on the faraday_middleware docs. It has been deprecated and need to use the middleware in awesome-faraday replaced the ones using in faraday_middleware in this repo.

honeyankit commented 1 year ago

PR: https://github.com/Azure/azure-storage-ruby/pull/228

alaarab commented 1 year ago

@honeyankit Nice PR. This seems to be a big issue for many people. Microsofts own oauth solution is incompatible with this package because it uses Faraday 2 as well. Your PR fixes that. For now I am forking off your solution. Hopefully MS can accept your solution ASAP.

MarioRuiz commented 1 year ago

What's the state on this? any plan for merging?

muxcmux commented 1 year ago

I've been using my fork for a little less than a year in prod without any issues. It upgrades the dependent gems as well and points the source for those straight to the repo, so if you are not using them in isolation it should work for you too. Hope this helps