NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.52k stars 643 forks source link

Removing blob storage SDK leakage into the code base #9981

Open agr opened 4 weeks ago

agr commented 4 weeks ago

Addresses: https://github.com/NuGet/Engineering/issues/5456

We have wrappers around blob storage SDK (CloudBlobWrapper, CloudBlobContainerWrapper, CloudBlobClientWrapper), unfortunately, they leak underlying SDK types as function arguments, return types and exceptions thrown, which defeats the purpose and complicates swapping the underlying implementation.

This change aims to stop that leakage. Introduced more wrappers around concepts that we use (BlobListContinuationToken, CloudBlobCopyState, CloudBlobCopyStatus, CloudBlobLocationMode, CloudBlobPropertiesWrapper, ListingDetails), propagated other wrappers that we had, but didn't use everywhere (AccessConditionWrapper, FileUriPermissions), wrapped StorageException with our own exception hierarchy following the checks existing in the code, simplifying catch expressions.

erdembayar commented 3 weeks ago

Could please add tracking issue into desc?

drewgillies commented 3 weeks ago

Could please add tracking issue into desc?

@erdembayar Done.