Skip to content

Commit e95acf5

Browse files
authored
fix(amazonq): AB users with overridden customization can restore the default customization #6450
## Problem Users that are part of an AB group that have a customization override can't go back to the default customization. This was the original intention but has been relaxed after feedback. ## Solution Update setSelectedCustomization to no longer check if the user is trying to switch back to the default customization.
1 parent dca8c5d commit e95acf5

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Allow AB users with an overridden customization to go back to the default customization"
4+
}

packages/core/src/codewhisperer/util/customizationUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const getSelectedCustomization = (): Customization => {
113113
)
114114
const selectedCustomization = selectedCustomizationArr[AuthUtil.instance.conn.label]
115115

116-
if (selectedCustomization && selectedCustomization.name !== baseCustomization.name) {
116+
if (selectedCustomization && selectedCustomization.name !== '') {
117117
return selectedCustomization
118118
} else {
119119
const customizationFeature = FeatureConfigProvider.getFeature(Features.customizationArnOverride)

packages/core/src/test/amazonq/customizationUtil.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ describe('CodeWhisperer-customizationUtils', function () {
8585
it('Returns AB customization', async function () {
8686
sinon.stub(AuthUtil.instance, 'isValidEnterpriseSsoInUse').returns(true)
8787

88-
await setSelectedCustomization(baseCustomization)
88+
await setSelectedCustomization({
89+
arn: '',
90+
name: '',
91+
})
8992

9093
const returnedCustomization = getSelectedCustomization()
9194

0 commit comments

Comments
 (0)