Browse Source

Merge pull request #2339 from daiyam/fix

Baptiste Augrain 1 month ago
parent
commit
1fc99ea06a

+ 9 - 0
patches/chat.patch

@@ -0,0 +1,9 @@
+diff --git a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
+index 56220de..68d708f 100644
+--- a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
++++ b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts
+@@ -142,3 +142,3 @@ configurationRegistry.registerConfiguration({
+ 			markdownDescription: nls.localize('chat.commandCenter.enabled', "Controls whether the command center shows a menu for actions to control Copilot (requires {0}).", '`#window.commandCenter#`'),
+-			default: true
++			default: false
+ 		},

+ 11 - 10
patches/feat-announcements.patch

@@ -1,21 +1,22 @@
 diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts
-index c581ac0..f11c0f0 100644
+index e025130..f42db8d 100644
 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts
 +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts
-@@ -319,2 +319,8 @@ configurationRegistry.registerConfiguration({
+@@ -343,2 +343,9 @@ configurationRegistry.registerConfiguration({
  		},
 +		'workbench.welcomePage.extraAnnouncements': {
 +			scope: ConfigurationScope.MACHINE,
 +			type: 'boolean',
 +			default: true,
-+			description: localize('workbench.welcomePage.extraAnnouncements', "When enabled, the get started page loads additional announcements from !!APP_NAME!!'s repository.")
++			description: localize('workbench.welcomePage.extraAnnouncements', "When enabled, the get started page loads additional announcements from !!APP_NAME!!'s repository."),
++			tags: ['usesOnlineServices']
 +		},
  		'workbench.startupEditor': {
 diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
-index 664c55b..43f9e2e 100644
+index 01778b2..615828d 100644
 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
 +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
-@@ -113,4 +113,8 @@ type GettingStartedActionEvent = {
+@@ -117,4 +117,8 @@ type GettingStartedActionEvent = {
  type RecentEntry = (IRecentFolder | IRecentWorkspace) & { id: string };
 +type AnnouncementEntry = { id: string, title: string, url: string };
  
@@ -24,26 +25,26 @@ index 664c55b..43f9e2e 100644
 +const BUILTIN_ANNOUNCEMENTS: AnnouncementEntry[] = [/* BUILTIN_ANNOUNCEMENTS */];
 +
  export class GettingStartedPage extends EditorPane {
-@@ -149,2 +153,4 @@ export class GettingStartedPage extends EditorPane {
+@@ -154,2 +158,4 @@ export class GettingStartedPage extends EditorPane {
  	private gettingStartedList?: GettingStartedIndexList<IResolvedWalkthrough>;
 +	private announcementList?: GettingStartedIndexList<AnnouncementEntry>;
 +	private announcementData?: AnnouncementEntry[];
  
-@@ -812,2 +818,3 @@ export class GettingStartedPage extends EditorPane {
+@@ -880,2 +886,3 @@ export class GettingStartedPage extends EditorPane {
  		const gettingStartedList = this.buildGettingStartedWalkthroughsList();
 +		const announcementList = await this.buildAnnouncementList();
  
-@@ -822,3 +829,3 @@ export class GettingStartedPage extends EditorPane {
+@@ -890,3 +897,3 @@ export class GettingStartedPage extends EditorPane {
  				this.container.classList.remove('noWalkthroughs');
 -				reset(rightColumn, gettingStartedList.getDomElement());
 +				reset(rightColumn, gettingStartedList.getDomElement(), announcementList.getDomElement());
  			}
-@@ -826,3 +833,3 @@ export class GettingStartedPage extends EditorPane {
+@@ -894,3 +901,3 @@ export class GettingStartedPage extends EditorPane {
  				this.container.classList.add('noWalkthroughs');
 -				reset(rightColumn);
 +				reset(rightColumn, announcementList.getDomElement());
  			}
-@@ -978,2 +985,55 @@ export class GettingStartedPage extends EditorPane {
+@@ -1047,2 +1054,55 @@ export class GettingStartedPage extends EditorPane {
  
 +	private async buildAnnouncementList(): Promise<GettingStartedIndexList<AnnouncementEntry>> {
 +		const renderAnnouncement = (announcement: AnnouncementEntry) => {

+ 29 - 0
patches/feat-ext-unsafe.patch

@@ -0,0 +1,29 @@
+diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
+index a0afbe7..7a4aaa5 100644
+--- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
++++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts
+@@ -1764,2 +1764,8 @@ export abstract class AbstractExtensionGalleryService implements IExtensionGalle
+ 
++		const excludeUnsafes = this.configurationService.getValue('extensions.excludeUnsafes') ?? true;
++
++		if (!excludeUnsafes) {
++			return { malicious: [], deprecated: {}, search: [] };
++		}
++
+ 		const context = await this.requestService.request({
+diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts
+index 34a5326..ee0dd6c 100644
+--- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts
++++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts
+@@ -357,3 +357,10 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
+ 				}
+-			}
++			},
++			'extensions.excludeUnsafes': {
++				scope: ConfigurationScope.MACHINE,
++				type: 'boolean',
++				default: true,
++				description: localize('extensionsExcludeUnsafes', "When enabled, it will download and cache the list of malicious and deprecated extensions. It's recommended to leave it enabled."),
++				tags: ['usesOnlineServices']
++			},
+ 		}

+ 7 - 3
patches/version-0-release.patch

@@ -22,11 +22,15 @@ index cd8610d..2d928b1 100644
 +			.pipe(replace('@@VERSION@@', packageJson.version))
  			// Possible run-on values https://snapcraft.io/docs/architectures
 diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts
-index f13affa..60f0ccb 100644
+index 0db2369..5cac67b 100644
 --- a/src/vs/workbench/api/common/extHost.api.impl.ts
 +++ b/src/vs/workbench/api/common/extHost.api.impl.ts
-@@ -1548,3 +1548,3 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
+@@ -1537,5 +1537,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
+ 
++		const version = initData.version.replace(/^([0-9]+\.[0-9]+\.[0-5]).*$/, '$1');
++
+ 		// eslint-disable-next-line local/code-no-dangerous-type-assertions
  		return <typeof vscode>{
 -			version: initData.version,
-+			version: initData.version.replace(/\.0+/g, '.'),
++			version,
  			// namespaces

+ 49 - 7
patches/version-1-update.patch

@@ -67,7 +67,7 @@ index a1ec3fe..f954720 100644
 +	}
  }
 diff --git a/src/vs/platform/update/electron-main/updateService.darwin.ts b/src/vs/platform/update/electron-main/updateService.darwin.ts
-index 57398fb..b30ef50 100644
+index 57398fb..fddd521 100644
 --- a/src/vs/platform/update/electron-main/updateService.darwin.ts
 +++ b/src/vs/platform/update/electron-main/updateService.darwin.ts
 @@ -15,3 +15,3 @@ import { ILogService } from '../../log/common/log.js';
@@ -80,7 +80,7 @@ index 57398fb..b30ef50 100644
 +import { CancellationToken } from '../../../base/common/cancellation.js';
 +import * as semver from 'semver';
  
-@@ -76,9 +78,3 @@ export class DarwinUpdateService extends AbstractUpdateService implements IRelau
+@@ -76,17 +78,3 @@ export class DarwinUpdateService extends AbstractUpdateService implements IRelau
  	protected buildUpdateFeedUrl(quality: string): string | undefined {
 -		let assetID: string;
 -		if (!this.productService.darwinUniversalAssetId) {
@@ -89,9 +89,17 @@ index 57398fb..b30ef50 100644
 -			assetID = this.productService.darwinUniversalAssetId;
 -		}
 -		const url = createUpdateURL(assetID, quality, this.productService);
-+		const url = createUpdateURL(this.productService, quality, process.platform, process.arch);
- 		try {
-@@ -94,4 +90,29 @@ export class DarwinUpdateService extends AbstractUpdateService implements IRelau
+-		try {
+-			electron.autoUpdater.setFeedURL({ url });
+-		} catch (e) {
+-			// application is very likely not signed
+-			this.logService.error('Failed to set update feed URL', e);
+-			return undefined;
+-		}
+-		return url;
++		return createUpdateURL(this.productService, quality, process.platform, process.arch);
+ 	}
+@@ -94,4 +82,36 @@ export class DarwinUpdateService extends AbstractUpdateService implements IRelau
  	protected doCheckForUpdates(context: any): void {
 +		if (!this.url) {
 +			return;
@@ -116,21 +124,55 @@ index 57398fb..b30ef50 100644
 +					this.setState(State.Idle(UpdateType.Setup));
 +				}
 +				else {
++					electron.autoUpdater.setFeedURL({ url: this.url as string });
 +					electron.autoUpdater.checkForUpdates();
 +				}
 +
 +				return Promise.resolve(null);
 +			})
++			.then(undefined, err => {
++				this.logService.error(err);
++				// only show message when explicitly checking for updates
++				const message: string | undefined = !!context ? (err.message || err) : undefined;
++				this.setState(State.Idle(UpdateType.Setup, message));
++			});
  	}
 diff --git a/src/vs/platform/update/electron-main/updateService.linux.ts b/src/vs/platform/update/electron-main/updateService.linux.ts
-index dd18900..920dc10 100644
+index dd18900..33ef8e5 100644
 --- a/src/vs/platform/update/electron-main/updateService.linux.ts
 +++ b/src/vs/platform/update/electron-main/updateService.linux.ts
-@@ -31,3 +31,3 @@ export class LinuxUpdateService extends AbstractUpdateService {
+@@ -15,2 +15,3 @@ import { AvailableForDownload, IUpdate, State, UpdateType } from '../common/upda
+ import { AbstractUpdateService, createUpdateURL } from './abstractUpdateService.js';
++import * as semver from 'semver';
+ 
+@@ -31,3 +32,3 @@ export class LinuxUpdateService extends AbstractUpdateService {
  	protected buildUpdateFeedUrl(quality: string): string {
 -		return createUpdateURL(`linux-${process.arch}`, quality, this.productService);
 +		return createUpdateURL(this.productService, quality, process.platform, process.arch);
  	}
+@@ -40,2 +41,3 @@ export class LinuxUpdateService extends AbstractUpdateService {
+ 		this.setState(State.CheckingForUpdates(context));
++
+ 		this.requestService.request({ url: this.url }, CancellationToken.None)
+@@ -45,5 +47,17 @@ export class LinuxUpdateService extends AbstractUpdateService {
+ 					this.setState(State.Idle(UpdateType.Archive));
+-				} else {
++
++					return Promise.resolve(null);
++				}
++
++				const fetchedVersion = /\d+\.\d+\.\d+\.\d+/.test(update.productVersion) ? update.productVersion.replace(/(\d+\.\d+\.\d+)\.\d+(\-\w+)?/, '$1$2') : update.productVersion.replace(/(\d+\.\d+\.)0+(\d+)(\-\w+)?/, '$1$2$3')
++				const currentVersion = this.productService.version.replace(/(\d+\.\d+\.)0+(\d+)(\-\w+)?/, '$1$2$3')
++
++				if(semver.compareBuild(currentVersion, fetchedVersion) >= 0) {
++					this.setState(State.Idle(UpdateType.Archive));
++				}
++				else {
+ 					this.setState(State.AvailableForDownload(update));
+ 				}
++
++				return Promise.resolve(null);
+ 			})
 diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts
 index db92de2..2bbdad9 100644
 --- a/src/vs/platform/update/electron-main/updateService.win32.ts