Repository navigation
Conversation
…atively `vis inspect <package> --json --only archivedRepo` now runs without Node, and with it the default set minus `expiredDomains`. The marshall resolves the inspected version's `repository.url` to a GitHub `owner/repo` (the same four URL shapes, ASCII case folding, the lazy `.git` and trailing-slash rules; the corpus in `tests/fixtures/github-urls.json` records what the JavaScript pattern returns for each), reads the cached state (`~/.vis/cache/archived-repo`, 24 hours) or asks `api.github.com/repos/<owner>/<repo>` once with the same headers, `GITHUB_TOKEN` included, and reports an archived repository or a 404. A rate limit, a server error and a `null` body are no finding and nothing is cached; every other answer is cached in the bytes Node writes. Handed to Node before any output or write: a request that fails before an answer, a redirect (a renamed repository), a body that is not JSON, a token that is not visible ASCII, an owner or name outside `[A-Za-z0-9._-]`, and a cache entry that is not what Node writes. The launcher gate accepts `archivedRepo`; a run that executes `expiredDomains` or `signatures` still stays in Node. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
PR Summary by QodoRun archivedRepo checks natively in vis inspect JSON reports
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships |
Merging this PR will not alter performance
Comparing Footnotes
|
|
Thank you for following the naming conventions! 🙏 |
What
vis inspect <package> --jsonruns thearchivedRepomarshall natively. Stacked on #262 (t3/native-inspect-downloads): it shares the service cache reader, theServicesaddresses inContextand the gate edits. Merge #262 first, then retarget this PR tonext(GitHub does it by itself only when merged branches are deleted). Followed by #265 and #266.With both PRs, the default set minus
expiredDomains(MARSHALL_DISABLE_EXPIRED_DOMAINS=1) runs natively. The plain default set still starts Node, untilexpiredDomainsis native.Behaviour
repository.url(falling back to the last version's entry as Node does) toowner/repowith the four shapes Node reads. The Rust reader is checked against a recorded corpus of 70 inputs run through the TypeScript function (native/cli/tests/fixtures/github-urls.json): trimming,git+, ASCII case folding,.git/.GIT/trailing slash, subpaths, query and fragment, empty owner or name, non-GitHub hosts.~/.vis/cache/archived-repo/<owner>__<repo>.json(24 hours) or askshttps://api.github.com/repos/<owner>/<repo>once withAccept: application/vnd.github+json,User-Agent: visulima-vis-marshallandAuthorization: Bearer <GITHUB_TOKEN>when that variable is set and not empty. Archived: a warning (is archived (since …)); 404: a warning (returned 404 from GitHub); 200 and 404 are cached in the bytesJSON.stringifywrites (archivedAtkept when GitHub sends a string, also for a repository that is not archived, as Node does); a rate limit, a server error and anullbody are no finding and nothing is cached.bin/route.mjs) acceptsarchivedRepo; the routing fixture rows andnative-routes.snapare updated.Handed to Node before any output or write
A request that fails before an answer, a redirect (GitHub answers a renamed repository with one, so renamed repositories go through Node), a body that is not JSON the binary reads, a
GITHUB_TOKENthat is not visible ASCII (checked only when a request would carry it), an owner or repository outside[A-Za-z0-9._-](whatencodeURIComponentand the URL parser would rewrite), a cache entry that is not what Node writes.No environment override for the GitHub address; it is a field of
Context(loopback stub in the unit tests).Proof
cargo test -p vis-cli: unit tests against a loopback stub (headers with and without a token, every status class, archived with and without a date, cache bytes, fresh and stale entries, last-version fallback, other hosts, hand-overs);cargo fmt --all --check,cargo clippy -p vis-cli --all-targets -- -D warnings,cargo deny checkclean; no dependency added.__tests__/native/inspect-parity.test.ts: native vs Node on cached states (archived with and without a date, missing, not archived), on every repository shape of the stub packuments (urls@1.0.0…1.7.0,odd-url,dangling,null-repository), and hand-overs of entries Node prints through JavaScript. With Node'sfetchreplaced, the same file asserts findings, cache bytes and the request headers (with and withoutGITHUB_TOKEN) for each GitHub answer; the Rust tests assert the same text.@visulima/pathidentical on both sides (stdout and cache bytes);left-pad's repository was renamed, GitHub answered 301, so the binary handed the run to Node, which printed the same report.🤖 Generated with Claude Code