Default function regions are decided much later in prepare#10293
Open
Default function regions are decided much later in prepare#10293
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements deferred region resolution for Cloud Functions by introducing a REGION_TBD placeholder, which is later resolved by matching against existing functions or defaulting to us-central1. A review comment suggests reordering the preparation logic to call resolveDefaultRegions before inferDetailsFromExisting, ensuring that existing function metadata is correctly merged.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Berlioz
approved these changes
Apr 8, 2026
src/deploy/functions/prepare.ts
Outdated
|
|
||
| /** | ||
| * Verifies that we don't have a peculiar edge case where we cannot know what region a default endpoint was in. | ||
| * This is only possible in insaine edge cases (esp since you can only have multi-region functions for HTTPS and |
src/deploy/functions/prepare.ts
Outdated
| * Verifies that we don't have a peculiar edge case where we cannot know what region a default endpoint was in. | ||
| * This is only possible in insaine edge cases (esp since you can only have multi-region functions for HTTPS and | ||
| * regional AI Logic functions) where a customer HAD specified multiple regions in a function and then deleted | ||
| * the regions annotation entirely and we don't know which to delete an which to keep. |
joehan
approved these changes
Apr 9, 2026
| @@ -1,4 +1,5 @@ | |||
| - Fixed an issue where functions deployments would silently fail (#6989) | |||
| - Add foundation for being smarter about where to place functions when the region is not specified (#10293) | |||
Member
There was a problem hiding this comment.
Is this a user facing change? A bit hard to tell from the code without diving into the broader codebase
Member
Author
There was a problem hiding this comment.
It will eventually but isn't yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This doesn't yet actually change the default from us-central1, but gives us a nice place to make all those changes.
us-central1 is GCP's oldest region and is oversubscribed. People use it because it's the default but it ends up having slower cold-starts and might even see more service disruptions. This is a place where we can examine new functions and decide whether there's a better place to put them. E.g.:
Nothing in here is intended to prevent a customer from deploying in us-central1 if they know they want to. This just helps us modify defaults for customers who have shown no preference.