-
Notifications
You must be signed in to change notification settings - Fork 751
config(customization): customization override #6545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
jpinkney-aws
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really familiar with this feature but wanted to leave a few comments out of curiosity
|
|
||
| it('Returns AB customization', async function () { | ||
| sinon.stub(AuthUtil.instance, 'isValidEnterpriseSsoInUse').returns(true) | ||
| it(`setSelectedCsutomization should set correctly if override is false or not specified`, async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| it(`setSelectedCsutomization should set correctly if override is false or not specified`, async function () { | |
| it(`setSelectedCustomization should set correctly if override is false or not specified`, async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this test case trying to illustrate? It's not really clear from the title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so when override is true, it's saying the setCustomization is invoked by us and not by users. In such case, the customization we pass in the call setCustomization is from A/B service (not from users), and we will override users' own selection once for each customization arn if there is one provided by the service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when override is false, it means the setCustomization is invoked by users, so we will respect to users' selection anyway
| assert.strictEqual(getSelectedCustomization().arn, 'QOO') | ||
| }) | ||
|
|
||
| it(`setSelectedCsutomization should only do once for override per customization arn`, async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| it(`setSelectedCsutomization should only do once for override per customization arn`, async function () { | |
| it(`setSelectedCustomization should only do once for override per customization arn`, async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
| export const setSelectedCustomization = async (customization: Customization) => { | ||
| /** | ||
| * @param customization customization to select | ||
| * @param isOverride if the API call is made from us (Q) but not users' intent, set isOverride to TRUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API call is made from us (Q)
Do you mean from the extension side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, i want to express it's us to override users' selection and it's not on their own intention to change such configuration
| if (!AuthUtil.instance.isValidEnterpriseSsoInUse() || !AuthUtil.instance.conn) { | ||
| return | ||
| } | ||
| if (isOverride) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding -- this means that the server has received a non empty override customization arn and we want to check whether or not its a new arn. If the same arn is found then we're good to go since there's nothing to do. Otherwise override the customization?
Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
his means that the server has received a non empty override customization arn and we want to check whether or not its a new arn.
this is correct.
If the same arn is found then we're good to go since there's nothing to do. Otherwise override the customization?
yes and no. If the customization arn is same as the last one (which we had done override once), we do nothing because it's intrusive if we change users' selection every time when there is a non-null override customization arn. So we simply ignore the override request for the 2nd times onward
leigaol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please polish your description in the PR. Thanks!
|
Should we not mention this in the changelog? |
@justinmk3 probably not, as it's targeting a subset of users and experiment IMO. (and obviously it's only targeting internal users for sure) |
## 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.
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
Solution
feature/xbranches will not be squash-merged at release time.