Skip to content

fix(firestore-bigquery-export): normalize DATABASE_REGION before the region lookup - #3153

Open
cabljac wants to merge 1 commit into
kitsfrom
fix/kits-fbe-region-case
Open

fix(firestore-bigquery-export): normalize DATABASE_REGION before the region lookup#3153
cabljac wants to merge 1 commit into
kitsfrom
fix/kits-fbe-region-case

Conversation

@cabljac

@cabljac cabljac commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The multi-region lookup in region.ts was case-sensitive, so a hand-edited .env carrying NAM5 passed 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.ts was 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.

…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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 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.

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.

1 participant