Skip to content

Commit 77676b3

Browse files
authored
feat(amazonq): enable pre flare experiment (#7999)
## Problem ## Solution --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 604bea5 commit 77676b3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
import {
2222
AuthUtil,
2323
CodeWhispererSettings,
24+
FeatureConfigProvider,
2425
getSelectedCustomization,
2526
TelemetryHelper,
2627
vsCodeState,
@@ -339,12 +340,14 @@ async function onLanguageServerReady(
339340
// tutorial for inline chat
340341
const inlineChatTutorialAnnotation = new InlineChatTutorialAnnotation(inlineTutorialAnnotation)
341342

342-
const enableInlineRollback = true
343+
const enableInlineRollback = FeatureConfigProvider.instance.getPreFlareRollbackGroup() === 'treatment'
343344
if (enableInlineRollback) {
344345
// use VSC inline
346+
getLogger().info('Entering preflare logic')
345347
await activateInline(client)
346348
} else {
347349
// use language server for inline completion
350+
getLogger().info('Entering postflare logic')
348351
const inlineManager = new InlineCompletionManager(client, sessionManager, lineTracker, inlineTutorialAnnotation)
349352
inlineManager.registerInlineCompletion()
350353
toDispose.push(

packages/core/src/shared/featureConfig.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const Features = {
3939
dataCollectionFeature: 'IDEProjectContextDataCollection',
4040
projectContextFeature: 'ProjectContextV2',
4141
workspaceContextFeature: 'WorkspaceContext',
42+
preFlareRollbackBIDFeature: 'PreflareRollbackExperiment_BID',
43+
preFlareRollbackIDCFeature: 'PreflareRollbackExperiment_IDC',
4244
test: 'testFeature',
4345
highlightCommand: 'highlightCommand',
4446
} as const
@@ -106,6 +108,16 @@ export class FeatureConfigProvider {
106108
}
107109
}
108110

111+
getPreFlareRollbackGroup(): 'control' | 'treatment' | 'default' {
112+
const variationBid = this.featureConfigs.get(Features.preFlareRollbackBIDFeature)?.variation
113+
const variationIdc = this.featureConfigs.get(Features.preFlareRollbackIDCFeature)?.variation
114+
if (variationBid === 'TREATMENT' || variationIdc === 'TREATMENT') {
115+
return 'treatment'
116+
} else {
117+
return 'control'
118+
}
119+
}
120+
109121
public async listFeatureEvaluations(): Promise<ListFeatureEvaluationsResponse> {
110122
const profile = AuthUtil.instance.regionProfileManager.activeRegionProfile
111123
const request: ListFeatureEvaluationsRequest = {

0 commit comments

Comments
 (0)