Skip to content

refactor: resolve function regions during build phase to fix VPC connectors#10471

Open
wandamora wants to merge 5 commits intomainfrom
ajp-speculative-tbd-fix-yolo
Open

refactor: resolve function regions during build phase to fix VPC connectors#10471
wandamora wants to merge 5 commits intomainfrom
ajp-speculative-tbd-fix-yolo

Conversation

@wandamora
Copy link
Copy Markdown
Contributor

@wandamora wandamora commented May 7, 2026

This moves the resolution logic to be before we resolve the build to a backend to set the defaults in functions, and the correct region can be known when building the VPC connector identfier.

Scenarios Tested

Create function with VPC connector
firebase deploy --only functions on 15.16.0
Update function and use local firebase-tools build
firebase deploy --only functions
Update was successful.

Copy link
Copy Markdown
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 refactors the region resolution logic for Cloud Functions, shifting the resolution process from the Backend representation to the Build representation. This allows for correct VPC connector string construction earlier in the deployment process. The new resolveDefaultRegionsForBuild function integrates existing region matching and trigger-based resolution. Review feedback identifies a violation of the style guide regarding the use of the any type and suggests including the endpoint ID in resolver calls to avoid potential issues. Additionally, a suggestion was made to use falsy checks for array length in accordance with project conventions.

Comment thread src/deploy/functions/prepare.ts
Comment thread src/deploy/functions/prepare.ts Outdated
@wandamora wandamora changed the title Ajp speculative tbd fix yolo refactor: resolve function regions during build phase to fix VPC connectors May 7, 2026
@wandamora wandamora marked this pull request as ready for review May 7, 2026 22:48
Copy link
Copy Markdown
Contributor

@shettyvarun268 shettyvarun268 left a comment

Choose a reason for hiding this comment

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

LGTM

@shettyvarun268
Copy link
Copy Markdown
Contributor

Might want to rebase this PR to take in Joe's changes for the test cases failing.

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.

4 participants