fix(firestore-bigquery-export): take the extension's yes/no values for snapshot syntax and old data - #3145
Merged
cabljac merged 1 commit intoSep 8, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request reverts the configuration parameters USE_NEW_SNAPSHOT_QUERY_SYNTAX and EXCLUDE_OLD_DATA to accept the extension's original yes/no string values instead of booleans, ensuring compatibility with existing configurations. The feedback suggests trimming whitespace in the yesNo helper function to prevent potential issues with leading or trailing spaces in environment variables.
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
from
September 8, 2026 10:25
3a31b84 to
48d163e
Compare
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
from
September 8, 2026 10:41
48d163e to
730f3cd
Compare
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
from
September 8, 2026 10:50
730f3cd to
41776c2
Compare
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
from
September 8, 2026 10:52
41776c2 to
18d0516
Compare
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
2 times, most recently
from
September 8, 2026 11:06
8d4a397 to
b156314
Compare
IzaakGough
approved these changes
Sep 8, 2026
IzaakGough
left a comment
Contributor
There was a problem hiding this comment.
Change itself looks right: the extension declares both params as yes / no selects and compares === "yes" at runtime, and WILDCARD_IDS correctly stays true / false. Two low-severity notes inline, neither blocking.
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
from
September 8, 2026 11:17
b156314 to
def03e7
Compare
…r snapshot syntax and old data
cabljac
force-pushed
the
feat/kits-fbe-yes-no-params
branch
from
September 8, 2026 11:20
def03e7 to
1b40aa1
Compare
CorieW
added a commit
that referenced
this pull request
Sep 8, 2026
firestore-bigquery-export: #3145 landed the same fix for `USE_NEW_SNAPSHOT_QUERY_SYNTAX` and `EXCLUDE_OLD_DATA`, and recorded the decision that `WILDCARD_IDS` stays `defineBoolean` because the extension's select there is `true` / `false`, which `BooleanParam` already parses (`!!process.env[name] && process.env[name] === "true"`). Resolved by taking `kits` for the whole kit, so this branch no longer changes firestore-bigquery-export at all: `src/config.ts` and `README.md` are the `kits` versions, and `tests/config-runtime.test.ts` is dropped since `tests/config.test.ts` on `kits` already covers the two yes/no params. storage-resize-images/tests/config.test.ts: kept both sides, the content-filter type imports from #3064 and this branch's `declaration()` helper. Fusion-Task-Id: WORK-004 Co-authored-by: Fusion <noreply@runfusion.ai>
CorieW
added a commit
that referenced
this pull request
Sep 8, 2026
The previous commit converted all ten extension selects to defineString with manual === "true" coercion. Only the three yes/no params need that: BooleanParam.runtimeValue() is `env === "true"`, so for the seven params whose extension values are already true/false the conversion changed no runtime value, and the declared default drives only the deploy-time prompt (an unset variable still reads false, matching the predecessor). select<T> is generic, so a BooleanParam carries the extension's option labels directly. Reverts OAUTH_SECURE, DO_BACKFILL, UPDATE_ON_CONFIGURE, ENABLE_AUTOMATIC_PUNCTUATION, MAKE_PUBLIC, IS_ANIMATED and REGENERATE_TOKEN to defineBoolean with select<boolean>, restoring the labels without giving up the typed param or hand-writing coercion. ENABLE_AUTO_DISCOVERY, ENABLE_DISCUSSION_OPTION_OVERRIDES and ENABLE_GENKIT_MONITORING stay defineString, matching #3145's scope. Tests now pin type: "boolean" with boolean-valued options; the runtime and unset-variable assertions are unchanged. Adds the per-kit CHANGELOG entries the branch was missing. Fusion-Task-Id: WORK-004 Co-authored-by: Fusion <noreply@runfusion.ai>
CorieW
added a commit
that referenced
this pull request
Sep 8, 2026
firestore-bigquery-export: #3145 landed the same fix for `USE_NEW_SNAPSHOT_QUERY_SYNTAX` and `EXCLUDE_OLD_DATA`, and recorded the decision that `WILDCARD_IDS` stays `defineBoolean` because the extension's select there is `true` / `false`, which `BooleanParam` already parses (`!!process.env[name] && process.env[name] === "true"`). Resolved by taking `kits` for the whole kit, so this branch no longer changes firestore-bigquery-export at all: `src/config.ts` and `README.md` are the `kits` versions, and `tests/config-runtime.test.ts` is dropped since `tests/config.test.ts` on `kits` already covers the two yes/no params. storage-resize-images/tests/config.test.ts: kept both sides, the content-filter type imports from #3064 and this branch's `declaration()` helper.
CorieW
added a commit
that referenced
this pull request
Sep 8, 2026
The previous commit converted all ten extension selects to defineString with manual === "true" coercion. Only the three yes/no params need that: BooleanParam.runtimeValue() is `env === "true"`, so for the seven params whose extension values are already true/false the conversion changed no runtime value, and the declared default drives only the deploy-time prompt (an unset variable still reads false, matching the predecessor). select<T> is generic, so a BooleanParam carries the extension's option labels directly. Reverts OAUTH_SECURE, DO_BACKFILL, UPDATE_ON_CONFIGURE, ENABLE_AUTOMATIC_PUNCTUATION, MAKE_PUBLIC, IS_ANIMATED and REGENERATE_TOKEN to defineBoolean with select<boolean>, restoring the labels without giving up the typed param or hand-writing coercion. ENABLE_AUTO_DISCOVERY, ENABLE_DISCUSSION_OPTION_OVERRIDES and ENABLE_GENKIT_MONITORING stay defineString, matching #3145's scope. Tests now pin type: "boolean" with boolean-valued options; the runtime and unset-variable assertions are unchanged. Adds the per-kit CHANGELOG entries the branch was missing.
CorieW
added a commit
that referenced
this pull request
Sep 8, 2026
…3148) ## Summary The kits migration turned every extension yes/no select into `defineBoolean`. `BooleanParam` only parses the literal `true` ([`src/params/types.ts:717`](https://github.com/firebase/firebase-functions/blob/master/src/params/types.ts)), so an `.env` copied from an extension that stored `yes` / `no` silently reads as off. The `true` / `false` selects parsed fine but lost their option labels. Rule applied per param: - Extension stored `yes` / `no`: `defineString` + `select({ Yes: "yes", No: "no" })`, coerced in `configFromEnv()` with the extension's `=== "yes"`. Stored values unchanged; kit config types stay boolean. - Extension stored `true` / `false` and the default is the first option: keep `defineBoolean`, restore labels with `select<boolean>({ Yes: true, No: false })`. Label-only, no runtime change. - `MAKE_PUBLIC` (stored `true` / `false`, default `false` = second option): `defineString` with `default: "false"`, coerced with `=== "true"`. The CLI's `promptSelect` passes `default` raw but stringifies option values ([`params.ts`](https://github.com/firebase/firebase-tools/blob/master/src/deploy/functions/params.ts) `default: resolvedDefault as string` vs `value: option.value.toString()`), so a boolean default matches nothing and "Yes" was preselected, making every resized image public on Enter. Same line as #3145, which kept `WILDCARD_IDS` boolean and converted the yes/no params. `firestore-bigquery-export` is no longer touched here. ## Affected params | Kit | Param | Options (order) | Default | Kit param | Coercion | | --- | --- | --- | --- | --- | --- | | delete-user-data | `ENABLE_AUTO_DISCOVERY` | Yes=`yes`, No=`no` | `no` | `defineString` | `=== "yes"` | | firestore-genai-chatbot | `ENABLE_DISCUSSION_OPTION_OVERRIDES` | Yes=`yes`, No=`no` | `no` | `defineString` | `=== "yes"` | | firestore-genai-chatbot | `ENABLE_GENKIT_MONITORING` | Yes=`yes`, No=`no` | `no` | `defineString` | `=== "yes"` | | firestore-send-email | `OAUTH_SECURE` | Yes=`true`, No=`false` | `true` | `defineBoolean` | `BooleanParam` | | firestore-vector-search | `DO_BACKFILL` | Yes=`true`, No=`false` | none | `defineBoolean` | `BooleanParam` | | firestore-vector-search | `UPDATE_ON_CONFIGURE` | Yes=`true`, No=`false` | none | `defineBoolean` | `BooleanParam` | | speech-to-text | `ENABLE_AUTOMATIC_PUNCTUATION` | Enabled=`true`, Disabled=`false` | `true` | `defineBoolean` | `BooleanParam` | | storage-resize-images | `MAKE_PUBLIC` | Yes=`true`, No=`false` | `false` | `defineString` | `=== "true"` | | storage-resize-images | `IS_ANIMATED` | Yes=`true`, No (1st frame only)=`false` | `true` | `defineBoolean` | `BooleanParam` | | storage-resize-images | `REGENERATE_TOKEN` | Yes=`true`, No=`false` | `true` | `defineBoolean` | `BooleanParam` | ## Changes - Restored `IS_ANIMATED` "Yes" label (kit had "True") and speech-to-text "Enabled" / "Disabled". - Removed README notes telling users to rewrite `yes` to `true` (delete-user-data, firestore-genai-chatbot, firestore-send-email). - Tests in each kit's existing config test file assert param type, default, option labels, values, order, and the parsed boolean for each value and for unset. firestore-send-email uses `tests/config-runtime.test.ts` because its `config.test.ts` fakes `firebase-functions/params`. ## Verification `npx tsc -b` clean and `npx vitest run` green in all six kits (send-email 158, vector-search 124, resize-images 172 + 6 skipped, delete-user-data 102, chatbot 58 + 3 skipped, speech-to-text 37). Prettier clean. ## Follow-up #3145 coerces yes/no with a trimming, lowercasing `yesNo()` helper; the 3 yes/no params here use the extension's bare `=== "yes"`. Aligning them is a behavior change, so it is left for a follow-up. ## Accepted differences and inherited behavior - Kit params with a default are not prompted as required, so the extension's `required: true` on the yes/no params is not reproduced. Platform difference, no value change. - `OAUTH_SECURE` and `ENABLE_AUTOMATIC_PUNCTUATION` advertise default `true`, but an unset variable reads as `false` in both the extension and the kit. Reproduced for parity and pinned by tests. - `UPDATE_ON_CONFIGURE` was declared but unused by the extension runtime; the kit uses it. Pre-existing, out of scope.
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.
USE_NEW_SNAPSHOT_QUERY_SYNTAXandEXCLUDE_OLD_DATAweredefineBooleanparams, so only the literaltrueenabled them and the README told users to rewriteyestotrueafter a migration. The extension defines both asyes/noselects (extension.yaml:575,:589), and the migration exports those values verbatim, so a migrated.envsilently left both off. Agreed direction in extension chat: stay with the closest match to the extension so users enter nothing during migration, and do better for new kits or new params.Both are now
defineStringwith aselect({ Yes: "yes", No: "no" })input and defaultno, mirroring the extension's labels, values, and default, andconfigFromEnvmaps them with ayesNohelper. Onlyyesenables, compared after trimming and lowercasing so the select labelYesand stray whitespace still work;noand anything else,trueincluded, read as off. firebase-tools copies.envvalues verbatim without checking them against the select, which is why the label and whitespace are forgiven;trueis not, since the kit has no users who could have written it and the extension's select never emits it.WILDCARD_IDSstaysdefineBoolean: the extension's select there istrue/false, whichBooleanParamalready parses. The README's "Boolean settings usetrue/false" difference section is removed since the difference is gone.Audit of the rest of the kit's params: no other boolean-shaped extension param exists.
delete-user-datahas the same shape onENABLE_AUTO_DISCOVERYand is not part of this stack.Tests: four new cases in
config.test.tscover the unset value,yes, theYesand whitespace spellings, andno/true. ThedefineStringmock now matches the realStringParam(process.env[name] || "", never the declared default, which only the CLI prompt consults), and the one test that relied on a default now stubs the env var the way the CLI populates it. 100 tests andtscpass at the top of the stack. Not verified against a live migration export.Part of #3031.