Skip to content

Commit 620b614

Browse files
karthiknadigDonJayamannekimadeline
authored
Cherry-pick ExP platform work from master (#12160)
* User cannot belong to all experiments in an experiment group (#11945) * 10790 prep - Create an experiments/ folder (#11980) * experiments.ts -> experiments/manager.ts * eexperimentGroups -> experiments/experimentGroups * test/experiments.u.t -> test/experiments/manager.u.t * experimentGroups -> groups * Whoops committed one file too many * Add support for VS Code's experiment service (#11979) * Add npm package * News entry * experiments.ts -> experiments/manager.ts * Wrong issue number * eexperimentGroups -> experiments/experimentGroups * Move experiments.unit.tests.ts -> experiments/ * Commit new files * Merge gone sideways * Add types * Add opt in/out handling * Activation (service registry) * Don't pin tas-client to one version * Unit tests + fixes * Lol forgot to remove a comment + add headers * Forgot 'use strict' in service.ts * Use IApplicationEnvironment instead of IExtensions * Apply suggestions from code review Co-authored-by: Don Jayamanne <[email protected]> * Remove unnecessary formatted props * n e v e r m i n d * Aight fixed it * flight -> experiment * Check stub calls instead of ctor impl * removed getExperimentService stub check * Set shared properties for all telemetry events * Add test for shared properties Co-authored-by: Don Jayamanne <[email protected]> * Fix merge issues * Fix index unit tests * Revert "Fix index unit tests" This reverts commit 2fb61fc. * Make MPLS and vscode-extension-telemetry work together 🤝 (#11823) * Revert "Revert vscode-extension-telemetry changes for the release (#11602)" This reverts commit 71d1793. * Remove entry from changelog + add new news entry * Update LS code to use periods instead of slashes * Revert "Update LS code to use periods instead of slashes" This reverts commit 1356651. * Replace slashes before sending telemetry instead * Too fast too furious * Fix more merge issues Co-authored-by: Don Jayamanne <[email protected]> Co-authored-by: Kim-Adeline Miguel <[email protected]>
1 parent 4c78f3b commit 620b614

File tree

85 files changed

+863
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+863
-334
lines changed

gulpfile.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ function getAllowedWarningsForWebPack(buildConfig) {
287287
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/validation.js',
288288
'WARNING in ./node_modules/any-promise/register.js',
289289
'WARNING in ./node_modules/log4js/lib/appenders/index.js',
290-
'WARNING in ./node_modules/log4js/lib/clustering.js'
290+
'WARNING in ./node_modules/log4js/lib/clustering.js',
291+
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
292+
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
291293
];
292294
case 'extension':
293295
return [
@@ -300,10 +302,16 @@ function getAllowedWarningsForWebPack(buildConfig) {
300302
301303
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/buffer-util.js',
302304
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/validation.js',
303-
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/Validation.js'
305+
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/Validation.js',
306+
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
307+
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
304308
];
305309
case 'debugAdapter':
306-
return ['WARNING in ./node_modules/vscode-uri/lib/index.js'];
310+
return [
311+
'WARNING in ./node_modules/vscode-uri/lib/index.js',
312+
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
313+
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
314+
];
307315
default:
308316
throw new Error('Unknown WebPack Configuration');
309317
}

news/1 Enhancements/10790.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Integrate VS Code experiment framework in the extension.

news/2 Fixes/11943.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure user cannot belong to all experiments in an experiment group.

news/3 Code Health/11597.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update telemetry on errors and exceptions to use [vscode-extension-telemetry](https://www.npmjs.com/package/vscode-extension-telemetry).

package-lock.json

Lines changed: 114 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2986,11 +2986,12 @@
29862986
"untildify": "^3.0.2",
29872987
"vscode-debugadapter": "^1.28.0",
29882988
"vscode-debugprotocol": "^1.28.0",
2989-
"vscode-extension-telemetry": "0.1.0",
2989+
"vscode-extension-telemetry": "0.1.4",
29902990
"vscode-jsonrpc": "^5.0.1",
29912991
"vscode-languageclient": "^6.2.0-next.2",
29922992
"vscode-languageserver": "^6.2.0-next.2",
29932993
"vscode-languageserver-protocol": "^3.16.0-next.2",
2994+
"vscode-tas-client": "^0.0.757",
29942995
"vsls": "^0.3.1291",
29952996
"winreg": "^1.2.4",
29962997
"winston": "^3.2.1",

src/client/activation/aaTesting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'use strict';
55

66
import { inject, injectable } from 'inversify';
7-
import { ValidateABTesting } from '../common/experimentGroups';
7+
import { ValidateABTesting } from '../common/experiments/groups';
88
import { IExperimentsManager } from '../common/types';
99
import { IExtensionSingleActivationService } from './types';
1010

src/client/activation/activationManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { TextDocument } from 'vscode';
88
import { IApplicationDiagnostics } from '../application/types';
99
import { IActiveResourceService, IDocumentManager, IWorkspaceService } from '../common/application/types';
1010
import { DEFAULT_INTERPRETER_SETTING, PYTHON_LANGUAGE } from '../common/constants';
11-
import { DeprecatePythonPath } from '../common/experimentGroups';
11+
import { DeprecatePythonPath } from '../common/experiments/groups';
1212
import { traceDecorators } from '../common/logger';
1313
import { IFileSystem } from '../common/platform/types';
1414
import { IDisposable, IExperimentsManager, IInterpreterPathService, Resource } from '../common/types';

src/client/activation/activationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { LSNotSupportedDiagnosticServiceId } from '../application/diagnostics/ch
99
import { IDiagnosticsService } from '../application/diagnostics/types';
1010
import { IApplicationShell, ICommandManager, IWorkspaceService } from '../common/application/types';
1111
import { STANDARD_OUTPUT_CHANNEL } from '../common/constants';
12-
import { LSControl, LSEnabled } from '../common/experimentGroups';
12+
import { LSControl, LSEnabled } from '../common/experiments/groups';
1313
import { traceError } from '../common/logger';
1414
import {
1515
IConfigurationService,

src/client/activation/extensionSurvey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { inject, injectable, optional } from 'inversify';
77
import * as querystring from 'querystring';
88
import { IApplicationEnvironment, IApplicationShell } from '../common/application/types';
9-
import { ShowExtensionSurveyPrompt } from '../common/experimentGroups';
9+
import { ShowExtensionSurveyPrompt } from '../common/experiments/groups';
1010
import '../common/extensions';
1111
import { traceDecorators } from '../common/logger';
1212
import { IPlatformService } from '../common/platform/types';

src/client/activation/languageClientMiddleware.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import {
6060

6161
import { ProvideDeclarationSignature } from 'vscode-languageclient/lib/declaration';
6262
import { HiddenFilePrefix } from '../common/constants';
63-
import { CollectLSRequestTiming, CollectNodeLSRequestTiming } from '../common/experimentGroups';
63+
import { CollectLSRequestTiming, CollectNodeLSRequestTiming } from '../common/experiments/groups';
6464
import { IConfigurationService, IExperimentsManager, IPythonExtensionBanner } from '../common/types';
6565
import { StopWatch } from '../common/utils/stopWatch';
6666
import { sendTelemetryEvent } from '../telemetry';
@@ -444,9 +444,12 @@ function captureTelemetryForLSPMethod(method: string, debounceMilliseconds: numb
444444
this.lastCaptured.set(method, now);
445445
this.eventCount += 1;
446446

447+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
448+
const formattedMethod = method.replace(/\//g, '.');
449+
447450
const properties = {
448451
lsVersion: this.serverVersion || 'unknown',
449-
method: method
452+
method: formattedMethod
450453
};
451454

452455
const stopWatch = new StopWatch();

src/client/activation/languageServer/languageServerProxy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ export class DotNetLanguageServerProxy implements ILanguageServerProxy {
7373
if (settings.downloadLanguageServer) {
7474
this.languageClient.onTelemetry((telemetryEvent) => {
7575
const eventName = telemetryEvent.EventName || EventName.PYTHON_LANGUAGE_SERVER_TELEMETRY;
76-
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
76+
const formattedProperties = {
77+
...telemetryEvent.Properties,
78+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
79+
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
80+
};
81+
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
7782
});
7883
}
7984
await this.registerTestServices();

src/client/activation/node/languageServerProxy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
9999
if (settings.downloadLanguageServer) {
100100
this.languageClient.onTelemetry((telemetryEvent) => {
101101
const eventName = telemetryEvent.EventName || EventName.LANGUAGE_SERVER_TELEMETRY;
102-
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
102+
const formattedProperties = {
103+
...telemetryEvent.Properties,
104+
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
105+
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
106+
};
107+
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
103108
});
104109
}
105110
await this.registerTestServices();

src/client/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'use strict';
55

66
import { isTestExecution } from './common/constants';
7-
import { DebugAdapterNewPtvsd } from './common/experimentGroups';
7+
import { DebugAdapterNewPtvsd } from './common/experiments/groups';
88
import { traceError } from './common/logger';
99
import { IConfigurationService, IExperimentsManager, Resource } from './common/types';
1010
import {

src/client/application/diagnostics/checks/macPythonInterpreter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { inject, injectable } from 'inversify';
77
import { ConfigurationChangeEvent, DiagnosticSeverity, Uri } from 'vscode';
88
import { IWorkspaceService } from '../../../common/application/types';
9-
import { DeprecatePythonPath } from '../../../common/experimentGroups';
9+
import { DeprecatePythonPath } from '../../../common/experiments/groups';
1010
import '../../../common/extensions';
1111
import { IPlatformService } from '../../../common/platform/types';
1212
import {

0 commit comments

Comments
 (0)