[RAPTOR-20129] fix(filesapi): send zip-path overwrite in the multipart form - #898
Open
wojtekwdr wants to merge 1 commit into
Open
Conversation
…t form The Files API reads overwrite from the form, so a query-only REPLACE was accepted and ignored and every re-uploaded path came back as a renamed duplicate. Send the field ahead of the file part and keep the query copy until the contract says which location is authoritative.
|
🎫 Jira: |
Code OwnershipCli Maintainers
Review requested from the teams above. Labels will be removed automatically upon approval. |
Contributor
Author
|
/approve-smoke-tests |
Contributor
|
🔐 Fork PR smoke tests triggered by @wojtekwdr What happens next:
|
Contributor
|
🔐 Fork smoke tests started by maintainer ⏳ Security scans passed. Running smoke tests... Commit: |
Contributor
|
✅ All smoke tests passed! (Fork PR) ✅ Security Scan: success |
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.
RATIONALE
dr artifact code syncanddr workload upupload throughPOST /files/{id}/fromFile/whenever a change set exceeds 20 files or 50 MB. The overwrite mode went only in the query string, which the Files API accepts and ignores, so the server's rename default applied: every existing path came back asname (2).extholding the new bytes while the original kept the old ones, and an image built from that version ran stale code. Reproduced on staging: a 25-file re-sync produced a 53-file version with 25 duplicates. The Terraform provider carried the same code and fixed it the same way.CHANGES
UploadFromZipExistingsendsoverwritein the form and keeps the query copy until the API documents which location is authoritative.TESTING
Staging, fixed binary, 25 modified files:
dr artifact code syncre-sync gives 28 files and no duplicates (53 with 25 duplicates before), and adr workload upre-deploy gives 27 files and no duplicates, with the server checksum of the edited file matching the local one.task linton all three GOOS legs andtask testare green.RELATED
PR #867 bundles the same fix with unrelated integrity work and is currently red; this is the standalone extract so it can ship on its own, and #867 can rebase onto it.
useArchiveContentsstaying in the query is RAPTOR-19915.Note
Medium Risk
Changes deploy/sync upload behavior for large change sets; incorrect framing could break uploads, but scope is limited to the zip fromFile path and is covered by new tests.
Overview
Fixes catalog zip uploads (
dr artifact code syncand large-changedr workload uppaths) so existing files are replaced instead of duplicated. The Files API was ignoringoverwritewhen it was only on the query string; the server’s rename default producedname (2).extcopies and left old bytes in place, so built images could run stale code.UploadFromZipExistingnow sendsoverwriteas a multipart form field before the zip part (query param kept for compatibility). Streaming multipart framing was extended to emit optional form fields with correct Content-Length; stage uploads pass no extra fields.Tests assert form field order, query copy, payload integrity on large bodies, and that new-catalog zip uploads still send only the file part.
Reviewed by Cursor Bugbot for commit 8787c8e. Configure here.