Skip to content

Add custom auto-enablement for app testing#9373

Merged
tagboola merged 4 commits intofeature-branch/mcp/mobile-testingfrom
tagboola/apptesting-enablement
Oct 23, 2025
Merged

Add custom auto-enablement for app testing#9373
tagboola merged 4 commits intofeature-branch/mcp/mobile-testingfrom
tagboola/apptesting-enablement

Conversation

@tagboola
Copy link
Contributor

Description

By default, tools and prompts for products are enabled by the following process:

  • If the product is defined in the firebase.json file
  • If the API has been enabled and can be reached for the project

Because out product won't necessarily be defined in the firebase.json, I added a custom enablement function that enables our tools/prompts if:

  • The app is a mobile app and
  • Our API has been enabled and can be reached for the project

Scenarios Tested

Sample Commands

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tagboola, 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 introduces a specialized auto-enablement process for Firebase App Testing features. It moves away from the standard firebase.json based configuration for this product, instead enabling App Testing tools and prompts dynamically if the project is identified as a mobile application (Android, iOS, or Flutter) and the necessary API is active. This change streamlines the developer experience for mobile projects by making App Testing readily available without manual configuration.

Highlights

  • Custom Auto-Enablement for App Testing: Introduced a custom mechanism to automatically enable App Testing tools and prompts. Unlike other products that rely on firebase.json configuration, App Testing will now be enabled if the project is detected as a mobile application (Android, iOS, or Flutter) and its corresponding API is active.
  • New Availability Logic: Added a new utility function isAppTestingAvailable which determines the availability of App Testing by checking if the project directory contains mobile app structures (e.g., Android, iOS, Flutter files) and if the App Distribution API is enabled for the project.
  • Feature Registration: The 'apptesting' feature has been added to the list of DETECTED_API_FEATURES and its custom availability check (isAppTestingAvailable) has been registered in the system, overriding the default firebase.json based enablement.
  • Tool and Prompt Updates: Existing prompt and tool definitions for App Testing (specifically runTest, run_tests, and check_test) have been updated to explicitly declare 'apptesting' as their associated product.
  • Unit Tests for Availability: Comprehensive unit tests have been added for the isAppTestingAvailable function, covering various scenarios including non-mobile projects, disabled APIs, and different types of mobile projects (Android, iOS, Flutter) with enabled APIs.
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 a custom auto-enablement check for the App Testing feature, which is a great addition. The implementation correctly verifies if the project is a mobile app and if the necessary API is enabled. The new logic is well-integrated into the existing prompt and tool framework. I've provided a few suggestions to improve the code, including removing a describe.only from a test file which is important to fix, cleaning up some commented-out code, and a minor refactoring for better readability.

@tagboola tagboola merged commit 380b001 into feature-branch/mcp/mobile-testing Oct 23, 2025
44 checks passed
@tagboola tagboola deleted the tagboola/apptesting-enablement branch October 23, 2025 19:50
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 23, 2025
tagboola added a commit that referenced this pull request Nov 7, 2025
* creation of feature branch

* New MCP tool for running mobile tests (via app distribution). (#9250)

* Scaffolding for new appdistribution MCP tool.

* Refactor business logic out of the appdistribution CLI so that it can be used by an MCP tool.

* Wire new appdistribution tool up to the business logic.

* Fix linting errors.

* Update src/appdistribution/distribution.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Jamie Rothfeder <rothbutter@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Rename appdistribution directory to apptesting (#9268)

* Rename appdistribution directory to apptesting

* Make variables consistent with directory rename.

---------

Co-authored-by: Jamie Rothfeder <rothbutter@google.com>

* Use a datastructure to represent test devices rather than a string. (#9280)

* Use a datastructure to represent test devices rather than a string.

* Update src/mcp/tools/apptesting/tests.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update src/mcp/tools/apptesting/tests.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Pretty

---------

Co-authored-by: Jamie Rothfeder <rothbutter@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Add run_test prompt (#9292)

* Add initial MCP prompt for running automated tests

* Fix typos

* MCP tool `apptesting_run_test` can create and run a on-off test. (#9321)

* Create a on-off test and execute.

* Can now create a on-off test.

* Update src/appdistribution/client.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update src/mcp/tools/apptesting/tests.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* PR feedback

* Separate test check in to a different tool so that gemini can orchestrate running and checking for completion.

* Set the devices field to optional

---------

Co-authored-by: Jamie Rothfeder <rothbutter@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Use the same default device that's used in the Console (#9320)

* Update prompt to support generating a test case when there is no test description (#9322)

* Use the same default device that's used in the Console

* Update prompt to support generating a test case when there is no test description passed

* Add custom auto-enablement for app testing (#9373)

* Add custom auto-enablement for app testing

* Address gemini code assist comments

* Fix intersection bug

* Fix issues with test

* Add get devices tool (#9387)

* Display link to results in the Firebase Console (#9406)

* Place app testing tools behind an experiment

* Address GCA comments

* Explicitly set default devices

* Address PR comments

* Fix the status URL. (#9438)

Co-authored-by: Jamie Rothfeder <rothbutter@google.com>

---------

Co-authored-by: Jamie Rothfeder <rothbutter@google.com>
Co-authored-by: Jamie Rothfeder <jamie.rothfeder@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

2 participants