Skip to content

Commit 341a6e0

Browse files
authored
Remove label annotations for genkit functions; they break (#8127)
1 parent 6d0d75a commit 341a6e0

File tree

3 files changed

+3
-46
lines changed

3 files changed

+3
-46
lines changed

src/deploy/functions/backend.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export interface HttpsTriggered {
4242

4343
/** API agnostic version of a Firebase callable function. */
4444
export type CallableTrigger = {
45+
// NOTE: This is currently unused because GCF 2nd gen labels do not support
46+
// the characterset that may be in a genkit action name.
47+
// This should be set as a Cloud Run attribute once we move to Cloud Run Functions.
4548
genkitAction?: string;
4649
};
4750

src/gcp/cloudfunctionsv2.spec.ts

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -221,23 +221,6 @@ describe("cloudfunctionsv2", () => {
221221
[BLOCKING_LABEL]: "before-sign-in",
222222
},
223223
});
224-
225-
expect(
226-
cloudfunctionsv2.functionFromEndpoint({
227-
...ENDPOINT,
228-
platform: "gcfv2",
229-
callableTrigger: {
230-
genkitAction: "flows/flow",
231-
},
232-
}),
233-
).to.deep.equal({
234-
...CLOUD_FUNCTION_V2,
235-
labels: {
236-
...CLOUD_FUNCTION_V2.labels,
237-
"deployment-callable": "true",
238-
"genkit-action": "flows/flow",
239-
},
240-
});
241224
});
242225

243226
it("should copy trival fields", () => {
@@ -654,29 +637,6 @@ describe("cloudfunctionsv2", () => {
654637
});
655638
});
656639

657-
it("should translate genkit callables", () => {
658-
expect(
659-
cloudfunctionsv2.endpointFromFunction({
660-
...HAVE_CLOUD_FUNCTION_V2,
661-
labels: {
662-
"deployment-callable": "true",
663-
"genkit-action": "flows/flow",
664-
},
665-
}),
666-
).to.deep.equal({
667-
...ENDPOINT,
668-
callableTrigger: {
669-
genkitAction: "flows/flow",
670-
},
671-
platform: "gcfv2",
672-
uri: GCF_URL,
673-
labels: {
674-
"deployment-callable": "true",
675-
"genkit-action": "flows/flow",
676-
},
677-
});
678-
});
679-
680640
it("should copy optional fields", () => {
681641
const extraFields: backend.ServiceConfiguration = {
682642
ingressSettings: "ALLOW_ALL",

src/gcp/cloudfunctionsv2.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,6 @@ export function functionFromEndpoint(endpoint: backend.Endpoint): InputCloudFunc
609609
gcfFunction.labels = { ...gcfFunction.labels, "deployment-taskqueue": "true" };
610610
} else if (backend.isCallableTriggered(endpoint)) {
611611
gcfFunction.labels = { ...gcfFunction.labels, "deployment-callable": "true" };
612-
if (endpoint.callableTrigger.genkitAction) {
613-
gcfFunction.labels["genkit-action"] = endpoint.callableTrigger.genkitAction;
614-
}
615612
} else if (backend.isBlockingTriggered(endpoint)) {
616613
gcfFunction.labels = {
617614
...gcfFunction.labels,
@@ -657,9 +654,6 @@ export function endpointFromFunction(gcfFunction: OutputCloudFunction): backend.
657654
trigger = {
658655
callableTrigger: {},
659656
};
660-
if (gcfFunction.labels["genkit-action"]) {
661-
trigger.callableTrigger.genkitAction = gcfFunction.labels["genkit-action"];
662-
}
663657
} else if (gcfFunction.labels?.[BLOCKING_LABEL]) {
664658
trigger = {
665659
blockingTrigger: {

0 commit comments

Comments
 (0)