feat: load test results from uploaded archive files#165
Open
eboudrant wants to merge 1 commit into
Open
Conversation
Add a multi-file picker beside the Scan-from-URL input that accepts .zip/.tar/.tar.gz archives, merges their build/ outputs into one overlay + scan, and aborts with a conflict dialog when two archives contain the same path with differing content (identical duplicates merge silently). - src/localArchive.js: sniff/extract (unzip|tar) → stage → hash → merge + conflict-detect → overlay <module>/build via fs.cpSync. Reuses remoteFetch path-safety + compat helpers. - src/scanJobs.js: upload registry, startScanFromUploads/runUploads/ doOverlayAndScan, kind-aware confirmScanJob/finishJob, getJob conflicts. - src/handler.js: POST /api/uploads (raw streamed, byte-capped) and POST /api/projects/:id/scan-from-uploads. - Picker lives inside the hidden url-form → project-card screenshot baselines unchanged. - tests/node/localArchive.test.js: 11 cases (helpers + e2e merge/dup/conflict/ needs_confirmation/size-cap/validation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Adds a multi-file picker beside the existing Scan from URL input. Users can upload one or more
.zip/.tar/.tar.gzarchives; theirbuild/outputs are merged into a single overlay onto the project and scanned against local goldens.Duplicate handling: the same archive-internal path in two archives is fine when the bytes are identical (merged silently). If the content differs, the scan is aborted before touching the project and an error dialog lists the conflicting paths + which archives they came from.
How it works
POST /api/uploadsstreams each file to a temp file (byte-capped at 2 GB, no in-memory buffering; dep-free — pipes the raw request, no multipart parser). Returns an opaqueuploadId.POST /api/projects/:id/scan-from-uploadsmerges the named uploads: each archive is fully extracted to a stage dir (unzipfor zip,tarfor tar — chosen by magic-byte sniff),build/members are sha256-hashed and cross-checked, then matched<module>/buildsubtrees are copied in viafs.cpSyncand handed to the normal scan. Sameneeds_confirmationpark/resume as the URL flow.src/localArchive.jsreusesremoteFetch's path-traversal + compat helpers.UI note (screenshots)
The picker is added inside the existing hidden Scan-from-URL form, and the collapsed project card / action row is untouched — so screenshot baselines are expected to be unchanged. I couldn't run the Docker screenshot suite locally (Docker Desktop requires a Netflix org sign-in), so I'm relying on CI's Screenshot Tests to confirm no diff.
Test plan
npm test— 190 pass, incl. newtests/node/localArchive.test.js(11 cases): pure helpers (sniffFormat,collectBuildMembersfilter + symlink skip,mergeStageshappy/identical-dup/conflict) and e2e through the real handler (tar+zip merge, identical-dup merge, conflict abort with project untouched,needs_confirmation→confirm, size-cap 413 + no leaked temp dir, input validation)./api/uploads(health, 400 on bad extension, successful uploads).🤖 Generated with Claude Code