GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix npm overrides to a URL treated as registry (#1965) by mikolalysenko · Pull Request #1966 · SocketDev/socket-patch Conversation
|
| Test | Covers |
|---|---|
vendor::npm_origin::tests::issue_1965_an_override_of_a_registry_edge_to_a_url_is_non_registry |
top-level, scoped (foo, [email protected]), "." object, $name, dep@spec selector; URL/git/file:/path/npm: alias-to-URL; fresh, hosted-pinned and vendored-wired resolved |
…issue_1965_an_unclear_override_that_may_swap_in_a_url_keeps_the_edge |
range selectors, contested rules, unresolvable $ref beside a URL rule |
…issue_1965_a_url_override_scoped_to_a_workspace_member_is_non_registry |
a URL rule keyed by a workspace member's name (app, [email protected]) reaches the member's deps; a non-matching version or another member doesn't (Bugbot finding on 70d9aff) |
…issue_1965_a_workspace_member_is_named_as_npm_names_it |
a scoped member without name keeps its @scope/ folder; only the root-level link names a member, not a nested alias link (second Bugbot finding, on 2df1c47) |
…issue_1965_a_url_override_of_a_nested_registry_edge_names_its_copy |
only the nested overridden copy is flagged, not a hoisted twin |
…issue_1965_registry_and_no_op_overrides_of_a_registry_edge_stay_registry |
control (passes before and after): registry, *, empty, non-applying and shadowed rules |
patch::redirect::tests::issue_1965_a_registry_edge_overridden_to_a_url_is_unredirected |
hosted rewriter: lock untouched, warning names the override, patch kept out of the in-run VEX; registry-override control still redirects |
vendor::npm_lock::tests::issue_1965_a_registry_edge_overridden_to_a_url_is_refused |
vendored writer refuses and writes nothing; registry-override control vendors |
vex::discover::npm::tests::issue_1965_a_registry_edge_overridden_to_a_url_is_not_attested |
hosted and vendored pins: not attested, and still shadowed for rollback (verified red with the shadow exclusion removed) |
e2e_redirect_npm_build::npm_redirect_skips_a_registry_edge_overridden_to_a_url (ignored e2e) |
real npm 10.9.9, the issue's foo + URL-override fixture: hosted scan skips loudly, lock byte-identical, nothing attested not_affected. Red before the fix (scan reported applied) |
overrides forces to a remote tarball URL; npm ci installs it unpatched, and vendored vex / vendor --check still pass #1965 hosted: patch::redirect::tests::issue_1965_…, e2e_redirect_npm_build::npm_redirect_skips_a_registry_edge_overridden_to_a_urloverrides forces to a remote tarball URL; npm ci installs it unpatched, and vendored vex / vendor --check still pass #1965 vendored: vendor::npm_lock::tests::issue_1965_…overrides forces to a remote tarball URL; npm ci installs it unpatched, and vendored vex / vendor --check still pass #1965 vex / vendor --check attestation: vex::discover::npm::tests::issue_1965_…allow-remote=all): the logic reads packages only (lockfileVersion ≥ 2) and doesn't depend on the npm version. The e2e runs on whatever npm the CI matrix leg pins.cargo fmt --all -- --check: okcargo clippy --workspace --all-features -- -D warnings: okcargo test --workspace --all-features --no-fail-fast: everything passes except 11 tests that fail for environmental reasons, all in code this PR doesn't touch. The sandbox runs as root, so 9 chmod/unremovable write-failure tests can't make writes fail (in_process_redirect ×3, repair ×2, core copy_tree / vlt_heal / pypi_poetry / pypi_requirements). The other 2 (e2e_bun_lockb) fetch blobs from the live patches-api.socket.dev, which the sandbox can't reach (see Fix bun.lockb nightly e2e reaching the live blob API #1905). CI runs as non-root.SOCKET_PATCH_NPM_E2E_REQUIRED=1 cargo test -p socket-patch-cli --all-features --test e2e_redirect_npm_build -- --ignored npm_redirect_skips_a_registry_edge_overridden_to_a_url: ok (npm 10.9.9)Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A registry range that the root package.json overrides with a remote tarball URL, git or path spec is installed by npm from that spec, not from the lock's resolved URL. These tests show the copy is not yet treated as a non-registry install, so hosted and vendored scans rewire it and VEX attests a patch that npm ci never installs (#1965). Assisted-by: Claude Code:claude-opus-5-5
When the root package.json overrides a registry range with a remote tarball URL, git or path spec, npm installs that spec and ignores the lock's resolved URL. Hosted and vendored scans now treat such a copy like any other non-registry install: hosted skips it with redirect_npm_non_registry_entry_skipped, vendored refuses it, and VEX no longer attests a patch that npm ci never installs. When the winning override can't be decided exactly, any rule for the package with a non-registry value keeps the copy unpatched and reported, matching the module's cautious rule for unclear cases. Fixes #1965 Assisted-by: Claude Code:claude-opus-5-5
Test the hosted rewriter, the vendored lock writer and VEX lockfile discovery against a registry range that the root overrides send to a remote tarball URL: hosted skips it loudly, vendored refuses it, and VEX attests nothing (#1965). A pin an older release wrote at such a copy is still the rewriters' own output, so VEX discovery keeps it shadowed and rollback and remove can still unwind it. Assisted-by: Claude Code:claude-opus-5-5
Real npm installs a local foo that depends on left-pad ^1.3.0 while the root overrides send left-pad to a remote tarball URL. The hosted scan now skips that copy with redirect_npm_non_registry_entry_skipped, leaves the lock byte-identical and attests nothing (#1965). Assisted-by: Claude Code:claude-opus-5-5
Settle registry edges whose package has no non-registry override rule before walking the dependent's chain, so large locks with an unrelated overrides block don't pay a per-edge search. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
npm reaches a workspace member through the root's link edge, so an override keyed by the member's name applies to its dependencies. The override lookup now starts a dependent's ancestor chain with its workspace member, so a URL override scoped to a member skips that member's copy instead of rewiring and attesting it. Found in review. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
A member without a name field keeps its @scope/ folder parent, and only the root-level link entry names a member: a nested link to the same folder may be an alias. Member-scoped overrides now match the member's real name. Found in review. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ 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 fa843ed. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review (burn-down agent).
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review: one gap to settle before this merges (
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
[agent] Reviewed fa843ede4f3ab84c19f72176979069deafc5e563. Checked URL override detection, workspace-dependent names, conservative ambiguous rules and unwind ownership. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
All three merged to main while #2038 was in the merge queue and ship in 5.1.0. Co-Authored-By: Claude <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
npm hosted and vendored scans pin a dependency thatoverrides forces to a remote tarball URL; npm ci installs it unpatched, and vendored vex / vendor --check still pass
There was an error while loading. Please reload this page.