Repository navigation
Bench: serve yarn classic tarballs; allow NuGet stale-cache warning - #1422
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
yarn classic's hosted pin now downloads each served tarball, checks it against the grant's sha512 and reads its package.json before pinning (#1328: #558 sha1 fragment, #591 unlocked-dep refusal). The mock did not serve those URLs, so yarn-classic/hosted and /rescan failed validation with 60 unexpected GETs. The fixture now serves a real, deterministic .tgz per patched package (package/package.json with the installed copy's dependencies, so nothing needs locking); vlt's preflight shares the same bytes. The restored nuget fixture keeps every patched package's unpatched copy in ~/.nuget/packages, which NuGet would restore ahead of the Socket source. Since #1344 (#352) the scan warns redirect_nuget_stale_global_package for each one, which is correct for a freshly restored project, so the scenario now allows that code. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01La9tujwhm1nYeFya6EL1DF
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a05f705. Configure here.
|
Ready for review (burn-down agent)
Generated by Claude Code |
Final review briefWhat it does: Bench-harness-only fix. Since #1328, yarn classic's hosted pin downloads each served tarball and reads its Risk: low. Only Look here:
Verified: read the full diff. The vlt preflight sha512 ( Changes I made: none. Open questions: none. Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
What main changed
Two merged changes in
f3c6313a..17793173broke three scenarios' validation onmain:5096c41a, Hosted yarn classic rewrite drops the#sha1fragment when the grant has no sha1, so yarn's cache serves stale bytes: yarn ≤1.17 silently installs the unpatched package, and yarn ≥1.19 fails every warm-cache install #558/Yarn classic: a patch that adds a dependency to the package's own package.json leaves vendored yarn.lock with a dangling dependency (offline frozen install fails, lock churns), and hosted silently installs without it #591): yarn classic's hosted pin now downloads each served tarball, checks it against the grant's sha512 and reads itspackage.jsonbefore pinning. The mock didn't serve those URLs, soyarn-classic/hostedandyarn-classic/rescanwere INVALID with 60 unexpectedGET /patch/npm/.../*.tgzrequests.10874cc3, Vendored and hosted NuGet patches are shadowed by a warm global packages folder: silently unpatched without a lock, NU1403 with one #352): a hosted NuGet scan now warnsredirect_nuget_stale_global_packagefor each patched package whose unpatched copy is already in~/.nuget/packages.nuget/hostedandnuget/rescanwere INVALID with 25 unexpected warnings.Both are correct new behavior. Neither is a CLI bug.
Suite changes
artifact_bytesis now a real, deterministic npm.tgz(package/package.jsonwith the installed copy's dependencies, so nothing new needs locking, pluspackage/index.js; fixed mtimes and modes). A sharedserve_artifactshelper serves it for both vlt (sha512 preflight, as before) and yarn classic (the Fix fragmentless yarn classic hosted pins (#558) #1328 fetch).yarn-classic/hostednow expects 187 requests (127 + 60 tarballs).yarn-classic/rescanstays at 127, because its pins are already in place.redirect_nuget_stale_global_package. A freshly restored project really does hold the unpatched copies, and NuGet would restore them ahead of the Socket source, so the warning is right.tarandflate2to the bench crate. Both are already workspace-pinned, soCargo.lockonly gains the bench package's two dependency lines.Validation
cargo fmt -p socket-patch-bench,cargo clippy -p socket-patch-bench --all-features --all-targets -- -D warningsandcargo test -p socket-patch-bench(29 passed) are all clean.runonmain17793173validates 45/45 scenarios (it was 41/45 without this PR).compare(head vs. a copy of head, 8 pairs) onyarn-classic/*,nuget/*andvlt/*shows no regressions; every row is ≈.strace -f -e trace=execveonyarn-classic/hosted: the CLI spawns nothing.yarn-classic/*(it just doesn't fetch the tarballs), so the CI gate's A/B keeps working across the change.Time budget
No new scenarios.
yarn-classic/hostedtakes about 0.27 s more per run. That's the CLI regression tracked in the linked issue, not the fixture. Fixture build time is unchanged within noise.Related
The daily bench run found confirmed regressions in this range. They are filed separately and this PR doesn't fix them: yarn-classic (#1328), golang (#1403) and nuget.
🤖 Generated with Claude Code
https://claude.ai/code/session_01La9tujwhm1nYeFya6EL1DF
Generated by Claude Code
Note
Low Risk
Changes are limited to benchmark fixture mocks and expected warnings; no production CLI or scan logic is modified.
Overview
Updates the socket-patch-bench harness so validation matches recent CLI behavior: yarn classic hosted pins now fetch served patch tarballs, and NuGet hosted scans warn when unpatched copies already sit in the global package cache.
npm fixtures: Patched-package mock artifacts are no longer placeholder bytes—they are deterministic gzip
.tgzarchives withpackage/package.json(shared viamanifest_json) andpackage/index.js, so sha512 checks and tarballpackage.jsonreads behave like production. A sharedserve_artifactsregisters those bytes at each grant URL for both yarn classic and vlt (replacing the vlt-only inline loop).NuGet fixture: The scenario now allows the
redirect_nuget_stale_global_packagewarning, which matches a restored project that still has unpatched packages under~/.nuget/packages.Dependencies: Adds workspace
tarandflate2tosocket-patch-benchonly.Reviewed by Cursor Bugbot for commit a05f705. Configure here.
Generated by Claude Code