Skip to content

Firebase Functions can handle an Extensions outage#9986

Open
inlined wants to merge 4 commits intomainfrom
inlined.ext-opt
Open

Firebase Functions can handle an Extensions outage#9986
inlined wants to merge 4 commits intomainfrom
inlined.ext-opt

Conversation

@inlined
Copy link
Member

@inlined inlined commented Feb 27, 2026

To address existing outage

@inlined inlined requested review from pavelgj and taeold February 27, 2026 01:07
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 robustness of Firebase Functions deployments by introducing a mechanism to handle outages in the Firebase Extensions service. By catching errors during the initial checks for extensions, the deployment process can continue without being blocked, ensuring that functions can still be deployed even if the Extensions service is temporarily unavailable. This improves the overall reliability and user experience during such events.

Highlights

  • Outage Resilience: Implemented error handling for Firebase Extensions API calls during function deployment, allowing the process to gracefully skip extensions if there's an outage.
  • Error Logging: Added a new import for logLabeledError to provide clear console output when an Extensions outage is detected.

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

Changelog
  • src/deploy/extensions/prepare.ts
    • Imported logLabeledError utility.
    • Wrapped calls to ensureExtensionsApiEnabled, requirePermissions, and planner.haveDynamic in a try-catch block.
    • Added error logging with logLabeledError to inform users about Firebase Extensions outages.
    • Modified the prepareDynamicExtensions function to return early if an Extensions outage is detected, preventing deployment failures.
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 aims to make Firebase Functions deployments more resilient to Firebase Extensions outages by catching errors during the extension preparation phase. While this is a good improvement, the current implementation catches all errors and reports them as an outage, which can be misleading for users when the actual issue is something else, like a permissions or billing problem. My review includes a suggestion to refine the error handling to only suppress errors indicative of a service outage (i.e., server-side errors) and let other errors fail the deployment as they should.

Comment on lines 184 to 189
} catch (err) {
logLabeledError("extensions",
"Firebase Extensions is having an outage. Skipping extensions from functions codebase.",
);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This catch block is too broad. It will catch any error, including permission errors (403) or billing errors (400), and incorrectly report them as an "outage". This can be misleading for users.

To make the error handling more robust, we should only suppress server-side errors (HTTP status >= 500) that are indicative of an actual outage. Other client-side errors should be re-thrown so the user is properly notified and can address the underlying issue.

  } catch (err: unknown) {
    if (err instanceof FirebaseError && err.status >= 500) {
      logLabeledError(
        "extensions",
        "Firebase Extensions is having an outage. Skipping extensions from functions codebase.",
      );
      return;
    }
    throw err;
  }

extensionMatchesAnyFilter(e.labels?.codebase, e.instanceId, filters),
);
} catch (err) {
logLabeledError("extensions",
Copy link
Collaborator

Choose a reason for hiding this comment

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

the catch block feels a bit too broad to confidently assume that "Extensions is having an outage"... I can imagine permission errors perhaps...
also, wondering if it the option to "skip extentions" should be provided to the user

Copy link
Collaborator

Choose a reason for hiding this comment

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

lol... gemini-code-assist said the exact same thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're absolutely right, pavelgj, I had the same thought! The current catch block is indeed quite broad and assumes a service outage for any error encountered during the retrieval of Firebase Extensions instances. This can be misleading and make debugging difficult, especially if the issue is, as you mentioned, a permission error or another API-related problem.

To improve this, I suggest making the error message more informative by including the actual error details. While a more sophisticated solution might involve checking for specific error types (e.g., FirebaseError with specific codes for permission issues) and providing tailored messages or user prompts, a good first step is to at least log the underlying error.

Regarding your point about providing the user with an option to "skip extensions," that's an excellent suggestion for improving the user experience. It would allow users to proceed with their deployment even if there are non-critical issues with extensions, giving them more control.

Suggested change
logLabeledError("extensions",
} catch (err: any) {
logLabeledError(
"extensions",
`Failed to retrieve Firebase Extensions information. This might be due to a temporary outage, permission issues, or other API problems. Details: ${err}. Skipping extensions from functions codebase.`,
);
return;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

We can massage the text but >=500 is not correct. The current outage causes a 403

@inlined inlined enabled auto-merge (squash) February 27, 2026 01:28
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