Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file-admin based on Azure Blob Storage #1691

Merged
merged 6 commits into from Sep 11, 2018
Merged

Add file-admin based on Azure Blob Storage #1691

merged 6 commits into from Sep 11, 2018

Conversation

c-w
Copy link
Contributor

@c-w c-w commented Aug 15, 2018

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:

  1. During the content editing workflow, file-system access was assumed. This was fixed by introducing two new methods on the FileStorage interface: read_file and write_file (see a2ddd99).

  2. 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.

Currently the unit tests for file-admin are tied to the local
implementation. However, all other implementations of the file-admin
(e..g S3) should maintain the same invariants as the local one. As such,
this change makes it easier to copy the local file-admin tests for other
storage backends.
@mrjoes mrjoes merged commit 08bdcde into flask-admin:master Sep 11, 2018
@c-w c-w deleted the azure-file-admin branch September 12, 2018 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants