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

feat: write objects to blob storage #8429

Draft
wants to merge 63 commits into
base: main
Choose a base branch
from
Draft

feat: write objects to blob storage #8429

wants to merge 63 commits into from

Conversation

rjsparks
Copy link
Member

No description provided.

Copy link
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this a comment on code not intended to be ready for review, but I happened to look... one comment inline.

Also, for testing I wonder if we want a fake blob Storage class that does only what we need for that it's being called as intended. If we make that work with your storage_utils, the tests wouldn't even have to know. If the need arose, we could also test against a real blob store by adjusting the configuration.

# See, however, the note about "major system failures" at "unknown_ids"
blobname = f"{ext[1:]}/{basename}"
if exists_in_storage("active-draft", blobname):
remove_from_storage("active-draft", blobname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call remove_from_storage() and handle an exception if it complains about blobs that don't exist? The code needs to handle that possibility anyway, e.g., due to a race.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implemenation in django-storages (and in boto3) explicitly say it is not an error to remove something that doesn't exist.

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.

2 participants