Skip to content

Commit db99be3

Browse files
committed
try opt in @workspace context once if users are in treatment group
1 parent 2af8b45 commit db99be3

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import { CodeWhispererSettings } from '../../../codewhisperer/util/codewhisperer
4949
import { getSelectedCustomization } from '../../../codewhisperer/util/customizationUtil'
5050
import { getHttpStatusCode, AwsClientResponseError } from '../../../shared/errors'
5151
import { uiEventRecorder } from '../../../amazonq/util/eventRecorder'
52-
import { globals, waitUntil } from '../../../shared'
5352
import { telemetry } from '../../../shared/telemetry'
5453
import { isSsoConnection } from '../../../auth/connection'
5554
import { inspect } from '../../../shared/utilities/collectionUtils'

packages/core/src/shared/featureConfig.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const Features = {
3535
customizationArnOverride: 'customizationArnOverride',
3636
dataCollectionFeature: 'IDEProjectContextDataCollection',
3737
projectContextFeature: 'ProjectContextV2',
38+
workspaceContextFeature: 'WorkspaceContext',
3839
test: 'testFeature',
3940
} as const
4041

@@ -83,6 +84,21 @@ export class FeatureConfigProvider {
8384
}
8485
}
8586

87+
getWorkspaceContextGroup(): 'control' | 'treatment' {
88+
const variation = this.featureConfigs.get(Features.projectContextFeature)?.variation
89+
90+
switch (variation) {
91+
case 'CONTROL':
92+
return 'control'
93+
94+
case 'TREATMENT':
95+
return 'treatment'
96+
97+
default:
98+
return 'control'
99+
}
100+
}
101+
86102
public async listFeatureEvaluations(): Promise<ListFeatureEvaluationsResponse> {
87103
const request: ListFeatureEvaluationsRequest = {
88104
userContext: {
@@ -157,7 +173,7 @@ export class FeatureConfigProvider {
157173
await vscode.commands.executeCommand('aws.amazonq.refreshStatusBar')
158174
}
159175
}
160-
if (Auth.instance.isInternalAmazonUser()) {
176+
if (this.getWorkspaceContextGroup() === 'treatment') {
161177
// Enable local workspace index by default only once, for Amzn users.
162178
const isSet = globals.globalState.get<boolean>('aws.amazonq.workspaceIndexToggleOn') || false
163179
if (!isSet) {

0 commit comments

Comments
 (0)