feat: expose the extension package size per target platform by netomi · Pull Request #2168 · eclipse-openvsx/openvsx · GitHub
Skip to content

feat: expose the extension package size per target platform - #2168

Merged
netomi merged 6 commits into
mainfrom
feat/extension-download-size
Oct 12, 2026
Merged

netomi merged 6 commits into
mainfrom
feat/extension-download-size

Conversation

@netomi

@netomi netomi commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #367.

Context

The issue asks for the extension size to be displayed, packagephobia-style. Half of what that needs already exists: file_resource.size has been recorded since V1_73__File_Resource_Size.sql (#2089, #2095), set on publish in PublishExtensionVersionService and StorageUtilService, and backfilled for older rows by FileResourceSizeJobRequestHandler. Nothing ever read it back out, though — it reached no API response and no page.

Change

  • ExtensionJson.downloadSizes — map of target platform to the size in bytes of the package behind the matching entry of downloads. It is set where downloads is, i.e. on /api/{ns}/{ext} and its versioned variants.
  • Web UI — the Target Platforms line on the extension detail page lists each platform in its own row with its size, e.g. Linux x64 12.30 MB, and an info icon beside the heading explains that these are download sizes. Rendered with the existing formatFileSize helper.

Decisions worth calling out:

Per platform, not one number. A version can ship for several target platforms and each package has its own size, so a single size would describe whichever platform the page happened to load. The Download button and its platform menu are unchanged.

It reads the download resource, not a SUM over the version's files. Readme, icon, changelog and license are stored as rows of their own but hold content that is already inside the .vsix, so summing counts it twice.

Unknown is omitted, not zero. A package published before the column existed that the backfill hasn't reached has size = null. That platform is left out of downloadSizes and the UI shows its name alone. A client has no way to tell a zero-byte file from an unknown one, so it gets neither.

Download size, not install size

The issue asks about install size — the reporter's example is a ~110MB .vsix that's over 200MB on disk — and this is the download size. The two differ by the package's compression ratio.

Install size isn't stored and isn't cheaply derivable. Backfilling it means re-reading every existing .vsix out of storage — a much larger job than V1_73's was. That seems worth its own issue and its own decision, rather than holding up the number we already have.

One query, not two

StorageUtilService.getFiles returns the resources and getFileUrls is a shorthand over it, unchanged for its other callers. setDownloads takes the URL and the size from one getFiles call, and the detail builder uses the toFilesJson mapping the other two builders already share, which also removes the duplicated public-key-alongside-signature handling it had grown.

Testing

  • RegistryAPITest.testExtensionDownloadSizes / testExtensionDownloadSizesUnknown — the per-platform value reaches the JSON; a null size leaves that platform out.
  • extension-detail-overview.spec.tsx (new) — each platform is its own row with its size, a platform without a size is listed by name only, nothing size-like renders when none is known, and the info tooltip appears only when a size is shown.
  • FileResourceJooqRepositoryTest (new, Postgres) — findByType and findAll return the stored size, and an unknown size comes back null rather than 0.
  • Webui: full suite green, tsc --noEmit and yarn lint clean. Server: full suite green (1823 tests, including the Testcontainers ones).
  • Three existing tests stubbed getFileUrls for the detail path and now stub getFiles.

🤖 Generated with Claude Code

@netomi
netomi force-pushed the feat/extension-download-size branch from 9df36d8 to a98d4b1 Compare September 5, 2026 11:47
@netomi
netomi marked this pull request as draft September 5, 2026 12:33
@netomi
netomi force-pushed the feat/extension-download-size branch from a98d4b1 to bdc14f9 Compare September 5, 2026 12:39
@netomi
netomi force-pushed the feat/extension-download-size branch from bdc14f9 to 460313c Compare October 12, 2026 13:06
file_resource.size has been recorded since V1_73 but reached no API
response and no page. Issue #367 asks to display it.

Add ExtensionJson.downloadSizes, a map of target platform to the size in
bytes of the package behind the matching entry of downloads, and show the
size next to each platform in the web UI's Target Platforms line. The size
differs per platform, so a single value cannot describe a version that
ships for several.

The size is read from the download resource rather than summed over the
version's files, which would count readme, icon, changelog and license
twice. A platform whose size is unknown (published before the column
existed and not yet backfilled) is left out of the map rather than sent as
zero.

This is the download size; the install size the issue mentions is not
stored and would need its own column and a backfill job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@netomi
netomi force-pushed the feat/extension-download-size branch from 460313c to 9b6daca Compare October 12, 2026 13:34
@netomi netomi changed the title feat: expose the extension package size in the API and web UI feat: expose the extension package size per target platform Oct 12, 2026
The concatenated Target Platforms line wrapped mid-entry once sizes were
added. Render one row per platform, name beside size.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@netomi

netomi commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

@netomi
netomi marked this pull request as ready for review October 12, 2026 13:47
@netomi
netomi requested a balanced review from Copilot October 12, 2026 13:47

Copilot AI 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.

🟡 Changes recommended

Cache invalidation, database-mapping coverage, and the install-size scope discrepancy remain unresolved.

3 open findings
What changed in this PR

Exposes per-platform VSIX download sizes through the extension API and displays them in the extension detail UI.

Changes:

  • Adds downloadSizes to extension API responses.
  • Displays formatted sizes beside target platforms.
  • Adds server and web UI coverage and updates affected mocks.
File Description
webui/​test/​unit/​pages/​extension-detail/​extension-detail-overview.spec.tsx Tests platform size rendering and unknown sizes.
webui/​src/​pages/​extension-detail/​extension-detail-overview.tsx Renders each platform with its download size.
webui/​src/​extension-registry-types.ts Adds the optional downloadSizes field.
webui/​CHANGELOG.md Documents the UI feature.
server/​src/​test/​java/​org/​eclipse/​openvsx/​UserAPITest.java Updates file-resource mocks.
server/​src/​test/​java/​org/​eclipse/​openvsx/​RegistryAPITest.java Tests known and unknown download sizes.
server/​src/​test/​java/​org/​eclipse/​openvsx/​LocalRegistryServiceTest.java Updates publishing-path mocks.
server/​src/​main/​java/​org/​eclipse/​openvsx/​storage/​StorageUtilService.java Adds grouped file-resource retrieval.
server/​src/​main/​java/​org/​eclipse/​openvsx/​repositories/​FileResourceJooqRepository.java Loads persisted resource sizes.
server/​src/​main/​java/​org/​eclipse/​openvsx/​LocalRegistryService.java Maps download URLs and sizes into API responses.
server/​src/​main/​java/​org/​eclipse/​openvsx/​json/​ExtensionJson.java Defines the public downloadSizes property.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/src/main/java/org/eclipse/openvsx/LocalRegistryService.java
Comment thread server/src/main/java/org/eclipse/openvsx/json/ExtensionJson.java
netomi and others added 4 commits October 12, 2026 14:03
The registry stores only the package size; the installed extension is
larger by its compression ratio. Say so beside the per-platform sizes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace the always-visible caption under the platform list with an info
icon beside the Target Platforms heading.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The API tests mock the repository, so nothing exercised reading
file_resource.size through jOOQ.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI 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.

🟢 Approval recommended

The API and UI behavior are consistent, preserve unknown sizes correctly, and have appropriate regression coverage.

0 open findings

3 resolved since last review

🧠 Review effort: Balanced

@netomi
netomi merged commit 2eb9433 into main Oct 12, 2026
6 checks passed
@netomi
netomi deleted the feat/extension-download-size branch October 12, 2026 14:22
netomi added a commit that referenced this pull request Oct 12, 2026
The server change from #2168 had no entry in server/CHANGELOG.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

[site feature] Display extension size

2 participants