feat: inject FIREBASE_KIT_INSTANCE_ID environment variable for function kits - #10906
Open
ajperel wants to merge 1 commit into
Open
feat: inject FIREBASE_KIT_INSTANCE_ID environment variable for function kits#10906ajperel wants to merge 1 commit into
ajperel wants to merge 1 commit into
Conversation
…on kits ### Description This change ensures that when deploying or emulating functions that belong to a Kit codebase, an environment variable `FIREBASE_KIT_INSTANCE_ID` is automatically injected into the process containing exactly the kit instance string identifier. This mirrors how variables like `FIREBASE_CONFIG` and `GCLOUD_PROJECT` are orchestrated through `loadFirebaseEnvs()` and prevents the developer from manually mapping these contexts. The variable remains omitted if the user is deploying a standard codebase. ### Scenarios Tested - Deployed multiple kits which contain functions that log and return their instance ids showing correct behavior. - Deployed a non-kit codebase with the kits experiment on and off - Run all tests ### Sample Commands - `npm run test` - `firebase deploy --only functions`
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for passing the FIREBASE_KIT_INSTANCE_ID environment variable to Firebase Functions kit instances during deployment preparation and emulator startup. It updates loadFirebaseEnvs to accept an optional kitInstanceId and includes corresponding unit tests to verify the behavior. I have no additional feedback to provide as the changes are well-implemented and covered by tests.
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.
Description
This change ensures that when deploying or emulating functions that belong to a Kit codebase, an environment variable
FIREBASE_KIT_INSTANCE_IDis automatically injected into the process containing exactly the kit instance string identifier.This mirrors how variables like
FIREBASE_CONFIGandGCLOUD_PROJECTare orchestrated throughloadFirebaseEnvs()and prevents the developer from manually mapping these contexts. The variable remains omitted if the user is deploying a standard codebase.Scenarios Tested
Sample Commands
npm run testfirebase deploy --only functions