Skip to content

Conversation

@taeold
Copy link
Contributor

@taeold taeold commented Oct 23, 2025

Fixes #9368.

Partially rolls back #9335

Secrets should be handled in handleSecret function. The check for missing secret was incorrectly being done too early.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @taeold, 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 addresses a bug in the Firebase CLI's secret handling during non-interactive deployments. Previously, the system would incorrectly assume a secret was missing and fail early, without first checking if the secret was already provisioned in Google Cloud Secret Manager. The change refactors the validation logic to ensure that the existence of a secret is verified against the cloud before any failure is triggered in non-interactive scenarios, providing a more robust and accurate deployment experience.

Highlights

  • Bug Fix: Resolves an issue where the CLI would prematurely fail when deploying functions with secrets in non-interactive mode, even if the secret existed in Google Cloud Secret Manager.
  • Logic Refactoring: The check for missing secrets in non-interactive deployments has been moved from the resolveParams function into the handleSecret function. This ensures the check occurs only after attempting to retrieve the secret's metadata from the cloud.
  • Test Coverage: New test cases have been added to params.spec.ts to verify the correct behavior of secret handling in non-interactive mode, specifically for cases where secrets exist or are missing in the cloud.
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.

@taeold taeold changed the title fix: check SCM for secrets in non-interactive mode before failing fix: revert logic to abort function deploys in non-interactive mode when secrets are missing Oct 23, 2025
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 correctly fixes an issue where deployments would fail in non-interactive mode for missing secrets without first checking Secret Manager. The logic is moved to handleSecret to perform the check after querying the API, which is the right approach. The changes are sound and include new tests.

I've added a suggestion to further improve the user experience in non-interactive mode by restoring the previous behavior of listing all missing secrets at once, rather than failing on the first one. This makes it easier for users to fix all missing secrets in one go.

@taeold taeold enabled auto-merge (squash) October 23, 2025 21:57
@Enrico2
Copy link

Enrico2 commented Oct 23, 2025

I've wasted about 5 hours today on this until I realized by CI is getting the latest firebase-tools version and that the problem is not with our secrets.

Thanks.

@taeold taeold merged commit 13d995c into master Oct 23, 2025
48 checks passed
@taeold taeold deleted the fix-non-interactive-secrets branch October 23, 2025 22:03
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 23, 2025
@taeold
Copy link
Contributor Author

taeold commented Oct 23, 2025

@Enrico2 sorry for the troubles. we'll do better.

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.

Deployment fails to find secrets in v14.21.0 in non-interactive mode

3 participants