fix(server): propagate --enable-proposed-api in serve-web#310207
Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
Open
fix(server): propagate --enable-proposed-api in serve-web#310207yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
Conversation
The `code serve-web` CLI accepts `--enable-proposed-api EXTENSION_ID` but never propagated the allowlist to the workbench environment service or the server-side extension scanner. As a result, extensions declaring `enabledApiProposals` in their package.json had their proposals wiped at runtime by ExtensionsProposedApi and failed to activate. This wires the flag through two paths so it matches desktop behavior: 1. Server scanner: extend IProductService.extensionsEnabledWithApiProposalVersion in setupServerServices so the node extension scanner keeps the manifest's enabledApiProposals when --enable-proposed-api is passed. 2. Workbench env service: add a new `enabledExtensionProposedApi` field to IWorkbenchConstructionOptions, populate it from the CLI args in webClientServer, and surface it via BrowserWorkbenchEnvironmentService .extensionEnabledProposedApi so the runtime allowlist in ExtensionsProposedApi matches the requested IDs. Fixes microsoft#228781
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Fixes #228781
The
code serve-webCLI accepts--enable-proposed-api EXTENSION_IDbut never propagated the allowlist to the workbench environment service or the server-side extension scanner. Extensions declaringenabledApiProposalsin theirpackage.jsontherefore had their proposals wiped at runtime byExtensionsProposedApiand failed to activate with:Approach
This wires the flag through two paths so it matches desktop behavior:
Server scanner (
src/vs/server/node/serverServices.ts): extendIProductService.extensionsEnabledWithApiProposalVersioninsetupServerServicesso the node extension scanner (AbstractExtensionsScannerService) keeps the manifest'senabledApiProposalswhen--enable-proposed-apiis passed.Workbench environment service: add a new
enabledExtensionProposedApifield toIWorkbenchConstructionOptions, populate it from the CLI args inwebClientServer.ts, and surface it viaBrowserWorkbenchEnvironmentService.extensionEnabledProposedApiso the runtime allowlist inExtensionsProposedApimatches the requested extension IDs.The existing
productConfiguration.extensionsEnabledWithApiProposalVersionpropagation inwebClientServer.tsis preserved — that field is still needed by the browser-sidewebExtensionsScannerServicefor web extensions.Repro / verification
"enabledApiProposals": ["chatParticipantPrivate"]in itspackage.json.code --enable-proposed-api="publisher.myextension" serve-web --port 11001 --without-connection-token --accept-server-license-termsWithout this PR the activation fails as in the issue. With this PR it succeeds, matching the behavior of
codedesktop with the same flag.