Conversation
Summary of ChangesHello @falahat, 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 enhances the Firebase CLI's Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request adds the ability to specify a runtime via a new --runtime flag in the CLI when creating an App Hosting backend. The implementation is straightforward and includes new unit tests to cover the changes. My review includes a couple of suggestions to improve code maintainability by reducing duplication in both the core logic and the tests.
… to pass the runtime)
|
I used gemini to run through some manual test flows. I'm going to verify these manually as well. Manual Test ResultsScenario 1: Experiment Gating1.1: Experiment DisabledCommand: firebase experiments:disable abiu
firebase apphosting:backends:create --project PROJECT_ID --helpResult: ABIU-related flags ( Command: firebase apphosting:backends:create --project PROJECT_ID --runtime nodejs22Result: Fails with Scenario 2: Creation Permutations2.1: Explicitly Enable ABIUCommand: firebase experiments:enable abiu
firebase apphosting:backends:create --project PROJECT_ID --automatic-base-image-updates --debugResult: Backend created successfully. Status in Note "N/A" is expected in staging because the server omits the 2.2: Runtime + Explicit ABIUCommand: firebase apphosting:backends:create --project PROJECT_ID --runtime nodejs22 --automatic-base-image-updates --debugResult: Backend created successfully. Status in 2.3: Implicit ABIU (Default)Command: firebase apphosting:backends:create --project PROJECT_ID --runtime nodejs22 --debugResult: Backend created successfully. Status in 2.4: Explicitly Disable ABIUCommand: firebase apphosting:backends:create --project PROJECT_ID --no-automatic-base-image-updates --debugResult: Backend created successfully. Status in 2.5: Runtime + Disable ABIUCommand: firebase apphosting:backends:create --project PROJECT_ID --runtime nodejs22 --no-automatic-base-image-updates --debugResult: Backend created successfully. Status in 2.6: Empty Runtime Flag (The "Swallowing" Fix)Command: firebase apphosting:backends:create --project PROJECT_ID --runtime "" --debugResult:
Scenario 3: Non-Interactive Mode3.1: Explicit All FlagsCommand: firebase apphosting:backends:create --project PROJECT_ID --backend non-int-explicit --primary-region us-central1 --runtime nodejs22 --no-automatic-base-image-updates --non-interactive --debugResult: Backend created successfully with specified values. (VERIFIED) 3.2: Missing Required Flag (The "Defaulting" Behavior)Command: firebase apphosting:backends:create --project PROJECT_ID --backend non-int-missing --primary-region us-central1 --non-interactive --debugResult:
3.3: Explicit Empty Runtime FlagCommand: firebase apphosting:backends:create --project PROJECT_ID --backend non-int-empty --primary-region us-central1 --runtime "" --non-interactive --debugResult:
3.4: Experiment Gating (Non-Interactive)Command: firebase experiments:disable abiu
firebase apphosting:backends:create --project PROJECT_ID --backend non-int-gated --primary-region us-central1 --runtime nodejs22 --non-interactive --debugResult: Correctly fails with Summary of Findings
|
|
I manually confirmed these test cases. I found 2 issues:
I don't think either of these issues are blockers for this pull request, however. |
falahat
left a comment
There was a problem hiding this comment.
I need to also verify if the "init" command needs to be updated, since that also creates backends.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds the ability to specify a runtime and configure automatic base image updates when creating an App Hosting backend via the CLI. The changes are gated behind the abiu experiment flag. The implementation looks solid, with corresponding updates to the backend list command and comprehensive unit tests for the new functionality. I have one suggestion to improve the readability of the flag parsing logic.
| const automaticBaseImageUpdatesDisabled = abiuAllowed | ||
| ? options.automaticBaseImageUpdates === false | ||
| : undefined; |
There was a problem hiding this comment.
The logic for automaticBaseImageUpdatesDisabled is concise but relies on subtle behavior of how commander handles paired flags like --[no-]automatic-base-image-updates. To improve long-term maintainability and make the code more self-documenting, consider refactoring this to be more explicit.
let automaticBaseImageUpdatesDisabled: boolean | undefined;
if (abiuAllowed) {
// When --no-automatic-base-image-updates is used, options.automaticBaseImageUpdates is false.
// Otherwise, it's true or undefined. We default to enabling updates unless explicitly disabled.
automaticBaseImageUpdatesDisabled = options.automaticBaseImageUpdates === false;
}|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to specify a runtime and control automatic base image updates (ABIU) for App Hosting backends, gated by an abiu experiment flag. The changes include updating API types, modifying the apphosting:backends:create command to accept new options, and dynamically adjusting the apphosting:backends:list output. New unit tests have been added to cover the new functionality and flag interactions.
There is a discrepancy between the expected behavior for an empty runtime string as described in the pull request's sample commands and the current implementation. The CLI should treat an empty string provided via --runtime "" as an implicit request for the default runtime, rather than passing an empty string to the API.
Base branch requires signed commits
Description
runtimewhen creating a backendScenarios Tested
See the full test plan below (I ran with Gemini and then re-ran it manually as a final pass.)
Sample Commands
See the full test plan in a below comment.
Prompt for runtime selection in interactive mode:
Today, the list of valid runtimes is hardcoded but the CLI will be able to call the Control Plane API, ListSupportedRuntimes, to fetch the list live.
Create a backend with an empty runtime (defaults to nodejs runtime):
Create a backend with an unsupported runtime (expected to fail):