Skip to content

Commit

Permalink
Cherry-pick ExP platform work from master (#12160)
Browse files Browse the repository at this point in the history
* 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 <don.jayamanne@yahoo.com>
* 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 <don.jayamanne@yahoo.com>

* 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 <don.jayamanne@yahoo.com>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 5, 2020
1 parent 4c78f3b commit 620b614
Show file tree
Hide file tree
Showing 85 changed files with 863 additions and 334 deletions.
14 changes: 11 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ function getAllowedWarningsForWebPack(buildConfig) {
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/validation.js',
'WARNING in ./node_modules/any-promise/register.js',
'WARNING in ./node_modules/log4js/lib/appenders/index.js',
'WARNING in ./node_modules/log4js/lib/clustering.js'
'WARNING in ./node_modules/log4js/lib/clustering.js',
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
];
case 'extension':
return [
Expand All @@ -300,10 +302,16 @@ function getAllowedWarningsForWebPack(buildConfig) {
'remove-files-plugin@1.4.0:',
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/buffer-util.js',
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/validation.js',
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/Validation.js'
'WARNING in ./node_modules/@jupyterlab/services/node_modules/ws/lib/Validation.js',
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
];
case 'debugAdapter':
return ['WARNING in ./node_modules/vscode-uri/lib/index.js'];
return [
'WARNING in ./node_modules/vscode-uri/lib/index.js',
'WARNING in ./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js',
'WARNING in ./node_modules/applicationinsights/out/AutoCollection/NativePerformance.js'
];
default:
throw new Error('Unknown WebPack Configuration');
}
Expand Down
1 change: 1 addition & 0 deletions news/1 Enhancements/10790.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Integrate VS Code experiment framework in the extension.
1 change: 1 addition & 0 deletions news/2 Fixes/11943.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure user cannot belong to all experiments in an experiment group.
1 change: 1 addition & 0 deletions news/3 Code Health/11597.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update telemetry on errors and exceptions to use [vscode-extension-telemetry](https://www.npmjs.com/package/vscode-extension-telemetry).
131 changes: 114 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2986,11 +2986,12 @@
"untildify": "^3.0.2",
"vscode-debugadapter": "^1.28.0",
"vscode-debugprotocol": "^1.28.0",
"vscode-extension-telemetry": "0.1.0",
"vscode-extension-telemetry": "0.1.4",
"vscode-jsonrpc": "^5.0.1",
"vscode-languageclient": "^6.2.0-next.2",
"vscode-languageserver": "^6.2.0-next.2",
"vscode-languageserver-protocol": "^3.16.0-next.2",
"vscode-tas-client": "^0.0.757",
"vsls": "^0.3.1291",
"winreg": "^1.2.4",
"winston": "^3.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/aaTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { inject, injectable } from 'inversify';
import { ValidateABTesting } from '../common/experimentGroups';
import { ValidateABTesting } from '../common/experiments/groups';
import { IExperimentsManager } from '../common/types';
import { IExtensionSingleActivationService } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/activationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TextDocument } from 'vscode';
import { IApplicationDiagnostics } from '../application/types';
import { IActiveResourceService, IDocumentManager, IWorkspaceService } from '../common/application/types';
import { DEFAULT_INTERPRETER_SETTING, PYTHON_LANGUAGE } from '../common/constants';
import { DeprecatePythonPath } from '../common/experimentGroups';
import { DeprecatePythonPath } from '../common/experiments/groups';
import { traceDecorators } from '../common/logger';
import { IFileSystem } from '../common/platform/types';
import { IDisposable, IExperimentsManager, IInterpreterPathService, Resource } from '../common/types';
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/activationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { LSNotSupportedDiagnosticServiceId } from '../application/diagnostics/ch
import { IDiagnosticsService } from '../application/diagnostics/types';
import { IApplicationShell, ICommandManager, IWorkspaceService } from '../common/application/types';
import { STANDARD_OUTPUT_CHANNEL } from '../common/constants';
import { LSControl, LSEnabled } from '../common/experimentGroups';
import { LSControl, LSEnabled } from '../common/experiments/groups';
import { traceError } from '../common/logger';
import {
IConfigurationService,
Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/extensionSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { inject, injectable, optional } from 'inversify';
import * as querystring from 'querystring';
import { IApplicationEnvironment, IApplicationShell } from '../common/application/types';
import { ShowExtensionSurveyPrompt } from '../common/experimentGroups';
import { ShowExtensionSurveyPrompt } from '../common/experiments/groups';
import '../common/extensions';
import { traceDecorators } from '../common/logger';
import { IPlatformService } from '../common/platform/types';
Expand Down
7 changes: 5 additions & 2 deletions src/client/activation/languageClientMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import {

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

// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
const formattedMethod = method.replace(/\//g, '.');

const properties = {
lsVersion: this.serverVersion || 'unknown',
method: method
method: formattedMethod
};

const stopWatch = new StopWatch();
Expand Down
7 changes: 6 additions & 1 deletion src/client/activation/languageServer/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export class DotNetLanguageServerProxy implements ILanguageServerProxy {
if (settings.downloadLanguageServer) {
this.languageClient.onTelemetry((telemetryEvent) => {
const eventName = telemetryEvent.EventName || EventName.PYTHON_LANGUAGE_SERVER_TELEMETRY;
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
const formattedProperties = {
...telemetryEvent.Properties,
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
};
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
});
}
await this.registerTestServices();
Expand Down
7 changes: 6 additions & 1 deletion src/client/activation/node/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
if (settings.downloadLanguageServer) {
this.languageClient.onTelemetry((telemetryEvent) => {
const eventName = telemetryEvent.EventName || EventName.LANGUAGE_SERVER_TELEMETRY;
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
const formattedProperties = {
...telemetryEvent.Properties,
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
method: telemetryEvent.Properties.method?.replace(/\//g, '.')
};
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
});
}
await this.registerTestServices();
Expand Down
2 changes: 1 addition & 1 deletion src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { isTestExecution } from './common/constants';
import { DebugAdapterNewPtvsd } from './common/experimentGroups';
import { DebugAdapterNewPtvsd } from './common/experiments/groups';
import { traceError } from './common/logger';
import { IConfigurationService, IExperimentsManager, Resource } from './common/types';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { inject, injectable } from 'inversify';
import { ConfigurationChangeEvent, DiagnosticSeverity, Uri } from 'vscode';
import { IWorkspaceService } from '../../../common/application/types';
import { DeprecatePythonPath } from '../../../common/experimentGroups';
import { DeprecatePythonPath } from '../../../common/experiments/groups';
import '../../../common/extensions';
import { IPlatformService } from '../../../common/platform/types';
import {
Expand Down
Loading

0 comments on commit 620b614

Please sign in to comment.