Skip to content

Commit ec67825

Browse files
authored
Set Insiders target population as VS Code Insiders for ExP (#24412)
To avoid confusion with the overlap between traffic filters from VS Code core and the Python extension with ExP, we are removing the `python-insider` and `python-public` values as acceptable values for Target Population, and instead are assigning VS Code insiders as `insider` and stable as `public`.
1 parent 85a18d4 commit ec67825

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

src/client/common/experiments/service.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { inject, injectable } from 'inversify';
77
import { l10n } from 'vscode';
8-
import { getExperimentationService, IExperimentationService } from 'vscode-tas-client';
8+
import { getExperimentationService, IExperimentationService, TargetPopulation } from 'vscode-tas-client';
99
import { traceLog } from '../../logging';
1010
import { sendTelemetryEvent } from '../../telemetry';
1111
import { EventName } from '../../telemetry/constants';
@@ -17,16 +17,6 @@ import { ExperimentationTelemetry } from './telemetry';
1717
const EXP_MEMENTO_KEY = 'VSCode.ABExp.FeatureData';
1818
const EXP_CONFIG_ID = 'vscode';
1919

20-
/**
21-
* We're defining a custom TargetPopulation specific for the Python extension.
22-
* This is done so the exp framework is able to differentiate between
23-
* VS Code insiders/public users and Python extension insiders (pre-release)/public users.
24-
*/
25-
export enum TargetPopulation {
26-
Insiders = 'python-insider',
27-
Public = 'python-public',
28-
}
29-
3020
@injectable()
3121
export class ExperimentService implements IExperimentService {
3222
/**
@@ -73,8 +63,8 @@ export class ExperimentService implements IExperimentService {
7363
}
7464

7565
let targetPopulation: TargetPopulation;
76-
77-
if (this.appEnvironment.extensionChannel === 'insiders') {
66+
// if running in VS Code Insiders, use the Insiders target population
67+
if (this.appEnvironment.channel === 'insiders') {
7868
targetPopulation = TargetPopulation.Insiders;
7969
} else {
8070
targetPopulation = TargetPopulation.Public;

src/test/common/experiments/service.unit.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import { Disposable } from 'vscode-jsonrpc';
1111
// sinon can not create a stub if we just point to the exported module
1212
import * as tasClient from 'vscode-tas-client/vscode-tas-client/VSCodeTasClient';
1313
import * as expService from 'vscode-tas-client';
14+
import { TargetPopulation } from 'vscode-tas-client';
1415
import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment';
1516
import { IApplicationEnvironment, IWorkspaceService } from '../../../client/common/application/types';
1617
import { WorkspaceService } from '../../../client/common/application/workspace';
1718
import { Channel } from '../../../client/common/constants';
18-
import { ExperimentService, TargetPopulation } from '../../../client/common/experiments/service';
19+
import { ExperimentService } from '../../../client/common/experiments/service';
1920
import { PersistentState } from '../../../client/common/persistentState';
2021
import { IPersistentStateFactory } from '../../../client/common/types';
2122
import { registerLogger } from '../../../client/logging';
@@ -74,13 +75,13 @@ suite('Experimentation service', () => {
7475
}
7576

7677
function configureApplicationEnvironment(channel: Channel, version: string, contributes?: Record<string, unknown>) {
77-
when(appEnvironment.extensionChannel).thenReturn(channel);
78+
when(appEnvironment.channel).thenReturn(channel);
7879
when(appEnvironment.extensionName).thenReturn(PVSC_EXTENSION_ID_FOR_TESTS);
7980
when(appEnvironment.packageJson).thenReturn({ version, contributes });
8081
}
8182

8283
suite('Initialization', () => {
83-
test('Users with a release version of the extension should be in the Public target population', () => {
84+
test('Users with VS Code stable version should be in the Public target population', () => {
8485
const getExperimentationServiceStub = sinon.stub(tasClient, 'getExperimentationService');
8586
configureSettings(true, [], []);
8687
configureApplicationEnvironment('stable', extensionVersion);
@@ -99,7 +100,7 @@ suite('Experimentation service', () => {
99100
);
100101
});
101102

102-
test('Users with an Insiders version of the extension should be the Insiders target population', () => {
103+
test('Users with VS Code Insiders version should be the Insiders target population', () => {
103104
const getExperimentationServiceStub = sinon.stub(tasClient, 'getExperimentationService');
104105

105106
configureSettings(true, [], []);

0 commit comments

Comments
 (0)