Skip to content

Conversation

@falahat
Copy link

@falahat falahat commented Jan 12, 2026

Description

Adding the ability to set a runtime version in the CLI when creating a backend.

Scenarios Tested

Note, I havent tested these yet, but it's the plan:

  1. Interactive backend creation:
    • Run firebase apphosting:backends:create and confirm you are prompted to select a runtime.
  2. Backend creation with runtime flag:
    • Run firebase apphosting:backends:create --runtime nodejs22 and verify the backend is created with the specified runtime.
  3. Non-interactive backend creation (default runtime):
    • Run firebase apphosting:backends:create --backend --primary-region --non-interactive and verify the backend
      is created with the default nodejs runtime.
  4. Non-interactive backend creation (specific runtime):
    • Run firebase apphosting:backends:create --backend --primary-region --runtime nodejs22 --non-interactive and
      verify the backend is created with the nodejs22 runtime.
  5. Unit Tests:
    • The new unit tests in src/apphosting/backend.spec.ts verify that the createBackend function correctly passes the chosen
      runtime to the App Hosting API.

Sample Commands

Create a backend with a specific runtime:

firebase apphosting:backends:create --runtime nodejs22

Create a backend non-interactively (defaults to nodejs runtime):

firebase apphosting:backends:create --backend my-backend --primary-region us-central1 --non-interactive

Create a backend non-interactively with a specific runtime:

firebase apphosting:backends:create --backend my-backend --primary-region us-central1 --runtime nodejs22 --non-interactive

Prompt for runtime selection in interactive mode:

firebase apphosting:backends:create
# Expected Prompt:
# ? Which runtime do you want to use? (Use arrow keys)
# ❯ Node.js (default)
#   Node.js 22

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):

firebase apphosting:backends:create --backend my-backend --primary-region us-central1 --runtime "" --non-interactive
# Expected Result: Backend created with 'nodejs' runtime.

Create a backend with an unsupported runtime (expected to fail):

firebase apphosting:backends:create --runtime nodejs18
# Expected Error:
# Error: HTTP Error: 400, InvalidArgument: runtime "nodejs18" is not supported

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 apphosting:backends:create command by enabling users to explicitly define the runtime environment for their new App Hosting backends. It provides flexibility through a new command-line flag and an interactive selection process, while also ensuring a sensible default for non-interactive operations. The changes integrate this new capability into the backend creation logic and include corresponding unit tests.

Highlights

  • New CLI Option: Introduced a new --runtime option for the firebase apphosting:backends:create command, allowing users to specify the desired runtime (e.g., nodejs, nodejs22) when creating a backend.
  • Interactive Runtime Selection: When creating a backend interactively and no runtime is specified, the CLI will now prompt the user to select between available runtimes, such as 'Node.js (default)' and 'Node.js 22'.
  • Non-Interactive Default Runtime: For non-interactive backend creation, if the --runtime flag is not provided, the system will automatically default to the nodejs runtime.
  • Backend API Integration: The createBackend function and related API interfaces have been updated to accept and process the specified runtime, ensuring it is correctly passed to the App Hosting API.
  • Unit Test Coverage: New unit tests have been added to verify that the createBackend function correctly handles and passes both nodejs and nodejs22 runtimes to the underlying API.

🧠 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 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 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.

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