refactor: resolve function regions during build phase to fix VPC connectors#10471
refactor: resolve function regions during build phase to fix VPC connectors#10471
Conversation
There was a problem hiding this comment.
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.
|
Might want to rebase this PR to take in Joe's changes for the test cases failing. |
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.0Update function and use local firebase-tools build
firebase deploy --only functionsUpdate was successful.