fix: trust discovered entry points for hyphenated functions#10573
Open
IzaakGough wants to merge 5 commits into
Open
fix: trust discovered entry points for hyphenated functions#10573IzaakGough wants to merge 5 commits into
IzaakGough wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Firebase Functions Shell and Cloud Functions v2 deployment to preserve hyphenated entry points instead of replacing hyphens with dots. It refactors the shell context initialization to use trigger.entryPoint directly and updates FUNCTION_TARGET accordingly, accompanied by new unit tests. The review feedback suggests replacing the any type in the context parameter of initializeFunctionsShellContext with unknown to align with the repository's TypeScript style guidelines.
This was referenced May 28, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.
Related to #8469
Companion SDK PR: #1896
This PR updates
firebase-toolsto trust theentryPointemitted byfirebase-functionsdiscovery instead of re-deriving it from function ids.Problem
The companion
firebase-functionschange fixes discovery for quoted export names containing hyphens, for example:After that SDK fix, the discovered
entryPointis correctly preserved asdummystore-bot.However,
firebase-toolsstill had two places that assumed hyphens should be converted into dot notation:FUNCTION_TARGETby rewritingentryPointwith- -> .functions:shellreconstructed shell bindings fromtrigger.nameinstead of using the discoveredtrigger.entryPointThat behavior is still correct for grouped exports like
grouped.fn, but it is incorrect for flat quoted export names that literally contain hyphens.Change
This PR makes
firebase-toolsuse the SDK-providedentryPointas the source of truth.Gen2 deploy
cloudfunctionsv2now sets:FUNCTION_TARGET = buildConfig.entryPointwithout rewriting hyphens to dots.
Functions shell
functions:shellnow initializes REPL bindings fromtrigger.entryPointrather than deriving a path fromtrigger.name.This preserves both behaviors correctly:
grouped.fndummystore-botTests
This PR adds or updates coverage for:
FUNCTION_TARGETtrigger.entryPointfor both:Relationship To
firebase-functionsThis PR is the CLI-side follow-up to the primary SDK fix in
firebase-functions.On its own, this change improves correctness whenever
entryPointis already accurate. Together with the companionfirebase-functionsPR, it fixes the full quoted-hyphen export flow end to end.Companion PR: #1896
Validation
Validated with:
cloudfunctionsv2and shell-context regression testsfirebase-functionsfixnpm packon localfirebase-functionsfirebase-toolsnpm packon localfirebase-toolsThat deploy successfully recognized and updated a function named
dummystore-bot.