Add file-admin based on Azure Blob Storage #1691
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements a file-admin based on Azure Blob Storage. The implementation is modeled on the existing S3 file admin.
To make the Azure and S3 file-admins easier to consume, their dependencies were included as extra dependencies on the file-admin package (see edfb07e).
This pull request also adds unit tests for the new file-admin implementation by generalizing the unit tests for the local file-admin (see b3ccfd4). During CI, the unit tests are run against an emulated blob storage service provided by Azurite.
Generalizing the unit tests for the new file-admin implementation revealed two assumptions in the BaseFileAdmin class:
During the content editing workflow, file-system access was assumed. This was fixed by introducing two new methods on the FileStorage interface:
read_file
andwrite_file
(see a2ddd99).When listing files, a valid last modified time for all items including folders was assumed. This was fixed by making the files sorting method more robust (see 3452d1d).
In addition to the unit tests, the new file-admin backend was also manually verified against a live Azure Blob Storage account via a test app.