kreait / firebase-php

Unofficial Firebase Admin SDK for PHP
https://firebase-php.readthedocs.io/
MIT License
2.26k stars 430 forks source link

Rollouts #923

Closed kersjous closed 1 month ago

kersjous commented 1 month ago

Describe the feature you would like to see

Hello guys,

are you planning to implement support for Remote Config Rollouts (https://firebase.google.com/docs/remote-config/rollouts)?

With current version if I have rollout in conditional param (I'm not even updating changing it, it's only defined in firebase console) I cannot publish because of validation error:

Invalid value at 'remote_config.parameters[0].value.conditional_values[0].value' (Map), Cannot have repeated items ('############') within a map. Invalid value at 'remote_config.parameter_groups[2].value.parameters[0].value.conditional_values[0].value' (Map), Cannot have repeated items ('############') within a map.

Thanks and keep up great work!

jeromegamez commented 1 month ago

From the top of my head I don't recognize this as an error directly created within the SDK, so it looks to me as if this was something returned by the API, is this correct?

I'm not familiar with Remote Config Rollouts, and I'd like to look into it, but since I only have a basic Firebase Project without apps, Crashlytics or Google Analytics available, I might not be able to reproduce the context.

If you could provide me with the structure of your RemoteConfig template after fetching it with the SDK and as much as information as possible (stripped of sensitive data, of course), that would be of great help!

kersjous commented 1 month ago

Here is stripdown remote config from my test project. remote_config_test.json I've tested this one and it gives same error.

jeromegamez commented 1 month ago

I created #927 to add support for rollout values in the Remote Config template. Please note that it's not (yet?) possible to create rollouts programmatically via the Firebase API. This means that you have to manually create a rollout in the Firebase console to be able to reference it in the Remote Config template.

Rollout IDs are named rollout_<number>, and you can find the ID in the URL after clicking on a rollout in the list.

I will merge and release the MR if/once the tests pass.

jeromegamez commented 1 month ago

Released with 7.15.0

kersjous commented 1 month ago

Looking good, thanks a lot!