diff --git a/news/3 Code Health/17895.md b/news/3 Code Health/17895.md new file mode 100644 index 000000000000..011f1dcceb5b --- /dev/null +++ b/news/3 Code Health/17895.md @@ -0,0 +1 @@ +Remove caching debug configuration experiment only. diff --git a/package.json b/package.json index 35445857b4cd..2426b4376849 100644 --- a/package.json +++ b/package.json @@ -505,8 +505,7 @@ "All", "pythonDeprecatePythonPath", "pythonSurveyNotification", - "pythonTensorboardExperiment", - "pythonRememberDebugConfig" + "pythonTensorboardExperiment" ] }, "scope": "machine", @@ -520,8 +519,7 @@ "All", "pythonDeprecatePythonPath", "pythonSurveyNotification", - "pythonTensorboardExperiment", - "pythonRememberDebugConfig" + "pythonTensorboardExperiment" ] }, "scope": "machine", diff --git a/src/client/common/experiments/groups.ts b/src/client/common/experiments/groups.ts index b4b21aa3659a..c206a2dcce34 100644 --- a/src/client/common/experiments/groups.ts +++ b/src/client/common/experiments/groups.ts @@ -28,8 +28,3 @@ export enum NativeTensorBoard { export enum TorchProfiler { experiment = 'PythonPyTorchProfiler', } - -// Experiment to cache debug configuration -export enum CacheDebugConfig { - experiment = 'pythonRememberDebugConfig', -} diff --git a/src/client/debugger/extension/configuration/debugConfigurationService.ts b/src/client/debugger/extension/configuration/debugConfigurationService.ts index 56fe0746e887..37c38a8d5661 100644 --- a/src/client/debugger/extension/configuration/debugConfigurationService.ts +++ b/src/client/debugger/extension/configuration/debugConfigurationService.ts @@ -6,8 +6,6 @@ import { inject, injectable, named } from 'inversify'; import { cloneDeep } from 'lodash'; import { CancellationToken, DebugConfiguration, QuickPickItem, WorkspaceFolder } from 'vscode'; -import { CacheDebugConfig } from '../../../common/experiments/groups'; -import { IExperimentService } from '../../../common/types'; import { DebugConfigStrings } from '../../../common/utils/localize'; import { IMultiStepInput, @@ -32,7 +30,6 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi @inject(IDebugConfigurationProviderFactory) private readonly providerFactory: IDebugConfigurationProviderFactory, @inject(IMultiStepInputFactory) private readonly multiStepFactory: IMultiStepInputFactory, - @inject(IExperimentService) private readonly experiments: IExperimentService, ) {} public async provideDebugConfigurations( @@ -70,7 +67,10 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi throw Error( 'This configuration can only be used by the test debugging commands. `"request": "test"` is deprecated use "purpose" instead.', ); - } else if (((debugConfiguration as LaunchRequestArguments).purpose ?? []).length > 0) { + } else if ( + debugConfiguration.request === 'launch' && + ((debugConfiguration as LaunchRequestArguments).purpose ?? []).length > 0 + ) { // We reach here only if people try to use debug-test or debug-in-terminal purpose for // launching a file via F5 or "start with debugging". // debug-test : is not allowed to be launched via (F5 or "start with debugging") since it @@ -81,7 +81,7 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi throw Error('This configuration can only be used as defined by `purpose`.'); } else { if (Object.keys(debugConfiguration).length === 0) { - if ((await this.experiments.inExperiment(CacheDebugConfig.experiment)) && this.cacheDebugConfig) { + if (this.cacheDebugConfig) { debugConfiguration = cloneDeep(this.cacheDebugConfig); } else { const configs = await this.provideDebugConfigurations(folder, token); diff --git a/src/test/debugger/extension/configuration/debugConfigurationService.unit.test.ts b/src/test/debugger/extension/configuration/debugConfigurationService.unit.test.ts index 6ebf2c009c43..8495d4820c0a 100644 --- a/src/test/debugger/extension/configuration/debugConfigurationService.unit.test.ts +++ b/src/test/debugger/extension/configuration/debugConfigurationService.unit.test.ts @@ -7,8 +7,6 @@ import { expect } from 'chai'; import { instance, mock } from 'ts-mockito'; import * as typemoq from 'typemoq'; import { Uri } from 'vscode'; -import { CacheDebugConfig } from '../../../../client/common/experiments/groups'; -import { IExperimentService } from '../../../../client/common/types'; import { IMultiStepInput, IMultiStepInputFactory } from '../../../../client/common/utils/multiStepInput'; import { PythonDebugConfigurationService } from '../../../../client/debugger/extension/configuration/debugConfigurationService'; import { DebugConfigurationProviderFactory } from '../../../../client/debugger/extension/configuration/providers/providerFactory'; @@ -22,7 +20,6 @@ suite('Debugging - Configuration Service', () => { let configService: TestPythonDebugConfigurationService; let multiStepFactory: typemoq.IMock; let providerFactory: DebugConfigurationProviderFactory; - let experiments: typemoq.IMock; class TestPythonDebugConfigurationService extends PythonDebugConfigurationService { public async pickDebugConfiguration( @@ -37,17 +34,12 @@ suite('Debugging - Configuration Service', () => { launchResolver = typemoq.Mock.ofType>(); multiStepFactory = typemoq.Mock.ofType(); providerFactory = mock(DebugConfigurationProviderFactory); - experiments = typemoq.Mock.ofType(); - experiments - .setup((e) => e.inExperiment(typemoq.It.isValue(CacheDebugConfig.experiment))) - .returns(() => Promise.resolve(true)); configService = new TestPythonDebugConfigurationService( attachResolver.object, launchResolver.object, instance(providerFactory), multiStepFactory.object, - experiments.object, ); }); test('Should use attach resolver when passing attach config', async () => {