Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add private flag for disabling eager check for decommissioned functions #8156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/deploy/functions/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as args from "./args";
import * as backend from "./backend";
import * as build from "./build";
import * as experiments from "../../experiments";
import * as ensureApiEnabled from "../../ensureApiEnabled";
import * as functionsConfig from "../../functionsConfig";
import * as functionsEnv from "../../functions/env";
Expand Down Expand Up @@ -388,7 +389,7 @@
.filter(
(ep) =>
backend.isBlockingTriggered(ep) &&
AUTH_BLOCKING_EVENTS.includes(ep.blockingTrigger.eventType as any),

Check warning on line 392 in src/deploy/functions/prepare.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `"providers/cloud.auth/eventTypes/user.beforeCreate" | "providers/cloud.auth/eventTypes/user.beforeSignIn" | "providers/cloud.auth/eventTypes/user.beforeSendEmail" | "providers/cloud.auth/eventTypes/user.beforeSendSms"`

Check warning on line 392 in src/deploy/functions/prepare.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
) as (backend.Endpoint & backend.BlockingTriggered)[];

if (authBlockingEndpoints.length === 0) {
Expand Down Expand Up @@ -477,7 +478,9 @@
}
const runtimeDelegate = await runtimes.getRuntimeDelegate(delegateContext);
logger.debug(`Validating ${runtimeDelegate.language} source`);
supported.guardVersionSupport(runtimeDelegate.runtime);
if (!experiments.isEnabled("bypassfunctionsdeprecationcheck")) {
supported.guardVersionSupport(runtimeDelegate.runtime);
}
await runtimeDelegate.validate();
logger.debug(`Building ${runtimeDelegate.language} source`);
await runtimeDelegate.build();
Expand All @@ -502,7 +505,7 @@
// Genkit almost always requires an API key, so warn if the customer is about to deploy
// a function and doesn't have one. To avoid repetitive nagging, only warn on the first
// deploy of the function.
export async function warnIfNewGenkitFunctionIsMissingSecrets(

Check warning on line 508 in src/deploy/functions/prepare.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function

Check warning on line 508 in src/deploy/functions/prepare.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
have: backend.Backend,
want: backend.Backend,
options: DeployOptions,
Expand Down
8 changes: 8 additions & 0 deletions src/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@
public: true,
default: true,
},
bypassfunctionsdeprecationcheck: {
shortDescription: "Bypass Functions check for old runtimes",
fullDescription: "Bypasses the local check for whether a functions runtime is " +

Check failure on line 77 in src/experiments.ts

View workflow job for this annotation

GitHub Actions / unit (18)

Insert `⏎·····`

Check failure on line 77 in src/experiments.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Insert `⏎·····`

Check failure on line 77 in src/experiments.ts

View workflow job for this annotation

GitHub Actions / unit (18)

Insert `⏎·····`
"decommissioned. This does not, by itself, allow you to deploy a function with a " +
"decommissioned runtime, as there are server-side checks as well.",
public: false,
default: false,
},

// Emulator experiments
emulatoruisnapshot: {
Expand Down
Loading