Add opt-in resumable uploads to the file upload URL endpoint#5995
Open
rtibbles wants to merge 2 commits into
Open
Add opt-in resumable uploads to the file upload URL endpoint#5995rtibbles wants to merge 2 commits into
rtibbles wants to merge 2 commits into
Conversation
- supports_resumable flag on the GCS storage backends - get_stored_object_md5: dedup lookup against an object's GCS-computed md5 - create_resumable_upload_session: pins md5 + declared-size metadata - hex_to_base64 checksum helper Part of learningequality#5975. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzUP3UYP4cLyouvssXyekj
- accept a `resumable` flag (defaults off) - GCS: skip when the stored md5 matches the checksum, else return a server-initiated resumable session URI - non-GCS backends fall back to single-PUT - reject non-resumable uploads over 500 MB - make `size` an IntegerField, dropping the redundant float casts Part of learningequality#5975. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzUP3UYP4cLyouvssXyekj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add opt-in resumable upload to the file upload URL endpoint.
Do this to allow resumable uploads and upload of much larger files.
References
Fixes #5975
Reviewer guidance
sizevalidation changed from float to integer (FileUploadURLSerializer) — fractional sizes now 400. In the frontend of Studio we send the file size in bytes as reported by theinputelement.MAX_NON_RESUMABLE_UPLOAD_SIZE) are now rejected and must opt intoresumable- no impact on client side uploads in Studio.mimetype/might_skipand returnsalreadyUploadeddeclared-sizemetadata only, enforced by a separate post-completion hook.AI usage
Used Claude Code to implement the endpoint and GCS storage helpers, following the existing presigned-URL flow. Reviewed the diff in a local self-review pass — tightened the test suite to assert behavior rather than DRF/mock internals, and named the md5 helper so its base64 return is clear at the call site. Verified with the backend test suite.