Archived
1
0

Update to 1.71 (#5535)

* chore: update upstream code

* update patches for vs 1.71.0

the cli fix seems to be fixed in upstream, the telemtry patch requires (again) some fixing and adjustments.

* add safari fix.

* increase ci timeout

Co-authored-by: Joe Previte <jjprevite@gmail.com>
This commit is contained in:
Florian Ritterhoff
2022-09-09 18:28:54 +02:00
committed by GitHub
parent a1cf4b9ea5
commit b486354d6e
12 changed files with 89 additions and 112 deletions

View File

@ -1,5 +1,7 @@
Add support for telemetry endpoint
Contains some fixes included in https://github.com/microsoft/vscode/commit/b108bc8294ce920fcf2ee8d53f97c3bcf3316e1c
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
@ -86,12 +88,45 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
@@ -38,26 +38,30 @@ export class TelemetryService extends Di
@@ -15,7 +15,7 @@ import { ClassifiedEvent, IGDPRProperty,
import { ITelemetryData, ITelemetryInfo, ITelemetryService, TelemetryLevel, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry';
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
import { ITelemetryServiceConfig, TelemetryService as BaseTelemetryService } from 'vs/platform/telemetry/common/telemetryService';
-import { isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
+import { getTelemetryLevel, isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/browser/workbenchCommonProperties';
@@ -24,7 +24,7 @@ export class TelemetryService extends Di
declare readonly _serviceBrand: undefined;
- private impl: ITelemetryService;
+ private impl: ITelemetryService = NullTelemetryService;
public readonly sendErrorTelemetry = true;
constructor(
@@ -37,11 +37,7 @@ export class TelemetryService extends Di
) {
super();
- if (supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey) {
+ if (supportsTelemetry(productService, environmentService)) {
- this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService);
- } else {
- this.impl = NullTelemetryService;
- }
+ this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService);
// When the level changes it could change from off to on and we want to make sure telemetry is properly intialized
this._register(configurationService.onDidChangeConfiguration(e => {
@@ -64,23 +60,28 @@ export class TelemetryService extends Di
productService: IProductService,
remoteAgentService: IRemoteAgentService
) {
- const telemetrySupported = supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey;
- if (telemetrySupported && this.impl === NullTelemetryService && this.telemetryLevel.value !== TelemetryLevel.NONE) {
+ const telemetrySupported = supportsTelemetry(productService, environmentService);
+ if (telemetrySupported && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE && this.impl === NullTelemetryService) {
// If remote server is present send telemetry through that, else use the client side appender
const appenders = [];
const isInternal = isInternalTelemetry(productService, configurationService);
@ -103,14 +138,6 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
- sendErrorTelemetry: this.sendErrorTelemetry,
- };
- this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
-
- if (getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
- // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
- // This is most likely due to ad blockers
- fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => {
- this.impl = NullTelemetryService;
- });
+ const telemetryProvider: ITelemetryAppender | undefined = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : productService.aiConfig?.ariaKey ? new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey) : undefined;
+ if (telemetryProvider) {
+ appenders.push(telemetryProvider);
@ -120,20 +147,19 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme
+ commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
+ sendErrorTelemetry: this.sendErrorTelemetry,
+ };
+ this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
+
+ if (remoteAgentService.getConnection() === null && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) {
+ // If we cannot fetch the endpoint it means it is down and we should not send any telemetry.
+ // This is most likely due to ad blockers
+ fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => {
+ this.impl = NullTelemetryService;
+ });
+ }
+ return this._register(new BaseTelemetryService(config, configurationService, productService));
+ } else {
+ this.impl = NullTelemetryService;
}
} else {
this.impl = NullTelemetryService;
+ return this.impl;
+ }
- return this._register(new BaseTelemetryService(config, configurationService, productService));
}
- return NullTelemetryService;
+ return this.impl;
}
setExperimentProperty(name: string, value: string): void {
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts