Skip to content

Use shared archives browser for cached artifacts - #512

Merged
andrew merged 4 commits into
mainfrom
use-shared-archive-browser
Oct 20, 2026
Merged

andrew merged 4 commits into
mainfrom
use-shared-archive-browser

Conversation

@andrew

@andrew andrew commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Use archives.OpenBrowser for cached archive listings and file reads, removing the local streaming browser and format table. Keep proxy's limits, HTTP error mapping, storage reopen callback, and npm package/ prefix. Use shared common-root detection for version diffs too, so archives containing only README.md remain visible.

Uses archives v0.9.0, which includes git-pkgs/archives#56.

@andrew
andrew marked this pull request as ready for review October 19, 2026 07:28
Copilot AI balanced review requested due to automatic review settings October 19, 2026 07:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@simonchrz simonchrz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One behaviour change: archives.Browser.Extract now returns ErrIsDir for implicit directories too, and browseFile maps that to a 500 with an error log. With a tarball holding only pkg/src/a.go, GET …/file/src returns 404 on main and 500 on this branch. Since a client can trigger it with any directory path, mapping ErrIsDir to 404 (or redirecting to the listing) without the error log seems right.

Otherwise this looks good: same format detection, limits and reopen behaviour as the removed code, and the single-file root fix is covered. Small optional extra: OpenBrowserContext(r.Context(), …) would stop decompression when the client goes away.

Happy to approve once the ErrIsDir mapping is in.

@andrew
andrew force-pushed the use-shared-archive-browser branch from e5fd216 to ac8ebb8 Compare October 20, 2026 10:32
@andrew
andrew merged commit 03f0ebd into main Oct 20, 2026
10 checks passed
@andrew
andrew deleted the use-shared-archive-browser branch October 20, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants