fix: preserve quoted hyphenated export names in discovery#1895
Closed
IzaakGough wants to merge 3 commits into
Closed
fix: preserve quoted hyphenated export names in discovery#1895IzaakGough wants to merge 3 commits into
IzaakGough wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the runtime loader to preserve literal hyphens in entry points for flat export names by separating the endpoint ID and entry point prefixes. It also exposes the underlying raw request and disconnect signal within the Genkit action context in onCallGenkit. Feedback suggests a cleaner way to satisfy the ESLint require-yield rule in the new tests by using yield* [] instead of an unreachable yield statement.
Comment on lines
+761
to
+768
| stream: (async function* () { | ||
| await output; | ||
| // This test intentionally doesn't emit any stream messages, but ESLint's `require-yield` | ||
| // rule requires at least one `yield` in a generator function. | ||
| return; | ||
| // eslint-disable-next-line no-unreachable | ||
| yield undefined; | ||
| })(), |
Contributor
There was a problem hiding this comment.
Author
|
Closing in favor of #1896 |
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.
Fixes
firebase/firebase-tools#8469This change fixes function discovery for quoted export names that contain hyphens, for example:
Problem
The current discovery logic derives
entryPointfrom the manifest endpoint id by replacing-with..That works for grouped exports, where a flattened manifest id like
grouped-fnshould map back to an entry point likegrouped.fn.However, it is incorrect for quoted export names that literally contain hyphens. In that case, the discovered function id is something like
dummystore-bot, but converting that todummystore.botproduces the wrong runtime entry point.As a result, downstream tooling can fail to deploy or invoke these functions correctly.
Change
This PR updates runtime discovery to track two separate paths during stack extraction:
entryPoint, which preserves the actual export access pathWith this change:
entryPointfor downstream consumersTests
This PR adds coverage for the fix in two places:
extractStackCompanion Change In
firebase-toolsThis is the primary fix.
There is a companion PR in
firebase-toolsthat updates the CLI to trust the SDK-providedentryPointinstead of re-deriving it from function ids, and also updatesfunctions:shellto use the discoveredentryPoint.Companion PR:
Validation
Validated with:
firebase-functionsdiscovery testsfirebase-toolsfollow-up changesnpm packon localfirebase-functionsnpm packon localfirebase-toolsdummystore-botThat deploy succeeded and the function was recognized and deployed under the correct name.