Repository navigation
Fix Deno -g missing a one-segment path registry (#1784) - #1785
Mikola Lysenko (mikolalysenko) merged 4 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A registry served one path segment below a root registry on the same host is missed by -g when the root registry has also cached a package named like that segment. Add a regression test for #1784, both for plain and scoped packages in the nested registry. Assisted-by: Claude Code:claude-opus-5-5
When one host serves an npm registry at its root and another one path segment below it, and the root registry has cached a package named like that segment, -g scan and apply silently skipped every package of the nested registry. The package dir is now also taken as a registry root when its other subdirs hold packages, and that registry's crawl skips the version dirs of the outer package. Fixes #1784 Assisted-by: Claude Code:claude-opus-5-5
Review follow-up for #1784. The registry walk, the package-dir check and the registry crawl now use one test for a package's version dir (named from a digit, with a package.json), so a package named from a digit is treated the same everywhere and only digit-named dirs are stat'ed. The walk reuses the package dir's listing instead of reading it twice. The regression test now stages a nested manifest and a registry-shaped fixture inside the outer package, so both version-dir skips are exercised. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Bugbot is paused — your team has an unpaid invoiceBugbot is paused because your team has an unpaid invoice. Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically. (requestId: 7ccd74d1-2130-408b-940c-484479c481c5) |
Bugbot is paused — your team has an unpaid invoiceBugbot is paused because your team has an unpaid invoice. Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically. (requestId: d1ff444b-0ce5-4c46-9bfd-46b0f5873a9d) |
|
bugbot run Generated by Claude Code |
1 similar comment
|
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 a1d89fd. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review briefWhat it does: In the Deno npm-cache registry walk, a registry child that is a package dir (for example Risk: low. Only Deno-cache roots are touched. In Deno's real layout a package dir holds only version dirs plus Look here
Verified
Changes I made: none. Open questions (non-blocking nits)
Auto-merge (squash) is armed, so approving sends this PR straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1784
Summary
When one host serves an npm registry at its root (
https://host/) and another one path segment below it (https://host/npm/), and the root registry has cached a package named like that segment (npm), Deno puts both in$DENO_DIR/npm/host/npm/.socket-patch -gscan and apply then silently skipped every package of the nested registry. They now find both registries.Root cause
deno_npm_registry_dirs(crates/socket-patch-core/src/crawlers/npm_crawler.rs) treated a registry child that is a package dir (host/npm, with version dir10.9.0/) as a package only, and queued just its non-version subdirs (host/npm/foo).fooholds version dirs, not packages, sohost/npmnever became a root. The two-segment case (host/api/npm/) already worked because the extra level madehost/api/npma root.Fix
node_modules/fixtures are not walked as registries) and in the registry crawl (so a nesteddist/package.jsonis not reported as a package).is_deno_version_dir(digit-named with apackage.json), now decides "version dir" in the walk, the package-dir check and the crawl, so a package named from a digit (7zip-bin) is handled the same everywhere and only digit-named dirs are stat'ed.Wrappers under
npm/,pypi/,gem/only dispatch to the binary; no parallel change needed.Tests
crawler_npm_e2e::global_mode_finds_one_segment_registry_behind_same_named_package(plainfooand scoped@scope/foo; roots,crawl_all,find_by_purls)left: [".../registry.example.com"] right: [".../registry.example.com", ".../registry.example.com/npm"].cargo test -p socket-patch-core --all-features --test crawler_npm_e2e→ 121 passed.cargo fmt --all -- --checkandcargo clippy --workspace --all-features -- -D warningspass.cargo test --workspace --all-features --no-fail-fast: everything passes except tests unrelated to this diff that fail in this sandbox only: 9 permission-injection tests (the sandbox runs as uid 0, sochmod 0555does not block writes) and 2e2e_bun_lockbtests (one needs network blob download; one is Nightly e2e_bun_lockb red: offline takeover test predates #1648 #1770, also noted on Fix interrupted vendor eject unpatching npm (#1782) #1783).Code review
/code-review highran on the diff. Fixed: redundant/extra stats, inconsistent version-dir tests, uncovered guards, stale doc. Not fixed: theDenoDirGuardtest helper is copy-pasted across 7 Deno tests incrawler_npm_e2e.rs. That duplication predates this PR, and folding it would touch unrelated tests.https://claude.ai/code/session_011f9aeSf1TwmHuVC3BMMvwo
Generated by Claude Code