Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Updated the Firebase Admin SDK Remote Config API to support Rollouts, Experiments, and Personalization managed value types by introducing new POJOs in ParameterValue and updating TemplateResponse DTO mapping.


PR created automatically by Jules for task 15537558531219952152 started by @ashish-kothari

Added support for Rollouts, Experiments, and Personalization value types in the Remote Config API.
- Updated `ParameterValue` to include `RolloutValue`, `PersonalizationValue`, and `ExperimentValue` subclasses.
- Added factory methods `rollout`, `personalization`, and `experiment` to `ParameterValue`.
- Updated `TemplateResponse` to parse `rolloutValue`, `personalizationValue`, and `experimentValue` fields from the backend response.
- Added unit tests for the new value types.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@ashish-kothari ashish-kothari self-assigned this Dec 31, 2025
@ashish-kothari ashish-kothari marked this pull request as ready for review December 31, 2025 09:58
Copy link

@ashish-kothari ashish-kothari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the specific file comments, let's also add tests to -

  • ParameterTest.java to validate the correctness of the new types
  • FirebaseRemoteConfigTest.java to validate that the template is parsed correctly when it contains these managed values.

* @param percent The percentage of the rollout.
* @return A {@link ParameterValue.RolloutValue} instance.
*/
public static RolloutValue rollout(String rolloutId, String value, double percent) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to ofRollout(...).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Renamed rollout to ofRollout.

* @param personalizationId The personalization ID.
* @return A {@link ParameterValue.PersonalizationValue} instance.
*/
public static PersonalizationValue personalization(String personalizationId) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to ofPersonalization(...).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Renamed personalization to ofPersonalization.

* @param variantValues The list of experiment variant values.
* @return A {@link ParameterValue.ExperimentValue} instance.
*/
public static ExperimentValue experiment(String experimentId,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to ofExperiment(...).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Renamed experiment to ofExperiment.

@Key("experimentId")
private String experimentId;

@Key("experimentVariantValues")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key should be variantValue instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Changed key to variantValue.

- Renamed factory methods in ParameterValue to ofRollout, ofPersonalization, and ofExperiment.
- Updated JSON key for experiment variant values to variantValue in TemplateResponse.
Comment on lines +123 to +126
ParameterValue.ExperimentValue experimentValueThree =
ParameterValue.ofExperiment("experiment_2", ImmutableList.of(
ExperimentVariantValue.of("variant_1", "value_1")
));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add another experiment value with different variant values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test case for experiment value with different variant values.

@ashish-kothari ashish-kothari removed their assignment Dec 31, 2025
Added a new test case to `ParameterValueTest` to verify that `ExperimentValue` objects with the same ID but different variant values are not equal.
Copy link

@ashish-kothari ashish-kothari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add tests to -

  • ParameterTest.java to validate the correctness of the new types
  • FirebaseRemoteConfigTest.java to validate that the template is parsed correctly when it contains these managed values.

…ConfigTest

- Added `testEqualityWithManagedValues` to `ParameterTest` to verify equality of parameters with `RolloutValue`, `PersonalizationValue`, and `ExperimentValue`.
- Added `testGetTemplateWithManagedValues` to `FirebaseRemoteConfigTest` to verify that `getTemplate()` correctly parses managed values.
Comment on lines 158 to 161
"p1", new Parameter().setDefaultValue(
ParameterValue.ofRollout("rollout_1", "value_1", 10.0)),
"p2", new Parameter().setDefaultValue(
ParameterValue.ofPersonalization("personalization_1"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to set managed values as default values, use the setConditionalValues() method instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification. I have updated the test to use setConditionalValues() for the managed values.

Updated `testGetTemplateWithManagedValues` in `FirebaseRemoteConfigTest` to set managed values (Rollout, Personalization) as conditional values instead of default values, as they are not supported as default values.
@ashish-kothari ashish-kothari merged commit cd24728 into kotharas/rc-managed-values Dec 31, 2025
1 check passed
@ashish-kothari ashish-kothari deleted the remote-config-managed-values-15537558531219952152 branch December 31, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant