-
Notifications
You must be signed in to change notification settings - Fork 272
Update STE UserTriggerDecision and UserModification events #4955
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
Changes from 4 commits
68880af
5016751
05402f4
3cfb3c8
ced1b87
ecd7019
0684a6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,14 @@ | |
featureConfigs[it.feature()] = FeatureContext(it.feature(), it.variation(), it.value()) | ||
} | ||
|
||
// Only apply new auto-trigger UX to BID users | ||
val isNewAutoTriggerUX = getNewAutoTriggerUX() | ||
if (isNewAutoTriggerUX) { | ||
calculateIfIamIdentityCenterConnection(project) { | ||
featureConfigs.remove(NEW_AUTO_TRIGGER_UX) | ||
} | ||
} | ||
|
||
val customizationArnOverride = featureConfigs[CUSTOMIZATION_ARN_OVERRIDE_NAME]?.value?.stringValue() | ||
if (customizationArnOverride != null) { | ||
// Double check if server-side wrongly returns a customizationArn to BID users | ||
|
@@ -84,20 +92,24 @@ | |
|
||
fun getCustomizationArnOverride(): String = getFeatureValueForKey(CUSTOMIZATION_ARN_OVERRIDE_NAME).stringValue() | ||
|
||
fun getNewAutoTriggerUX(): Boolean = getFeatureValueForKey(NEW_AUTO_TRIGGER_UX).boolValue() | ||
Check notice on line 95 in plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererFeatureConfigService.kt
|
||
|
||
// Get the feature value for the given key. | ||
// In case of a misconfiguration, it will return a default feature value of Boolean true. | ||
// In case of a misconfiguration, it will return a default feature value of Boolean false. | ||
private fun getFeatureValueForKey(name: String): FeatureValue = | ||
featureConfigs[name]?.value ?: FEATURE_DEFINITIONS[name]?.value | ||
?: FeatureValue.builder().boolValue(true).build() | ||
?: FeatureValue.builder().boolValue(false).build() | ||
|
||
companion object { | ||
fun getInstance(): CodeWhispererFeatureConfigService = service() | ||
private const val TEST_FEATURE_NAME = "testFeature" | ||
private const val DATA_COLLECTION_FEATURE = "IDEProjectContextDataCollection" | ||
const val CUSTOMIZATION_ARN_OVERRIDE_NAME = "customizationArnOverride" | ||
private const val NEW_AUTO_TRIGGER_UX = "newAutoTriggerUX" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could make these constants sealed data object There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can do this later There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
private val LOG = getLogger<CodeWhispererFeatureConfigService>() | ||
|
||
// TODO: add real feature later | ||
// Also serve as default values in case server-side config isn't there yet | ||
internal val FEATURE_DEFINITIONS = mapOf( | ||
TEST_FEATURE_NAME to FeatureContext( | ||
TEST_FEATURE_NAME, | ||
|
@@ -109,7 +121,12 @@ | |
CUSTOMIZATION_ARN_OVERRIDE_NAME, | ||
"customizationARN", | ||
FeatureValue.builder().stringValue("").build() | ||
) | ||
), | ||
NEW_AUTO_TRIGGER_UX to FeatureContext( | ||
NEW_AUTO_TRIGGER_UX, | ||
"CONTROL", | ||
FeatureValue.builder().boolValue(false).build() | ||
), | ||
) | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.