Skip to content
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

Cherry-pick ExP platform work from master #12160

Merged
merged 8 commits into from
Jun 5, 2020
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
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