fix(firestore-vector-search): bind provider secrets to task functions - #2987
Open
CorieW wants to merge 2 commits into
Open
fix(firestore-vector-search): bind provider secrets to task functions#2987CorieW wants to merge 2 commits into
CorieW wants to merge 2 commits into
Conversation
GEMINI_API_KEY / OPENAI_API_KEY were bound to the Firestore and callable functions but not to updateTask, backfillTask, updateTrigger, or backfillTrigger -- all of which reach getSingleEmbedding, so a gemini or openai backfill read an undefined key. Tracked in #2974. The secrets now ride on DEFAULT_TASK_OPTIONS and EMBEDDING_TASK_OPTIONS; initVectorSearch's explicit spread becomes redundant and is simplified.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the task options in the Firestore Vector Search kit to include the required API secrets directly in the default and embedding task options, simplifying the task dispatch configurations. A review comment suggests refining the newly added comment to clarify that the secrets are needed for configuration resolution during initialization, preventing potential confusion for future maintainers.
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.
Summary
GEMINI_API_KEY/OPENAI_API_KEYtoupdateTask,backfillTask,updateTrigger, andbackfillTrigger— tracked in Kits parity issues #2974 (ranked [FR] only storing resized image #4): these all reachgetSingleEmbedding, so a gemini/openai backfill previously read an undefined key.DEFAULT_TASK_OPTIONS/EMBEDDING_TASK_OPTIONS, matching the existing Firestore/callable bindings.initVectorSearch's explicitsecretsspread becomes redundant and is simplified toDEFAULT_TASK_OPTIONS.Testing
tsc --noEmitclean; all 49 tests pass.secretEnvironmentVariableson the task functions) is covered by the consumer-project repack/deploy pass.npm packed, re-vendored; discovery endpoint specs show both secrets on all 8 endpoints, including the four previously-unbound task/trigger functions.a91f6c2e,euclid,openai) — successful updates, secret versions validated, lifecycleinitVectorSearchtasks queued, 0 failures.firebase functions:list: 24/24 vector-search functions across the three instances carry bothGEMINI_API_KEYandOPENAI_API_KEY, pinned to real Secret Manager versions.