Skip to content

chore: update code to 1.71.2 #5580

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

Merged
merged 7 commits into from
Sep 23, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ci/build/build-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ main() {
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
"linkProtectionTrustedDomains": [
"https://open-vsx.org"
]
],
"aiConfig": {
"ariaKey": "code-server"
}
}
EOF
) > product.json
Expand Down
13 changes: 0 additions & 13 deletions patches/safari-console.diff

This file was deleted.

1 change: 0 additions & 1 deletion patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ telemetry.diff
display-language.diff
cli-window-open.diff
exec-argv.diff
safari-console.diff
78 changes: 0 additions & 78 deletions patches/telemetry.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Add support for telemetry endpoint

Contains some fixes included in https://github.com/microsoft/vscode/commit/b108bc8294ce920fcf2ee8d53f97c3bcf3316e1c

To test:
1. Look inside a build of code-server, inside `lib/vscode/vs/server/node/server.main.js`
2. Search for a `JSON.stringify` near `TelemetryClient`
Expand Down Expand Up @@ -89,82 +87,6 @@ Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
+ } catch (error) {}
+ }
+}
Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
===================================================================
--- 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
@@ -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) {
- 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);
- const telemetryProvider: ITelemetryAppender = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey);
- appenders.push(telemetryProvider);
- appenders.push(new TelemetryLogAppender(loggerService, environmentService));
- const config: ITelemetryServiceConfig = {
- appenders,
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
- sendErrorTelemetry: this.sendErrorTelemetry,
- };
+ 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);
+ appenders.push(new TelemetryLogAppender(loggerService, environmentService));
+ const config: ITelemetryServiceConfig = {
+ appenders,
+ commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
+ sendErrorTelemetry: this.sendErrorTelemetry,
+ };
+
+ return this._register(new BaseTelemetryService(config, configurationService, productService));
+ } else {
+ 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
Expand Down