Skip to content

Bump vscode-tas-client #22490

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

Closed
wants to merge 1 commit into from
Closed
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
96 changes: 45 additions & 51 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@
"vscode-jsonrpc": "^8.2.0",
"vscode-languageclient": "^9.0.1",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-tas-client": "^0.1.63",
"vscode-tas-client": "^0.1.75",
"which": "^2.0.2",
"winreg": "^1.2.4",
"xml2js": "^0.5.0"
Expand Down
3 changes: 2 additions & 1 deletion src/client/common/experiments/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@

import { inject, injectable } from 'inversify';
import { l10n } from 'vscode';
import { getExperimentationService, IExperimentationService } from 'vscode-tas-client';
import { IExperimentationService } from 'vscode-tas-client';
import { traceLog } from '../../logging';
import { sendTelemetryEvent } from '../../telemetry';
import { EventName } from '../../telemetry/constants';
import { IApplicationEnvironment, IWorkspaceService } from '../application/types';
import { PVSC_EXTENSION_ID } from '../constants';
import { IExperimentService, IPersistentStateFactory } from '../types';
import { ExperimentationTelemetry } from './telemetry';
import { getExperimentationService } from './tasClient';

const EXP_MEMENTO_KEY = 'VSCode.ABExp.FeatureData';
const EXP_CONFIG_ID = 'vscode';
Expand Down
13 changes: 13 additions & 0 deletions src/client/common/experiments/tasClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// For some reason exporting it directly from 'vscode-tas-client' doesn't work well in unit tests with sinon.
// export { getExperimentationService } from 'vscode-tas-client';
// Hence getting it using require...

import type * as tasClientTypes from 'vscode-tas-client';

// eslint-disable-next-line global-require
const tasClient = require('vscode-tas-client') as typeof tasClientTypes;

export const { getExperimentationService } = tasClient;
Comment on lines +1 to +13
Copy link
Author

@karrtikr karrtikr Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried investigating what changed in the definition files, but couldn't find anything obvious. Hence going with this workaround.

9 changes: 5 additions & 4 deletions src/test/common/experiments/service.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import { assert } from 'chai';
import * as sinon from 'sinon';
import { anything, instance, mock, when } from 'ts-mockito';
import { Disposable } from 'vscode-jsonrpc';
import * as tasClient from 'vscode-tas-client';
import { IExperimentationService } from 'vscode-tas-client';
import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment';
import { IApplicationEnvironment, IWorkspaceService } from '../../../client/common/application/types';
import { WorkspaceService } from '../../../client/common/application/workspace';
import { Channel } from '../../../client/common/constants';
import { ExperimentService, TargetPopulation } from '../../../client/common/experiments/service';
import * as tasClient from '../../../client/common/experiments/tasClient';
import { PersistentState } from '../../../client/common/persistentState';
import { IPersistentStateFactory } from '../../../client/common/types';
import { registerLogger } from '../../../client/logging';
Expand Down Expand Up @@ -180,7 +181,7 @@ suite('Experimentation service', () => {
getTreatmentVariable = sinon.stub().returns(true);
sinon.stub(tasClient, 'getExperimentationService').returns(({
getTreatmentVariable,
} as unknown) as tasClient.IExperimentationService);
} as unknown) as IExperimentationService);

configureApplicationEnvironment('stable', extensionVersion);
});
Expand Down Expand Up @@ -218,7 +219,7 @@ suite('Experimentation service', () => {
getTreatmentVariable = sinon.stub().returns(false);
sinon.stub(tasClient, 'getExperimentationService').returns(({
getTreatmentVariable,
} as unknown) as tasClient.IExperimentationService);
} as unknown) as IExperimentationService);

configureApplicationEnvironment('stable', extensionVersion);

Expand Down Expand Up @@ -364,7 +365,7 @@ suite('Experimentation service', () => {
getTreatmentVariableStub = sinon.stub().returns(Promise.resolve('value'));
sinon.stub(tasClient, 'getExperimentationService').returns(({
getTreatmentVariable: getTreatmentVariableStub,
} as unknown) as tasClient.IExperimentationService);
} as unknown) as IExperimentationService);

configureApplicationEnvironment('stable', extensionVersion);
});
Expand Down