fix(firestore-bigquery-export): place functions from DATABASE_REGION with a multi-region mapping - #3101
Merged
Conversation
…with a multi-region mapping Restore the DATABASE_REGION param and use it to place all three functions, mapping Firestore multi-region locations to Cloud Run regions (nam5/nam7 -> us-central1, eur3 -> europe-west1) so multi-region databases no longer fail the deploy. Regional locations pass through unchanged; with the param unset the functions declare no region and the CLI fallback behavior is kept. Partially reverts #3066. The CLI's own region inference is unreliable for param-declared databases (firebase/firebase-tools#11020), and the extension-to-kit migration exports DATABASE_REGION into the user's .env, so the value is present for migrating users.
This was referenced Sep 2, 2026
Merged
Closed
Contributor
There was a problem hiding this comment.
Code Review
This pull request restores explicit function placement based on the DATABASE_REGION parameter, mapping Firestore multi-region locations to valid Cloud Run regions (such as mapping nam5 to us-central1) to prevent deployment failures. The feedback suggests adding an 'Unset' option with a default empty string to the DATABASE_REGION configuration to allow users to bypass interactive CLI prompts, trimming the input region string to handle accidental whitespaces, and clearing mock history between test runs to prevent fragile indexing in assertions.
…ve triggers; add asia-southeast3
cabljac
added a commit
that referenced
this pull request
Sep 8, 2026
…for function placement (#3102) Fixes #3069. The kit passed the raw DATABASE_REGION value as the function's region, and the param's select offers the Firestore multi-regions eur3/nam5/nam7, which are not Cloud Run regions, so multi-region deploys hard-failed. The issue proposed dropping the region option (the #3066 pattern). This PR deliberately deviates: by agreement with the firebase-tools team, DATABASE_REGION stays and is mapped instead, because the CLI's own inference is unreliable for param-declared databases (firebase/firebase-tools#11020) and the extension-to-kit migration exports DATABASE_REGION into the user's .env. Multi-regions map to a region inside them (nam5/nam7 to us-central1, eur3 to europe-west1, mirroring the CLI's FIRESTORE_DUAL_REGION_TO_REGION_MAPPING); regional locations pass through; unset or empty means no region option and the CLI fallback. #3101 is the sibling fix for firestore-bigquery-export. Tests pin all mapping cases plus the unset case; breaking the mapping fails them. Caveats: no live multi-region deploy was run for this kit, and the module-load process.env read needs firebase-tools >= 15.28.0 during discovery (older CLIs degrade to the no-region fallback). The approved #3089 also touches src/config.ts; this change edits only envDeployOptions at the end of the file, so overlap is limited to a trivial CHANGELOG conflict.
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 partially reverts #3066, by agreement with the firebase-tools team. #3066 removed the DATABASE_REGION param because its raw value was used as the function region, which hard-failed deploys for multi-region databases (#3017). But the CLI's region inference the kit fell back to is unreliable for param-declared databases: region resolution runs before param substitution and silently defaults to us-central1 (firebase/firebase-tools#11020). Since the extension-to-kit migration exports DATABASE_REGION into the user's .env, the decision is to keep using it, with the mapping that makes it safe where the pre-#3066 code failed.
The restored param now places all three functions: Firestore multi-region locations map to a Cloud Run region (nam5/nam7 to us-central1, eur3 to europe-west1, mirroring the CLI's own FIRESTORE_DUAL_REGION_TO_REGION_MAPPING); regional locations pass through; unset keeps today's no-region behavior. The region is read from process.env at module load, which requires firebase-tools >= 15.28.0 (firebase/firebase-tools#10936) to be present during discovery; on older CLIs it degrades to the no-region fallback rather than failing. Tests pin all mapping cases and the unset case, and breaking the mapping fails them. No live multi-region deploy was run this time; #3066's no-region behavior was live-verified on nam5.