Skip to content

Private Marketplace extension blocking: add workbench UX and update gating - #341049

Merged
Karthik Nadig (karthiknadig) merged 1 commit into
microsoft:mainfrom
mcumming:extension-blocking-ui
Nov 4, 2026
Merged

Karthik Nadig (karthiknadig) merged 1 commit into
microsoft:mainfrom
mcumming:extension-blocking-ui

Conversation

@mcumming

@mcumming Michael Cummings (MSFT) (mcumming) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • model extension-level versus version-level blocking explicitly and avoid redundant all-version compatibility requests for whole-extension blocks
  • keep target gallery blocking (blockingInfo) separate from the currently installed version's blocking metadata (installedBlockingInfo)
  • refresh exact installed-version metadata during update checks only when a Private Marketplace is configured and installed and target versions differ; errors are logged without blocking normal update detection
  • keep gallery search, paging, and direct gallery lookups responsive by running installed-extension synchronization in the background while applying same-version blocking metadata synchronously
  • prevent blocked extensions from installing, updating, auto-updating, switching release channels, installing on another extension server, or appearing in chat extension search
  • surface installed-version-specific policy/Marketplace status wording while preserving whole-extension update-blocked wording
  • re-check the compatible gallery version in the platform before manifest resolution and restore the whole-extension compatibility short-circuit lost during the main merge
  • add focused regressions for Private Marketplace lookup behavior, lookup failure handling, same-version metadata refresh, blocked install paths and actions, compatibility resolution, update gating, search filtering, and status wording

Relationship

Follow-up to #333859, which has merged. This PR is now based on main.

Validation

  • npm run build-fast -- --client-only — passed
  • .\scripts\test.bat --reporter dot --run src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts --run src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts --run src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts --run src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts — 426 tests passed
  • npm run eslint -- src/vs/platform/extensionManagement/common/abstractExtensionManagementService.ts src/vs/platform/extensionManagement/common/extensionGalleryService.ts src/vs/platform/extensionManagement/test/common/extensionGalleryService.test.ts src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts src/vs/workbench/contrib/extensions/browser/extensionsActions.ts src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts — passed
  • npm run typecheck-client — passed
  • npm run valid-layers-check — passed

🤖 This pull request description was authored by GitHub Copilot CLI on behalf of Michael Cummings (MSFT) (@mcumming).

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

Latest-only gallery queries can still return a blocked version instead of retrying for an older permitted version.

1 open finding
What changed in this PR

Adds end-to-end handling of Marketplace-blocked extensions across extension management and the workbench.

Changes:

  • Parses blocking metadata and gates version selection and installation.
  • Surfaces blocked status and disables updates, installation, and chat search exposure.
  • Adds focused platform and workbench tests.
File Description
abstractExtensionManagementService.ts Rejects blocked installations.
extensionGalleryService.ts Parses blocking metadata and filters versions.
extensionManagement.ts Defines blocking contracts.
extensionManagementUtil.ts Provides origin-aware messages.
extensionGalleryService.test.ts Tests parsing and version filtering.
extensionManagement.test.ts Tests messages and install enforcement.
extensionsSync.ts Handles blocked sync installations.
extensions.ts Exposes blocking metadata to workbench models.
extensionsWorkbenchService.ts Refreshes metadata and gates updates/installations.
extensionsActions.ts Updates actions and status messaging.
searchExtensionsTool.ts Excludes blocked extensions.
extensionsWorkbenchService.test.ts Tests refresh and gating behavior.
extensionsActions.test.ts Tests toggle and status behavior.
searchExtensionsTool.test.ts Tests search filtering.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mcumming Michael Cummings (MSFT) (mcumming) changed the title Surface blocked extensions in the workbench Private Marketplace extension blocking: add workbench UX and update gating Oct 12, 2026
@mcumming

Copy link
Copy Markdown
Contributor Author

Resolved the current \main\ conflict and pushed \215d2fe7134\ on top of the clean restack. The resolution preserves both upstream's polling/install-inventory coverage and the extension-blocking tests.\n\nThe post-merge review also found and fixed two version-level blocking edge cases:\n- display fallback now selects the first unblocked version rather than dropping an extension when only the newest fallback candidate is blocked;\n- installed extensions retain the exact installed version's blocking metadata when the gallery selects an older permitted version, so status, update gating, and search safeguards remain active.\n\nValidated with 409 affected tests passing, targeted ESLint,
pm run typecheck-client,
pm run transpile-client, and
pm run valid-layers-check. There are no unresolved inline review threads.\n\n---\n🤖 This update was authored by GitHub Copilot CLI on behalf of Michael Cummings (MSFT) (@mcumming).

@mcumming

Copy link
Copy Markdown
Contributor Author

Final restack/status correction:

  • The platform fix is now e81411a6f00 (Preserve blocked version metadata access).
  • The workbench fix is now edbe224e1ff (Preserve installed blocked version metadata).
  • 91041fcd32b is an attributed no-code commit used only to retrigger CI after the earlier runner OOM.

The fresh run completed all 32 executable checks successfully, including Compile & Hygiene. The PR is mergeable, there are no unresolved review threads, and the remaining VS Code PR Check is waiting only for the required collaborator approvals (0/3), not code or CI remediation.

Local validation remains: 409 affected tests, targeted ESLint, npm run typecheck-client, npm run transpile-client, and npm run valid-layers-check.


