Skip to content

Conversation

rathovarun1032
Copy link

Description

This PR adds the implementation of the CLI utility for Remote Config Experiments & Rollouts. The operations exposed are:

  1. GetExperiment
  2. ListExperiments
  3. DeleteExperiment
  4. GetRollout
  5. ListRollouts
  6. DeleteRollout

Scenarios Tested

  1. Unit tests have been written
  2. Manual E2E tests have been performed for the CLI commands.
  3. The CLI wraps raw API errors into FirebaseError and returns it.
  4. Verify with the --json flag for Get, List and Delete experiments & rollouts.

GetExperiment and DeleteExperiment share similar test cases:

Expectation: The user should pass the experimentID that is required to be fetched / deleted.

Test cases:

Test Case Description Expectation
i Passing a valid experimentId Return the specified experiment.
ii Not passing an experimentId Returns an error about resource being invalid.
iii Passing an incorrect / invalid ID Returns an error about resource being invalid.

ListExperiment

Expectation: The user can optionally pass a filter, page_size and page_token.

Test Case Description Expectation
i Passing none of the filter, page_size and page_token. Return all experiments
ii Passing a valid filter Return the filtered experiment(s)
iii Passing only a valid page size Return page_size number of experiments
iv Passing only a page token Return 10 experiments after the page_token or remaining experiments (minimum of both)
v Passing page_token and page_size Return page_size number of experiments starting at page_token
vi Pass a combination of page_token, page_size and filter Return the filtered experiment(s)
vii Pass an incorrect page_token Return an error stating token is invalid
viii Pass an incorrect / invalid filter Return an empty object or no experiments

GetRollout and DeleteRollout share similar test cases:

Expectation: The user should pass the rolloutId that is required to be fetched / deleted.

Test cases:

Test Case Description Expectation
i Passing a valid rolloutId Return the specified rollout.
ii Not passing a rolloutId Returns an error about resource being invalid.
iii Passing an incorrect / invalid ID Returns an error about resource being invalid.

ListRollouts

Expectation: The user can optionally pass a filter, page_size and page_token.

Test Case Description Expectation
i Passing none of the filter, page_size and page_token. Return all rollouts
ii Passing a valid filter Return the filtered rollout(s)
iii Passing only a valid page size Return page_size number of rollouts
iv Passing only a page token Return 10 rollouts after the page_token or remaining rollouts (minimum of both)
v Passing page_token and page_size Return page_size number of rollouts starting at page_token
vi Pass a combination of page_token, page_size and filter Return the filtered rollout(s)
vii Pass an incorrect page_token Return an error stating token is invalid
viii Pass an incorrect / invalid filter Return an empty object or no rollouts

Sample Commands

  1. GetExperiment

    firebase remoteconfig:experiments:get <experiment ID>

  2. ListExperiment

    firebase remoteconfig:experiement:list --filter <optional filter> --page_size <optional page size> --page token <optional page token>

  3. DeleteExperiment

    firebase remoteconfig:experiments:delete <experiment ID>

  4. GetRollout

    firebase remoteconfig:rollouts:get <rolloutId>

  5. ListRollouts

    firebase remoteconfig:rollouts:list --filter <optional filter> --page_size <optional page size> --page_token <optional page token>

  6. DeleteRollout

    firebase remoteconfig:rollouts:delete <rolloutId>

Namyalg and others added 2 commits September 24, 2025 12:51
Co-authored-by: varun rathore <[email protected]>
Co-authored-by: Varun Rathore <[email protected]>
* Rc rollouts implementation Remote Config Rollouts CLI implementation

---------

Authored-by: Varun Rathore <[email protected]>
Copy link
Contributor

Summary of Changes

Hello @rathovarun1032, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the Firebase CLI's capabilities by introducing a full suite of command-line tools for managing Remote Config Experiments and Rollouts. Users can now perform common operations like retrieving, listing, and deleting these configurations directly from their terminal, streamlining development workflows and providing greater control over their Firebase projects.

Highlights

  • New Remote Config Experiment CLI Commands: Introduced remoteconfig:experiments:get, remoteconfig:experiments:list, and remoteconfig:experiments:delete commands to manage Remote Config experiments directly from the CLI.
  • New Remote Config Rollout CLI Commands: Added remoteconfig:rollouts:get, remoteconfig:rollouts:list, and remoteconfig:rollouts:delete commands for managing Remote Config rollouts via the CLI.
  • Comprehensive API Integration: Implemented robust API calls for each new command, including authentication, permission checks, and detailed error handling, such as preventing deletion of running experiments/rollouts.
  • Pagination and Filtering Support: The list commands for both experiments and rollouts now support pagination (--pageSize, --pageToken) and filtering (--filter) to efficiently retrieve specific data sets.
  • Documentation and Testing: Updated CHANGELOG.md and README.md to reflect the new commands, and included extensive unit tests and manual E2E test scenarios to ensure functionality and error handling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds new CLI commands for managing Remote Config Experiments and Rollouts. The implementation is comprehensive, including commands for getting, listing, and deleting both experiments and rollouts, along with corresponding API clients and tests. The code is well-structured. I've provided some suggestions to improve consistency, correctness, and user experience. Key points include making command arguments required where appropriate, fixing a typo in an error message, and improving consistency in naming and logging.

@rathovarun1032 rathovarun1032 changed the title Rc abt rollouts cli Rc a/b testing & rollouts cli Sep 30, 2025
@rathovarun1032 rathovarun1032 requested a review from joehan October 1, 2025 13:17
Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

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

Some small nits to fix before submitting, but overall this looks great!

.action(async (options: Options) => {
const projectNumber = await needProjectNumber(options);
const listExperimentOptions: ListExperimentOptions = {
pageSize: (options.pageSize as string) ?? DEFAULT_PAGE_SIZE,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like to avoid this sort of casting by adding a specialized RemoteConfigOptions type that is fulfilled by Options. Here's an example from hosting, would love something similar here: https://github.com/firebase/firebase-tools/blob/master/src/hosting/options.ts

Applies for all the commands.

- Improved the clarity of the `firebase apptesting:execute` command when you have zero or multiple apps.
- `firebase dataconnect:sql:migrate` now supports Cloud SQL instances with only private IPs. The command must be run in the same VPC of the instance to work. (##9200)
- Fixed an issue where `firebase deploy --only firestore` would fail with 403 errors on projects that never had a database created.
- Added `remoteconfig:experiments:get`, `remoteconfig:experiments:list`, and `remoteconfig:experiments:delete` commands to manage Remote Config experiments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this CHANGELOG is out of date and is pulling in things that went out in the last release. Can you change this to only include lines 9, 10, and 11?

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.

3 participants