tweedegolf / storage-abstraction

Provides an abstraction layer for interacting with a storage; the storage can be local or in the cloud.
MIT License
106 stars 18 forks source link

Added Azure Blob Storage adapter #33

Closed tesirm99 closed 1 year ago

tesirm99 commented 1 year ago

Hello maintainers,

I'm submitting this pull request to add a new Abstract Adapter for Azure Storage Blobs to the repository. I needed support for various Cloud Storages and this package is just what I wanted, but it does not support Azure Storage Account Blobs, so I wanted to contribute and add an adapter for it.

Changes Introduced:

AzureBlobAdapter: I've introduced a new adapter class specifically designed for Azure Storage Blobs. This adapter leverages the Azure SDK to provide seamless integration with Azure Blob Storage, making it easier for users of this repository to work with Azure-based storage solutions.

AbstractAdapter: I've made sure that the new AzureBlobAdapter adheres to the existing design patterns used in this repository. It inherits from the existing AbstractAdapter class, ensuring consistent usage and a familiar interface for developers who are already familiar with the repository's structure.

Storage: I've added a new storage class to the adapterClasses object.

Types: I've added a new storage type to StorageType enum and a new ConfigAzureStorageBlob interface.

Documentation: I've updated the README to include a section on how to use the new AzureBlobAdapter, along with examples and configuration details. This should help users quickly get started with Azure Storage Blobs within this ecosystem.

Why This Contribution Matters:

Diverse Cloud Support: By adding support for Azure Storage Blobs, we're expanding the range of cloud storage options that this repository supports. This is essential for users who are working in multi-cloud environments or have specific requirements tied to Azure.

Ecosystem Growth: As Azure continues to gain popularity in the cloud computing space, having an adapter tailored for Azure Storage Blobs can attract new users to this repository. It contributes to the project's growth and ensures its relevance in the evolving cloud landscape.

Community Benefit: This addition is a direct response to requests from the community. Many users have expressed the need for Azure Storage support in this repository, and by addressing this demand, we're improving the overall usability and utility of the project.

Testing:

I've thoroughly tested the new AzureBlobAdapter with a variety of scenarios, including different blob operations, error handling, and edge cases. Additionally, I've ensured that existing tests for other adapters remain unaffected.

On the other hand, there is a test that keeps failing which is the create already existing bucket that you are not allowed to access test. I think it keeps failing because of how Azure Storage Containers work, but I am not so sure.

I'm looking forward to your feedback and suggestions. Please let me know if there are any changes you'd like me to make, or if there's anything else I can do to help with the integration of this new adapter.

Thank you for considering this contribution!

Best regards, Tesi

tesirm99 commented 1 year ago

I closed it because I didnt notice I committed the dist package. I will reopen it again without it

abudaan commented 1 year ago

Thank you very much for all your efforts!!

The reason the create already existing bucket that you are not allowed to access test failed was because the test itself had an error, my fault. I have fixed the test and now Azure passes all tests.

One thing I noticed is that if you delete a container it takes a while before the gc runs and the container is actually deleted. So if you delete a container and then try to create a new container with the same name you get an error The specified container is being deleted. Try operation later. I suppose that is why you've added a delay in afterEach.