You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Problem
https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/codewhisperer/util/customizationUtil.ts#L116-L130
The flaw of previous implementation won't override customization if
users have selected one.
The team is asking
1. Ability to override regardless users are with a customization or not
2. Should respect users' selection afterward when users switch back to
the customization they prefer
3. When ab service provides a new override customization arn, plugins
should be able to do override again
```
// as long as there is a customization selected, override will not happen no matter what
if (selectedCustomization && selectedCustomization.name !== '') {
return selectedCustomization
} else {
const customizationFeature = FeatureConfigProvider.getFeature(Features.customizationArnOverride)
const arnOverride = customizationFeature?.value.stringValue
const customizationOverrideName = customizationFeature?.variation
if (arnOverride === undefined) {
return baseCustomization
} else {
return {
arn: arnOverride,
name: customizationOverrideName,
description: baseCustomization.description,
}
}
```
## Solution
1. Persist a value of "previous override arn" and do override when the
provided customization arn is different than "previous override arn"
---
- 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.
* @param isOverride if the API call is made from us (Q) but not users' intent, set isOverride to TRUE
122
+
* Override happens when ALL following conditions are met
123
+
* 1. service returns non-empty override customization arn, refer to [featureConfig.ts]
124
+
* 2. the override customization arn is different from the previous override customization if any. The purpose is to only do override once on users' behalf.
it(`setSelectedCustomization should only set to the customization provided once for override per customization arn if override is true`,asyncfunction(){
0 commit comments