Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to configure PPE Url #164460

Merged
merged 1 commit into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/base/common/product.ts
Expand Up @@ -70,6 +70,7 @@ export interface IProductConfiguration {

readonly extensionsGallery?: {
readonly serviceUrl: string;
readonly servicePPEUrl?: string;
readonly searchUrl?: string;
readonly itemUrl: string;
readonly publisherUrl: string;
Expand Down
Expand Up @@ -587,7 +587,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
@IConfigurationService private readonly configurationService: IConfigurationService,
) {
const config = productService.extensionsGallery;
this.extensionsGalleryUrl = config?.serviceUrl;
this.extensionsGalleryUrl = config?.servicePPEUrl && configurationService.getValue('_extensionsGallery.enablePPE') ? config.servicePPEUrl : config?.serviceUrl;
this.extensionsGallerySearchUrl = config?.searchUrl;
this.extensionsControlUrl = config?.controlUrl;
this.commonHeadersPromise = resolveMarketplaceHeaders(
Expand Down
Expand Up @@ -28,6 +28,7 @@ interface IConfiguration extends IWindowsConfiguration {
security?: { workspace?: { trust?: { enabled?: boolean } } };
window: IWindowSettings & { experimental?: { windowControlsOverlay?: { enabled?: boolean }; useSandbox?: boolean } };
workbench?: { experimental?: { settingsProfiles?: { enabled?: boolean } }; enableExperiments?: boolean };
_extensionsGallery?: { enablePPE?: boolean };
}

export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution {
Expand All @@ -43,6 +44,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private workspaceTrustEnabled: boolean | undefined;
private settingsProfilesEnabled: boolean | undefined;
private experimentsEnabled: boolean | undefined;
private enablePPEExtensionsGallery: boolean | undefined;

constructor(
@IHostService private readonly hostService: IHostService,
Expand Down Expand Up @@ -130,6 +132,12 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
changed = true;
}

// Profiles
if (this.productService.quality !== 'stable' && typeof config._extensionsGallery?.enablePPE === 'boolean' && config._extensionsGallery?.enablePPE !== this.enablePPEExtensionsGallery) {
this.enablePPEExtensionsGallery = config._extensionsGallery?.enablePPE;
changed = true;
}

// Notify only when changed and we are the focused window (avoids notification spam across windows)
if (notify && changed) {
this.doConfirm(
Expand Down