-
Notifications
You must be signed in to change notification settings - Fork 417
Support Rollout, Personalization, and Experiment values in Remote Config #3042
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 1 commit
466b648
af761b8
d51fe02
d71dce2
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 |
|---|---|---|
|
|
@@ -354,12 +354,73 @@ export interface InAppDefaultValue { | |
| useInAppDefault: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * Represents a Rollout value. | ||
| */ | ||
| export interface RolloutValue { | ||
| rolloutId: string; | ||
| value: string; | ||
| percent: number; // Numeric value between 1-100 | ||
| } | ||
|
|
||
| /** | ||
| * Represents a Personalization value. | ||
| */ | ||
| export interface PersonalizationValue { | ||
| personalizationId: string; | ||
| } | ||
|
|
||
| /** | ||
| * Represents a specific no change variant value within an Experiment. | ||
| */ | ||
| export interface ExperimentVariantExplicitValue { | ||
| variantId: string; | ||
| value: string; | ||
| noChange?: never; | ||
| } | ||
|
|
||
| /** | ||
| * Represents a no-change variant value within an Experiment. | ||
| */ | ||
| export interface ExperimentVariantNoChange { | ||
| variantId: string; | ||
| value?: never; | ||
| noChange: true; | ||
| } | ||
|
|
||
| export type ExperimentVariantValue = ExperimentVariantExplicitValue | ExperimentVariantNoChange; | ||
|
|
||
| /** | ||
| * Represents an Experiment value. | ||
| */ | ||
| export interface ExperimentValue { | ||
| experimentId: string; | ||
| variantValues: ExperimentVariantValue[]; | ||
|
Contributor
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. The field in
Contributor
Author
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. Done. Renamed |
||
| } | ||
|
|
||
| export interface RolloutParameterValue { | ||
| rolloutValue: RolloutValue; | ||
| } | ||
|
|
||
| export interface PersonalizationParameterValue { | ||
| personalizationValue: PersonalizationValue; | ||
| } | ||
|
|
||
| export interface ExperimentParameterValue { | ||
| experimentValue: ExperimentValue; | ||
| } | ||
|
|
||
| /** | ||
| * Type representing a Remote Config parameter value. | ||
| * A `RemoteConfigParameterValue` could be either an `ExplicitParameterValue` or | ||
| * an `InAppDefaultValue`. | ||
| */ | ||
| export type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue; | ||
| export type RemoteConfigParameterValue = | ||
| | ExplicitParameterValue | ||
| | InAppDefaultValue | ||
| | RolloutParameterValue | ||
| | PersonalizationParameterValue | ||
| | ExperimentParameterValue; | ||
|
|
||
| /** | ||
| * Interface representing a Remote Config parameter. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,6 +96,48 @@ describe('RemoteConfig', () => { | |
| description: 'this is a promo', | ||
| valueType: 'BOOLEAN', | ||
| }, | ||
| new_ui_enabled: { | ||
| defaultValue: { value: 'false' }, | ||
| conditionalValues: { | ||
| ios: { | ||
| rolloutValue: { | ||
| rolloutId: 'rollout_1', | ||
| value: 'true', | ||
| percent: 50, | ||
| } | ||
| } | ||
| }, | ||
| description: 'New UI Rollout', | ||
| valueType: 'BOOLEAN', | ||
| }, | ||
| personalized_welcome_message: { | ||
| defaultValue: { value: 'Welcome!' }, | ||
| conditionalValues: { | ||
| ios: { | ||
| personalizationValue: { | ||
| personalizationId: 'personalization_1', | ||
| } | ||
| } | ||
| }, | ||
| description: 'Personalized Welcome Message', | ||
| valueType: 'STRING', | ||
| }, | ||
| experiment_enabled: { | ||
| defaultValue: { value: 'false' }, | ||
| conditionalValues: { | ||
| ios: { | ||
| experimentValue: { | ||
| experimentId: 'experiment_1', | ||
| variantValues: [ | ||
| { variantId: 'variant_A', value: 'true' }, | ||
| { variantId: 'variant_B', noChange: true } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| description: 'Experiment Enabled', | ||
| valueType: 'BOOLEAN', | ||
| } | ||
| }, | ||
| parameterGroups: PARAMETER_GROUPS, | ||
| etag: 'etag-123456789012-5', | ||
|
|
@@ -153,6 +195,48 @@ describe('RemoteConfig', () => { | |
| description: 'this is a promo', | ||
| valueType: 'BOOLEAN', | ||
| }, | ||
| new_ui_enabled: { | ||
| defaultValue: { value: 'false' }, | ||
| conditionalValues: { | ||
| ios: { | ||
| rolloutValue: { | ||
| rolloutId: 'rollout_1', | ||
| value: 'true', | ||
| percent: 50, | ||
| } | ||
| } | ||
| }, | ||
| description: 'New UI Rollout', | ||
| valueType: 'BOOLEAN', | ||
| }, | ||
| personalized_welcome_message: { | ||
| defaultValue: { value: 'Welcome!' }, | ||
| conditionalValues: { | ||
| ios: { | ||
| personalizationValue: { | ||
| personalizationId: 'personalization_1', | ||
| } | ||
| } | ||
| }, | ||
| description: 'Personalized Welcome Message', | ||
| valueType: 'STRING', | ||
| }, | ||
| experiment_enabled: { | ||
| defaultValue: { value: 'false' }, | ||
| conditionalValues: { | ||
| ios: { | ||
| experimentValue: { | ||
| experimentId: 'experiment_1', | ||
| variantValues: [ | ||
| { variantId: 'variant_A', value: 'true' }, | ||
| { variantId: 'variant_B', noChange: true } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| description: 'Experiment Enabled', | ||
| valueType: 'BOOLEAN', | ||
| } | ||
|
Comment on lines
+198
to
+239
Contributor
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. Let's skip editing
Contributor
Author
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. Reverted the changes to
Contributor
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. It should be the other way around, apply these changes to
Contributor
Author
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. Thank you for the clarification. I have updated |
||
| }, | ||
| parameterGroups: PARAMETER_GROUPS, | ||
| etag: 'etag-123456789012-6', | ||
|
|
||
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.
Update the docstring as : "Represents a specific variant value within an Experiment".
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.
Updated the docstring to: "Represents a specific variant value within an Experiment".