Skip to content

fix(bigquery-firestore-export): restore install-time param validation - #2982

Draft
IzaakGough wants to merge 2 commits into
kitsfrom
fix/bfe-param-validation
Draft

fix(bigquery-firestore-export): restore install-time param validation#2982
IzaakGough wants to merge 2 commits into
kitsfrom
fix/bfe-param-validation

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Aug 26, 2026

Copy link
Copy Markdown

What was broken

Two params lost their validation in the port to the kit. COLLECTION_PATH became a plain string, so an even-segment path such as a/b is accepted at deploy and then fails inside Firestore at runtime. BIGQUERY_DATASET_LOCATION became free-form, so a typo means the query job location does not match the dataset and the scheduled query fails.

What changed

COLLECTION_PATH carries the upstream regex ^[^/]+(/[^/]+/[^/]+)*$ and its error message. BIGQUERY_DATASET_LOCATION is a select over the same 35 options as upstream (33 regions plus the US and EU multi-regions), following the existing LOG_LEVEL pattern. Resolved config is unchanged for valid input. params is now exported so tests can assert the declared inputs.

Verification

Tests and build run in a worktree holding only this commit on top of kits: 36 tests pass, tsc -b exits 0. The regex is exercised against a, a/b/c, a/b/c/d/e, a/b, a/b/c/d, /a, a/ and the empty string.

Notes

Validation only fires on the interactive prompt. Driving firebase-tools 15.28.1's own resolveParams, a value supplied from a .env file is taken verbatim, with no regex check and no select-membership check, while the prompt path retries with the error message. So this catches typos during an interactive deploy, not in CI.

The extension behaves the same way, so this is not a gap the kit opened. validateCommandLineParams still exists in firebase-tools but has had no caller in the product path since e16fe0a80 (March 2023), and the extensions deploy planner reads .env params without validating them. That was checked in the CLI only; whether the backend rejects a bad value at instance-create time is untested.

One deviation from upstream: the label EU Mutli-Region (EU) is spelled EU Multi-Region (EU) here.

COLLECTION_PATH regains the upstream collection path regex, and
BIGQUERY_DATASET_LOCATION becomes a select over the upstream list of
regions and multi-regions. Both were free-form strings after the port, so
a bad value was accepted at deploy and only failed at runtime.

@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 introduces validation and predefined options for configuration parameters in the BigQuery Firestore Export kit. Specifically, it adds a comprehensive list of supported BigQuery dataset locations to restrict the BIGQUERY_DATASET_LOCATION parameter and a regular expression to validate that the COLLECTION_PATH parameter is a valid Firestore collection path. It also exports the params object and adds comprehensive unit tests to verify the validation logic and parameter options. There are no review comments, so no further feedback is provided.

Both sides restored the COLLECTION_PATH validator. Keep the inline RegExp
literal used by every other kit, plus the example added here.
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.

2 participants