Skip to content

Commit fc05994

Browse files
authored
Remove caching debug configuration experiment only (#17896)
1 parent 350da1d commit fc05994

File tree

5 files changed

+8
-22
lines changed

5 files changed

+8
-22
lines changed

news/3 Code Health/17895.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove caching debug configuration experiment only.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@
505505
"All",
506506
"pythonDeprecatePythonPath",
507507
"pythonSurveyNotification",
508-
"pythonTensorboardExperiment",
509-
"pythonRememberDebugConfig"
508+
"pythonTensorboardExperiment"
510509
]
511510
},
512511
"scope": "machine",
@@ -520,8 +519,7 @@
520519
"All",
521520
"pythonDeprecatePythonPath",
522521
"pythonSurveyNotification",
523-
"pythonTensorboardExperiment",
524-
"pythonRememberDebugConfig"
522+
"pythonTensorboardExperiment"
525523
]
526524
},
527525
"scope": "machine",

src/client/common/experiments/groups.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,3 @@ export enum NativeTensorBoard {
2828
export enum TorchProfiler {
2929
experiment = 'PythonPyTorchProfiler',
3030
}
31-
32-
// Experiment to cache debug configuration
33-
export enum CacheDebugConfig {
34-
experiment = 'pythonRememberDebugConfig',
35-
}

src/client/debugger/extension/configuration/debugConfigurationService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import { inject, injectable, named } from 'inversify';
77
import { cloneDeep } from 'lodash';
88
import { CancellationToken, DebugConfiguration, QuickPickItem, WorkspaceFolder } from 'vscode';
9-
import { CacheDebugConfig } from '../../../common/experiments/groups';
10-
import { IExperimentService } from '../../../common/types';
119
import { DebugConfigStrings } from '../../../common/utils/localize';
1210
import {
1311
IMultiStepInput,
@@ -32,7 +30,6 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi
3230
@inject(IDebugConfigurationProviderFactory)
3331
private readonly providerFactory: IDebugConfigurationProviderFactory,
3432
@inject(IMultiStepInputFactory) private readonly multiStepFactory: IMultiStepInputFactory,
35-
@inject(IExperimentService) private readonly experiments: IExperimentService,
3633
) {}
3734

3835
public async provideDebugConfigurations(
@@ -70,7 +67,10 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi
7067
throw Error(
7168
'This configuration can only be used by the test debugging commands. `"request": "test"` is deprecated use "purpose" instead.',
7269
);
73-
} else if (((debugConfiguration as LaunchRequestArguments).purpose ?? []).length > 0) {
70+
} else if (
71+
debugConfiguration.request === 'launch' &&
72+
((debugConfiguration as LaunchRequestArguments).purpose ?? []).length > 0
73+
) {
7474
// We reach here only if people try to use debug-test or debug-in-terminal purpose for
7575
// launching a file via F5 or "start with debugging".
7676
// 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
8181
throw Error('This configuration can only be used as defined by `purpose`.');
8282
} else {
8383
if (Object.keys(debugConfiguration).length === 0) {
84-
if ((await this.experiments.inExperiment(CacheDebugConfig.experiment)) && this.cacheDebugConfig) {
84+
if (this.cacheDebugConfig) {
8585
debugConfiguration = cloneDeep(this.cacheDebugConfig);
8686
} else {
8787
const configs = await this.provideDebugConfigurations(folder, token);

src/test/debugger/extension/configuration/debugConfigurationService.unit.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { expect } from 'chai';
77
import { instance, mock } from 'ts-mockito';
88
import * as typemoq from 'typemoq';
99
import { Uri } from 'vscode';
10-
import { CacheDebugConfig } from '../../../../client/common/experiments/groups';
11-
import { IExperimentService } from '../../../../client/common/types';
1210
import { IMultiStepInput, IMultiStepInputFactory } from '../../../../client/common/utils/multiStepInput';
1311
import { PythonDebugConfigurationService } from '../../../../client/debugger/extension/configuration/debugConfigurationService';
1412
import { DebugConfigurationProviderFactory } from '../../../../client/debugger/extension/configuration/providers/providerFactory';
@@ -22,7 +20,6 @@ suite('Debugging - Configuration Service', () => {
2220
let configService: TestPythonDebugConfigurationService;
2321
let multiStepFactory: typemoq.IMock<IMultiStepInputFactory>;
2422
let providerFactory: DebugConfigurationProviderFactory;
25-
let experiments: typemoq.IMock<IExperimentService>;
2623

2724
class TestPythonDebugConfigurationService extends PythonDebugConfigurationService {
2825
public async pickDebugConfiguration(
@@ -37,17 +34,12 @@ suite('Debugging - Configuration Service', () => {
3734
launchResolver = typemoq.Mock.ofType<IDebugConfigurationResolver<LaunchRequestArguments>>();
3835
multiStepFactory = typemoq.Mock.ofType<IMultiStepInputFactory>();
3936
providerFactory = mock(DebugConfigurationProviderFactory);
40-
experiments = typemoq.Mock.ofType<IExperimentService>();
41-
experiments
42-
.setup((e) => e.inExperiment(typemoq.It.isValue(CacheDebugConfig.experiment)))
43-
.returns(() => Promise.resolve(true));
4437

4538
configService = new TestPythonDebugConfigurationService(
4639
attachResolver.object,
4740
launchResolver.object,
4841
instance(providerFactory),
4942
multiStepFactory.object,
50-
experiments.object,
5143
);
5244
});
5345
test('Should use attach resolver when passing attach config', async () => {

0 commit comments

Comments
 (0)