Repository navigation
fix(upload): send the zip upload's requiredHeaders on the signed PUT - #561
Open
imbgar-roboflow wants to merge 2 commits into
Open
imbgar-roboflow wants to merge 2 commits into
imbgar-roboflow wants to merge 2 commits into
Conversation
init_zip_upload returns requiredHeaders beside signedUrl, and upload_zip_to_signed_url dropped them. On a Roboflow appliance backed by Azure Blob the signed URL is a SAS that only validates with x-ms-blob-type: BlockBlob (and If-None-Match: * when it is create-only), so every SDK zip upload failed 400 MissingRequiredHeader. Pass them through, the same way put_video_upload already does. GCS URLs return no requiredHeaders and send exactly what they sent before.
Contributor
Author
|
/mina deepbulk |
Contributor
Author
|
/jarbas review |
Contributor
Author
|
/mina deepbulk |
Contributor
Author
|
/jarbas review |
…losed temp file so Windows can reopen it
Contributor
Author
|
Follow-ups from the review are addressed in 5242983:
On the question: yes, a server-supplied |
Contributor
Author
|
/mina deepbulk |
There was a problem hiding this comment.
TL;DR
Ready with nits — 2 follow-ups.
Follow-ups
- [deepseek-v4.1-flash] No test pins the Content-Type override precedence —
tests/adapters/test_rfapi_phase2.py:939 - [ember-1] No test pins the intentional server-Content-Type override —
tests/adapters/test_rfapi_phase2.py:934
Since the last review (e0f6b3b)
- 5 new · 0 raised again · 2 no longer raised after the code under them changed
- no longer raised:
tests/adapters/test_rfapi_phase2.py[deepseek-v4.1-flash] New zip-upload test class is defined after the module's main guard - no longer raised:
tests/adapters/test_rfapi_phase2.py[ember-1] New TestUploadZipToSignedUrl class is defined after the module's unittest.main() guard
- no longer raised:
- Still open from the earlier review — the code under them is unchanged:
- [ember-1] A server-supplied Content-Type in requiredHeaders overrides the application/zip default — intended? —
roboflow/adapters/rfapi.py:1056(not raised again) - [deepseek-v4.1-flash] Docstring states Azure Blob SAS header requirements without a citable source —
roboflow/adapters/rfapi.py:1049(not raised again)
- [ember-1] A server-supplied Content-Type in requiredHeaders overrides the application/zip default — intended? —
How this verdict was reached
- Jury: superduper-trio (reviewer) · superduper-adversarial (cross_examiner) · superduperduper-glm (adjudicator)
- Reviewer seats: astra · deepseek-v4.1-flash · ember-1
- Work: 5 raised · 5 accepted · 0 refuted · 0 unverifiable · 0 blocking
- Vendor docs: nothing in this diff needed them
- Verifier: not required (no blocking candidates)
- Cross-examination: astra · deepseek-v4.1-flash · qwen3.8-max (qwen3.8-max examines in ember-1's place;
-kimicrosskeeps ember-1) - Bias lenses: 22 ran · 0 recovered by corrective turn · 0 failed
- Lens flags on accepted findings (advisory; two or more lenses agreeing, never a verdict):
- lens
tests/adapters/test_rfapi_phase2.pyNo test pins the intentional server-Content-Type override: anchoring, availability, confirmation, duplication-blindness, false-precision, missing-context, test-tunnel-vision - lens
roboflow/adapters/rfapi.pyFix reuses the established put_video_upload header-merge pattern and stays backward compatible: anchoring, authority-deference, blast-radius-underestimate, confirmation, false-precision, happy-path - lens
roboflow/adapters/rfapi.pyrequired_headers is merged without a mapping/type check: availability, blast-radius-underestimate, false-precision, framework-dogma, nit-amplification, pattern-match - lens
tests/adapters/test_rfapi_phase2.pyNo test pins the Content-Type override precedence: availability, confirmation, duplication-blindness, missing-context, test-tunnel-vision - lens
roboflow/adapters/rfapi.pyHeader merge keeps responses without requiredHeaders byte-identical: blast-radius-underestimate, confirmation, false-precision, happy-path
- lens
- Candidate gaps (omission lens, verifier-checked; not findings): 2 demonstrated · 2 not demonstrated (withheld)
- gap: No finding anchors tests/test_project.py even though the diff modifies it in two hunks, so the project-level test changes are entirely unreviewed by any engine.
- gap: No finding flags that arbitrary server-supplied header names (e.g. Content-Length, Host, Authorization) are merged into the outgoing request without an allowlist; P4 only covers non-mapping/non-string shapes.
- Withheld: 1 take-or-leave note (below the public evidence bar)
- Coverage: superduper-trio reviewed 4/4 files and 5/5 hunks · superduper-adversarial independently reviewed 4/4 files and 5/5 hunks
Reviewed commit 524298341df5c2fec466d45c026d9291fc0ca5d4.
This branch has not been deployed
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.
init_zip_uploadreturnsrequiredHeadersbesidesignedUrl, butupload_zip_to_signed_urlPUT onlyContent-Type: application/zip.On a Roboflow appliance backed by Azure Blob, the signed URL is a SAS that validates only with
x-ms-blob-type: BlockBlob, plusIf-None-Match: *when the SAS is create-only (srh=if-none-match). The API already returns both inrequiredHeaders. Without them, every SDK zip upload fails with400 MissingRequiredHeader x-ms-blob-type. This was observed on the azure-scus lab estate on 2026-10-19.Change:
upload_zip_to_signed_url(signed_url, zip_path, required_headers=None)merges the headers into the PUT, the same wayput_video_uploadalready does.Workspace.upload_datasetpassesinit.get("requiredHeaders") or {}.requiredHeaders, so the request is unchanged there.Tests: new
TestUploadZipToSignedUrl(headers sent, and Content-Type only when there are none), andTestZipUploadasserts the headers are forwarded.python -m unittest tests.adapters.test_rfapi_phase2 tests.test_projectpasses 127 tests, and ruff is clean.