🤖 This update was authored by GitHub Copilot CLI on behalf of Michael Cummings (MSFT) (@mcumming).

@mariaghiondea

Copy link
Copy Markdown

Karthik Nadig (@karthiknadig) this is ready for your review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for splitting this out. The simpler gates look good: auto-update, the toggle, the context key, the chat search filter, and the status that depends on install state.

Requesting changes for two issues in syncInstalledExtensionsWithGallery (details inline):

  1. The installed version's block is copied onto a different gallery version. If the installed version is blocked but a newer version is permitted, the permitted update gets marked blocked. Auto-update, the Update button and install are then all disabled, so the user is stuck on the blocked version.
  2. Search now waits on the sync, plus a new request. queryGallery, getPage and getExtensions now await work that used to run in the background. That includes a new exact-version lookup for every outdated installed extension, on any marketplace.

Smaller items, also inline:

  • The new request has no error handling.
  • The wording is wrong when the installed version is the blocked one.
  • There's no test for the case in (1).

Review assisted by Copilot.

@mcumming

Michael Cummings (MSFT) (mcumming) commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

The workbench PR has been cleanly restacked on the updated #333859 head and is conflict-free.

It preserves the exact installed version's blocking metadata when gallery selection falls back to an older permitted version, so installed status, update gating, and search safeguards remain active. The workbench service suite, targeted ESLint, and client type-check pass locally, and all GitHub Actions checks are green. There are no unresolved review threads; only the shared external VS Code PR Check remains pending.

Karthik Nadig (@karthiknadig), this PR is ready for review after its platform dependency.


🤖 This reply was authored by GitHub Copilot CLI on behalf of Michael Cummings (MSFT) (@mcumming).

@mariaghiondea

Copy link
Copy Markdown

Karthik Nadig (@karthiknadig) this is ready for your review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the quick turnaround. Everything from my last review is addressed: target and installed blocking are separate, search no longer waits on the sync, the exact-version lookup only runs on private update checks and handles errors, the installed-version wording is in, and the reverse-case test is there.

A few new issues, mostly from the follow-ups (details inline):

  1. A whole-extension block still counts as outdated, so the update badge can't be cleared and Update All tries to install it.
  2. A known installed-version block is cleared when the exact-version lookup doesn't return that version.
  3. fromGallery now replaces the installed extension's gallery object, which skips the per-server platform check and the change event.
  4. The getExtensionState change isn't related to blocking. Can it be split out?

Review assisted by Copilot.

@mariaghiondea

Copy link
Copy Markdown

Karthik Nadig (@karthiknadig) this is ready for your review again

@karthiknadig

Copy link
Copy Markdown
Member

Maria Ghiondea (@mariaghiondea) I don't see fixes since my last review? just a merge from main into the PR.

@mariaghiondea

Copy link
Copy Markdown

Michael Cummings (MSFT) (@mcumming) you re-requested the review yesterday. Can you please check? Have the comments been addressed?

@mcumming

Copy link
Copy Markdown
Contributor Author

Yep, missed the new review, addressed the comments.

@mariaghiondea

Copy link
Copy Markdown

Karthik Nadig (@karthiknadig) now it's ready for your review. Thank you

@mariaghiondea

Maria Ghiondea (mariaghiondea) commented Oct 29, 2026 •

Copy link
Copy Markdown

Karthik Nadig (@karthiknadig) this is ready for your review 🙏

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the quick follow-up. All four of my Oct 21 items are fixed and covered by tests: blocked targets no longer count as outdated, a missing lookup result keeps a known block, fromGallery copies only the blocking state and fires a change, and the getExtensionState change is gone.

Requesting changes for one issue introduced by the latest commit, plus one older one (inline):

  1. Blocked extensions can still be installed through two paths. A whole-extension block now leaves extension.gallery as the last unblocked object while extension.blockingInfo reports the block. Two install paths don't call canInstall and pass that stale object to the platform:

    • Install in Remote/Local → installInServer
    • Switch to Pre-Release/Release → togglePreRelease (the action only checks the allow list)

    The platform only checks blockingInfo on the object it receives, and doesn't re-check the version getCompatibleVersion picks. So nothing on the client stops the install; it only fails if the marketplace also refuses the download. Please reject when extension.blockingInfo is set in _install and installInServer, disable both actions, and ideally re-check compatibleExtension.blockingInfo in checkAndGetCompatibleVersion.

  2. The installed-version lookup only runs for private extensions.

Also, the Oct 15 merge (3a09f839b5) dropped the getCompatibleExtension shortcut for whole-extension blocks and its test; the description still lists both.


Review assisted by Copilot.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: e4f76261-7b46-409e-91cd-b7bede8c7392
@mariaghiondea

Copy link
Copy Markdown

Karthik Nadig (@karthiknadig) ready for your review again

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this addresses everything from my last review:

  • _install and installInServer reject blocked extensions, and Install in Remote/Local and the pre-release toggle are disabled for them.
  • The platform re-checks the selected version's blockingInfo before resolving the manifest.
  • The installed-version lookup is gated on a configured Private Marketplace instead of private.
  • The getCompatibleExtension shortcut and its test are back.

LGTM.


Review assisted by Copilot.

@karthiknadig
Karthik Nadig (karthiknadig) merged commit f82b0bc into microsoft:main Nov 4, 2026
55 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 4, 2026
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.

7 participants