Skip to content

fix: remove the max-override-size ceiling on extension size overrides - #2297

Merged
netomi merged 3 commits into
mainfrom
remove-max-override-size
Oct 5, 2026
Merged

netomi merged 3 commits into
mainfrom
remove-max-override-size

Conversation

@netomi

@netomi netomi commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Why

ovsx.publishing.max-override-size (#2287) bounded only the narrower, scoped lever of the two the admin dashboard exposes: a per-namespace/extension size override. The same dashboard admin who creates an override can also set the registry-wide Default max extension size on the Settings page to any value above zero — live, no restart, no ceiling check (SettingsService.updateFromJson only validates > 0). Since the stream-time ceiling is max(default, highest override), raising the default raises the effective ceiling for every namespace at once, unchecked.

So the check restricted the narrower, lower-blast-radius path while leaving a strictly more powerful, completely unbounded path open to the same actor. Given the trust model already lets dashboard admins set an unbounded global default, a ceiling on overrides adds friction without closing any actual gap.

ovsx.publishing.max-override-size was added after the v1.2.0 release and has never shipped, so it's removed outright with no deprecation fallback.

What changed

  • PublishingConfig: dropped maxOverrideSize/MAX_OVERRIDE_SIZE and its @PostConstruct validation.
  • ExtensionSizeLimitService: requireValidSize no longer checks a ceiling (still rejects <= 0); dropped the now-unused PublishingConfig dependency.
  • doc/configuration.md: removed the property's reference entry and the "every override is bounded" consequence in the Extension size limits section.
  • Tests: removed the ceiling-specific cases in PublishingConfigTest and ExtensionSizeLimitServiceTest; the rest pass unchanged.

Test plan

  • ./gradlew compileJava compileTestJava
  • ./gradlew spotlessCheck
  • ./gradlew unitTests
  • ./gradlew test (full container tier) — not run, no Docker daemon available in this environment

🤖 Generated with Claude Code

The dashboard admin who can grant a per-namespace override can also set
the registry-wide default to any value above zero, live, no restart,
which raises the effective ceiling for every namespace at once - a
strictly more powerful, completely unchecked lever. Bounding only the
narrower override left the check unable to actually constrain the trust
model it was meant to protect.

ovsx.publishing.max-override-size was never part of a release (added
after v1.2.0), so it can be dropped outright with no deprecation path.

Co-Authored-By: Claude Sonnet 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.

Copilot review overview

🟡 Changes recommended

It lacks a regression test proving values above the former ceiling are accepted.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Removes the unpublished extension-size override ceiling, aligning override limits with the already-unbounded global default.

Changes:

  • Removes the max-override-size configuration and validation.
  • Allows any positive long override size.
  • Updates tests and documentation for the removed ceiling.
File Description
PublishingConfig.java Removes the ceiling property and validation.
ExtensionSizeLimitService.java Removes upper-bound enforcement.
PublishingConfigTest.java Removes obsolete property tests.
ExtensionSizeLimitServiceTest.java Removes ceiling-related mocks and rejection test.
configuration.md Removes documentation for the ceiling.

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

Addresses Copilot review feedback on #2297: deleting the old
ceiling-rejection test didn't prove a value above the former 1 GiB cap
is now accepted.

Co-Authored-By: Claude Sonnet 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.

Copilot review overview

🟢 Approval recommended

The implementation consistently removes the ceiling and includes focused regression coverage; the remaining comment is non-blocking.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Addresses Copilot review feedback on #2297: the comment described the
former ceiling rather than the current invariant, which AGENTS.md's
comment-style rule excludes. The test name already names the scenario.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@netomi
netomi merged commit faf82a4 into main Oct 5, 2026
5 checks passed
@netomi
netomi deleted the remove-max-override-size branch October 5, 2026 09:07
netomi added a commit that referenced this pull request Oct 7, 2026
…ze ceiling (#2303)

* fix: validate publish size limits against the scanning limit

Restores ovsx.publishing.max-override-size (removed in #2297 because it
bounded only overrides, leaving the registry-wide default unbounded) as a
hard, service-wide ceiling: it now bounds both the admin-adjustable default
and every size override, so neither path can drift past it independently.

Startup additionally fails if that ceiling exceeds
ovsx.scanning.max-archive-size-bytes, since scanning silently skips whatever
is past its own archive-size limit instead of failing closed - closing the
gap in #2302 where a publish-accepted package could be larger than what
scanning actually inspects.

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

* fix: drop the scan-limit cross-check, it compared the wrong units

Review feedback on #2303: the publish-side ceiling bounds the compressed
.vsix size on disk (ExtensionService#createExtensionFile writes the upload
as-is), while ovsx.scanning.max-archive-size-bytes bounds the sum of
uncompressed ZIP entry sizes (ArchiveUtil#enforceArchiveLimits reads
ZipEntry#getSize, which the API defines as uncompressed). Comparing the two
at startup doesn't guarantee a package under the ceiling is fully scanned -
a small, highly-compressible package can still exceed the uncompressed scan
limit. Closing that gap for real needs a different approach, so the
cross-check is dropped rather than left making a claim it can't back up.

Also restores the "whole number of bytes" wording the settings page's size
validation message dropped when the ceiling range was added to it.

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

* fix: remove stale scan-validation claims left in docs/comments

Review feedback: PublishingConfig#maxOverrideSize's javadoc and a
PublishingConfigTest comment still claimed the startup check against
ovsx.scanning.max-archive-size-bytes, which was already dropped in the
previous commit. Reword both to describe only what's actually enforced now.

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

* fix: close review findings on permission mismatch and wording

- Soften PublishingConfig#maxOverrideSize's javadoc from "hard ceiling" to
  "write-time ceiling", matching doc/configuration.md's existing caveat that
  lowering it does not reach a default or override already stored above it.
- The Size overrides page requires manage_extensions, but sourced its
  client-side ceiling from GET /admin/settings, which requires
  manage_settings - a permission split the fine-grained admin roles (#2269)
  make real. A user with only manage_extensions got a silent 403 there and
  never saw the validation. Moves maxOverrideSize onto
  GET /admin/size-overrides (SizeOverrideListJson), which the page already
  has permission for.
- extension-registry-types.ts: fix "the default above" reading as a noun
  phrase in the Settings.maxOverrideSize doc comment.
- settings.tsx: stop flooring the ceiling's MB conversion in the validation
  message - a 1.5 MiB ceiling reported "at most 1 MB", understating what the
  server actually accepts.

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

* fix: show the exact byte ceiling instead of a rounded MB approximation

Review feedback: rounding the MB conversion can overstate the ceiling near
a boundary - 2 MiB - 1 byte rounded to "2.00 MB", naming a value (2 MB) the
server actually rejects. The exact byte count is now the authoritative part
of the validation message, with the MB figure only an approximation
alongside it.

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

---------

Co-authored-by: Claude Sonnet 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.

2 participants