fix(firestore-bigquery-export): normalize DATABASE_REGION before the region lookup - #3153
Open
cabljac wants to merge 1 commit into
Open
fix(firestore-bigquery-export): normalize DATABASE_REGION before the region lookup#3153cabljac wants to merge 1 commit into
cabljac wants to merge 1 commit into
Conversation
…region lookup Lowercase and trim the value so a hand-edited `.env` carrying `NAM5` maps to `us-central1` instead of passing through and failing the deploy. Keeps the kit in step with firestore-send-email's region mapping.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the firestoreLocationToFunctionRegion utility to normalize the location parameter by trimming surrounding whitespace and converting it to lowercase before performing region lookups. This ensures case-insensitive matching and prevents deployment failures due to hand-edited configuration files containing whitespace or mixed-case region names. Additionally, corresponding unit tests have been added to verify these normalization behaviors, and the changelog has been updated. I have no feedback to provide as the changes are well-implemented and thoroughly tested.
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.
The multi-region lookup in
region.tswas case-sensitive, so a hand-edited.envcarryingNAM5passed through untouched and reproduced the deploy failure the mapping exists to prevent. The value is now trimmed and lowercased before the lookup, regional values come out lowercased too, and a whitespace-only value counts as unset.This is the same change #3102 made to firestore-send-email, whose
region.tswas copied from this kit. Both kits now behave identically.Tests cover
NAM5,Eur3,nam7, a mixed-case regional value, and a whitespace-only value. Unit suite passes locally (105 tests). No live deploy run.