go-cloud icon indicating copy to clipboard operation
go-cloud copied to clipboard

blob/azblob: Migrate to new SDK module

Open marwan-at-work opened this issue 2 years ago • 9 comments

Is your feature request related to a problem? Please describe.

According to the README, the Azure Blob Storage SDK has moved to a new place here.

Describe the solution you'd like

It would be great if go-cloud migrated to the new SDK so that it's up to date.

The only thing that might be worth considering is that it's a bit of a breaking change for people who use bucket.As and pass in the old library's types.

marwan-at-work avatar Jul 01 '22 15:07 marwan-at-work

I've been trying to upgrade to the new SDK for pubsub (#3084) but have been blocked on https://github.com/Azure/azure-sdk-for-go/issues/17472#issuecomment-1097185034. Basically, the new Azure packages only work with Go 1.18+, and go-cloud has committed to compatibility for the 2 latest Go versions (which includes Go 1.17 right now).

vangent avatar Jul 01 '22 16:07 vangent

And yes, it will be a breaking change. Sadly there is no way to avoid that when the underlying provider makes breaking changes :-(.

vangent avatar Jul 01 '22 16:07 vangent

I think the good news is that Go 1.19 is already in beta so that should be okay when it GAs? I wonder whether it's worth getting the upgrade started in the master branch and not cut a release until 1.19.

And yes, it will be a breaking change. Sadly there is no way to avoid that when the underlying provider makes breaking changes :-(.

I'm curious whether Go Cloud should tag a non-major version and mention this change in the release notes or if it would warrant a major version upgrade on gocloud. I'd be happy either way.

Also, thank you for staying on top of those changes!

marwan-at-work avatar Jul 01 '22 16:07 marwan-at-work

Yes, looks like 1.19 should be out in August.

I usually just note breaking changes in the release notes.

vangent avatar Jul 01 '22 16:07 vangent

https://github.com/google/go-cloud/pull/3156 if you have any feedback.

vangent avatar Aug 06 '22 08:08 vangent

@xaxa06 @toddself @stanhu @chrismellard @Strife96

FYI previous contributors to this package. I'm planning to update it in a non-backwards-compatible way soon, to update to the new Azure Blob Storage SDK. Sadly given the underlying backwards-incompatible change, I don't think there's a way to avoid it. (I could add a second copy of the package, e.g., azureblob2, but I don't want to maintain two, and I think that "please use v0.26.0 if you want the old Azure library" is morally equivalent.

The proposed change is in #3156.

Obviously the underlying Azure clients etc. have changed, so the As functionality is not backwards compatible. As near as I can tell, once you have a blob.Bucket, other than As, the functionality is the same as before. This is all well-tested by the drivertest suite. The construction of a bucket has changed though (e.g., OpenBucket). I've tried to keep the same environment variables and URL parameters, and I think they should largely work as before, but this is harder for me to test so if any of you are still using this package I'd appreciate some verification.

Other feedback is also welcome.

vangent avatar Aug 06 '22 23:08 vangent

Thanks for the heads up and for that migration/upgrade that looks promising! I will try to test it on my end in the coming days when time permits and let you know how this goes. For the practicality of what's the best way to proceed to upgrade our gocloud to your branch from an existing project while this is still at pull request stage, would you have any particular advice? (I was reading at https://go.dev/ref/mod#pseudo-versions but haven't found any way so far to just "go get" the existing deps from a commit hash which isn't yet merged, so I'm suspecting there's probably a better way...)

xaxa06 avatar Aug 09 '22 22:08 xaxa06

@xaxa06 I'm waiting for feedback, but if I don't hear anything I'm likely going to submit it relatively soon, so it's probably easiest to just wait for that.

vangent avatar Aug 09 '22 23:08 vangent

hi i no longer work at github, @marwan-at-work do you know if the packages team needs to do anything here?

toddself avatar Aug 09 '22 23:08 toddself

Fixed by #3156.

vangent avatar Aug 10 '22 21:08 vangent