Repository navigation
Fix kit source and prefix validation when sharing source directory - #11253
Merged
shettyvarun268 merged 4 commits intoOct 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request resolves an issue where a Function Kit and a functions codebase sharing the same source directory failed firebase.json validation. It updates the validation logic in assertUniqueSourcePrefixPair to correctly extract and check prefixes for kit instances, and adds comprehensive unit tests. The review feedback points out that the error message in assertUniqueSourcePrefixPair should be updated to provide accurate remediation guidance, since specifying a prefix is forbidden in a Function Kit configuration.
shettyvarun268
force-pushed
the
shettyvarun268/fix-kit-source-prefix-validation
branch
3 times, most recently
from
October 9, 2026 18:27
f714300 to
5bd2662
Compare
shettyvarun268
marked this pull request as ready for review
October 9, 2026 18:45
ajperel
reviewed
Oct 9, 2026
shettyvarun268
force-pushed
the
shettyvarun268/fix-kit-source-prefix-validation
branch
from
October 9, 2026 21:23
5bd2662 to
b237b01
Compare
ajperel
approved these changes
Oct 9, 2026
…t-source-prefix-validation # Conflicts: # CHANGELOG.md
shettyvarun268
deleted the
shettyvarun268/fix-kit-source-prefix-validation
branch
October 12, 2026 17:14
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
Fixes an issue where installing a local Function Kit into a directory that is already configured as a functions codebase in
firebase.json(for example,firebase functions:kits:install --directory functions) causes subsequentfirebasecommands to fail validation with:In
assertUniqueSourcePrefixPair(src/functions/projectConfig.ts), kit configs (isKitConfig(c)) previously defaulted toc.prefix || ""("") even though kit configurations do not allow a top-levelprefixfield and instead automatically prefix each instance withaddKitPrefix(instanceId)(kit-<instanceId>) during config expansion.This change:
assertUniqueSourcePrefixPairto resolve kit prefixes per instance viaaddKitPrefix(instanceId)(kit-<instanceId>).assertUniqueKitInstancesAndCodebasesbeforeassertUniqueSourcePrefixPairinvalidate()so duplicate kit instance IDs across kits sharing a source directory continue to report the duplicate-instance error first.Scenarios Tested
src/functions/projectConfig.spec.ts:{ source: "functions", codebase: "default" }) and a kit config sharingsource: "functions"pass validation.sourcedirectory pass validation.prefixthat matches a kit instance's resolved prefix (kit-<instanceId>) on the samesourcedirectory fails validation.Sample Commands