Skip to content

Tighten --only filter resolution for functions deployment - #9353

Merged
taeold merged 3 commits into
masterfrom
filter-smart-codebase-resolution
Oct 21, 2025
Merged

taeold merged 3 commits into
masterfrom
filter-smart-codebase-resolution

Conversation

@taeold

@taeold taeold commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor

When using --only functions:SELECTOR during function deploys, resolve ambiguous selectors by checking if SELECTOR matches a known codebase name:

  • If yes: target only that codebase
  • If no: treat as function ID in default codebase

This prevents unnecessary codebase scanning and runtime config fetches for non-targeted codebases.

Example: With codebases 'default' and 'other':
firebase deploy --only functions:other

Before: scans both 'other' codebase AND 'default' for 'other-*' functions
After: scans only 'other' codebase

When using --only functions:SELECTOR, resolve ambiguous selectors by
checking if SELECTOR matches a known codebase name:

- If yes: target only that codebase
- If no: treat as function ID in default codebase

This prevents unnecessary codebase scanning and runtime config fetches
for non-targeted codebases.

Example: With codebases 'default' and 'other':
  firebase deploy --only functions:other

Before: scans both 'other' codebase AND 'default' for 'other-*' functions
After: scans only 'other' codebase
@gemini-code-assist

Copy link
Copy Markdown
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 refines the behavior of the firebase deploy --only functions:SELECTOR command by introducing a more precise mechanism for resolving ambiguous selectors. The system now intelligently determines whether a selector refers to a specific codebase or a function ID within the default codebase, based on the project's validated function configurations. This enhancement significantly improves deployment efficiency by ensuring that only the relevant codebases and functions are processed, thereby reducing overhead and speeding up deployments.

Highlights

  • Improved --only filter resolution: The --only functions:SELECTOR argument now intelligently resolves ambiguous selectors for function deployments.
  • Codebase-aware targeting: If the SELECTOR matches a known codebase name, the deployment will exclusively target that specific codebase, preventing broader scans.
  • Default codebase fallback: If the SELECTOR does not correspond to a known codebase name, it is correctly interpreted as a function ID within the default codebase.
  • Enhanced efficiency: This refinement eliminates unnecessary scanning of non-targeted codebases and avoids redundant runtime configuration fetches, streamlining the deployment process.
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. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 tightens the logic for resolving --only functions:SELECTOR filters, making it more deterministic and efficient. When a selector matches a known codebase name, it now correctly targets only that codebase, avoiding unnecessary scans of others. The changes are well-implemented and include corresponding test updates. I've provided a couple of suggestions: one to improve performance and code clarity by using a Set for codebase name lookups, and another to update some documentation comments that are now outdated due to the new, less ambiguous logic.

Comment thread src/deploy/functions/functionsDeployHelper.ts
@taeold
taeold merged commit 63cd159 into master Oct 21, 2025
48 checks passed
@github-project-automation github-project-automation Bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 21, 2025
@taeold
taeold deleted the filter-smart-codebase-resolution branch October 21, 2025 17:09
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