Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates configuration parameters across multiple Firebase Extension kits to enforce required fields and input validation rules (such as nonEmpty: true and validationRegex) that match their extension.yaml definitions, preventing the CLI from accepting empty values. It also introduces corresponding unit tests to verify these constraints. The review feedback recommends tightening the validation regex for AUTO_DISCOVERY_SEARCH_DEPTH in the delete-user-data kit to restrict input to positive integers instead of any non-empty string, and updating the test assertions to match.
The kits dropped `required: true` and several `validationRegex` values from the predecessor extensions, so `firebase deploy` accepted an empty answer for 21 params the extension installer refuses, and skipped validation the extension applied. Add `nonEmpty` to the 21 params their extension marks required, and restore the five dropped regexes with their error messages. Fixes #3192
CorieW
force-pushed
the
invertase/kits-param-validation-parity
branch
from
September 15, 2026 15:28
0afea6f to
2dcbb64
Compare
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.
Restores the param validation the kits dropped from their predecessor extensions. Reported in #3192, which is correct and wider than the example given:
firebase deployaccepted an empty answer for 21 params their extension marksrequired: true, and skipped five regexes the extension applied.Changes
input.text.nonEmptyto the 21 params their extension marksrequired: true(fix(kits): reject required params set to an empty value in .env #3193 has since landed two of them,BACKUP_INSTANCE_IDandSELECTED_DATABASE_INSTANCE; rebased onto it), acrossdelete-user-data,firestore-bigquery-export,firestore-bundle-builder,firestore-genai-chatbot,firestore-incremental-capture,firestore-send-email,firestore-translate-text,firestore-vector-search,rtdb-limit-child-nodesandspeech-to-text.validationRegexvalues with theirvalidationErrorMessage:firestore-bundle-builder/BUNDLE_STORAGE_BUCKET,firestore-genai-chatbot/MODEL, andfirestore-incremental-capture/SYNC_COLLECTION_PATH,SYNC_DATASET,BACKUP_INSTANCE_ID.delete-user-data/AUTO_DISCOVERY_SEARCH_DEPTHusesvalidationRegex: /.+/instead:nonEmptyis typed for string params only, and an empty answer resolved to0rather than the declared default of3.nonEmptyand regexes, plus a newconfig.test.tsforfirestore-bundle-builderandconfig-runtime.test.tsforfirestore-bigquery-export, whoseconfig.test.tsfakes the params module and cannot see declaration options.Not changed
(?:…|)widening on 14 optional params is correct parity and stays:askUserForParamonly applies a regex to non-empty input when the param is optional (src/extensions/askUserForParam.ts:57in firebase-tools).speech-to-text/EXTENSION_BUCKETandstorage-resize-images/IMG_BUCKET, the other two regexes 🐛 [All Kits] Kit Params are not specifying when they require a non-empty value. #3192 counts, useBUCKET_PICKER. AResourceInputcarries no text validation, and the picker only offers buckets that exist in the project, so it is at least as strict as the regex.Caveat
firebase deployvalidates only at the interactive prompt:resolveParamspartitions out any param already present in.envand never validates it (src/deploy/functions/params.ts:167). The Extensions backend validated at instance create regardless of source, so a migrated.envstill bypasses these declarations. Re-validate stored values when migrating an instance. #3193's module-scopeassertRequiredParamsguard catches the blank-in-.envcase at discovery; this PR covers the prompt.Verification
npm ci && npm run build && npm testin each of the 10 kits: all green.