Repository navigation
feat(api): resumable bulk uploads for files over the import cap (#1012) - #1270
Merged
Merged
Conversation
POST …/uploads opens a session with the file's exact size and SHA-256 and returns part_size, part_count and a part_url. Parts are PUT as raw bytes, in any order, each exactly its size and safely re-sendable; GET reports parts_received so an interrupted client resumes; POST …/complete concatenates, checks size and digest (422 naming missing parts or the mismatch, parts kept) and hands the bytes to the same delivery path an import uses. The upload id is the delivery's Idempotency-Key and a receipt is kept, so completing again returns the first receipt. Sessions live under the dataset's drop root, are invisible to other datasets, expire after 24h (410) and are swept when the next upload opens; DELETE aborts. finish_delivery is split into accept_delivery + accepted_response so a caller can act on the accepted delivery, and er-api-spec documents a raw Body extractor as application/octet-stream. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
The reference test holds every public path to a workflow group; the new uploads resource had none.
athvin
temporarily deployed
to
marketing-preview
November 26, 2026 20:14 — with
GitHub Actions
Inactive
6 tasks
This branch was previously 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.
Closes #1012
What
Resumable bulk uploads:
POST …/uploads(declare source, bytes, sha256) →PUT …/uploads/{id}/parts/{n}(raw bytes, any order, retry-safe) →GET …/uploads/{id}(parts_received, for resume) →POST …/complete(verifies, then the same 202 receipt as an import) ·DELETEaborts. 64 MiB parts (≤ import cap), 10,000 parts, 24h expiry with orphan sweep. Docs section with a shell example.Why
#1012: a file over the HTTP import cap (256 MiB default) had no supported path to results — only internal drop directories.
Proof
pg_bulk_upload(new): a file several import caps long is refused by/imports(413), then arrives via parts sent out of order with an out-of-range, a wrong-size and a corrupt part; completion names the missing part, then the digest mismatch (parts kept), then succeeds; the job is pinned to the declared sha256/bytes and the published delivery equals the file; a secondcompletereturns the same receipt; another dataset gets 404; abort removes the session.uploadsunit tests (assembly, resume, expiry sweep, declaration refusals).make check: exit 0.Risk & rollback
New routes only; the
finish_deliverysplit is behaviour-preserving (the replay and import tests cover it).git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-26T20:27:31Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
4000f059— rust 45889615501, frontend 45889615472, infra/devcontainer/marketing preview successimagesbuilt, or correctly never ran because nothing that goes intoan image changed: 45889615366 success
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: deploy 45890396911 success (dev + prod); the live process at https://dupezero.com/api/openapi serves
/uploads/{upload_id}/complete(probed 20:27Z)deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy green; drift/kind red before this merge for known reasons (Confirm the er-alerts email subscription and prove alert delivery #1056, kind probe red since 2026-11-10: KeyError 'token_hash' after the credential-omission fix #1106)
Donethrough the automation rather than byhand, and the issue closed: API: resumable bulk file transfer through staged object storage #1012 CLOSED, card Done via the merge automation
(a skill, a reference, memory) — or nothing new was learned: the docs-reference grouping test (every public path needs a workflow group) is now in this PR's history; nothing else new
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Bodyextractor; it now documents it asapplication/octet-stream. A handler that rebuilds a response from parts is unclassifiable, henceaccept_deliveryreturning data andaccepted_responsebuilding the typed 202.Measurements
Files
🤖 Generated with Claude Code