Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Released version 1.3.9 of the Data Connect emulator, which includes SDK support for `Any` scalar type and `OrderDirection`, support for `first` to lookup operations, and breaking changes for iOS generated SDKs. PLease see documentation for more details.
- Revert the minimum Functions SDK version and add logging for extensions features using v5.1.0 (#7731).
22 changes: 20 additions & 2 deletions src/deploy/functions/runtimes/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import fetch from "node-fetch";
import { FirebaseError } from "../../../../error";
import { getRuntimeChoice } from "./parseRuntimeAndValidateSDK";
import { logger } from "../../../../logger";
import { logLabeledSuccess, logLabeledWarning, randomInt } from "../../../../utils";
import {
logLabeledBullet,
logLabeledSuccess,
logLabeledWarning,
randomInt,
} from "../../../../utils";
import * as backend from "../../backend";
import * as build from "../../build";
import * as discovery from "../discovery";
Expand All @@ -20,7 +25,11 @@ import * as versioning from "./versioning";
import * as parseTriggers from "./parseTriggers";
import { fileExistsSync } from "../../../../fsutils";

const MIN_FUNCTIONS_SDK_VERSION = "5.1.0";
// The versions of the Firebase Functions SDK that added support for the container contract.
const MIN_FUNCTIONS_SDK_VERSION = "3.20.0";

// The version of the Firebase Functions SDK that added support for the extensions annotation in the container contract.
const MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES = "5.1.0";

/**
*
Expand Down Expand Up @@ -260,6 +269,15 @@ export class Delegate {
);
return parseTriggers.discoverBuild(this.projectId, this.sourceDir, this.runtime, config, env);
}
// Perform a check for the minimum SDK version that added annotation support for the `Build.extensions` property
// and log to the user explaining why they need to upgrade their version.
if (semver.lt(this.sdkVersion, MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES)) {
logLabeledBullet(
"functions",
`You are using a version of firebase-functions SDK (${this.sdkVersion}) that does not have support for the newest Firebase Extensions features. ` +
`Please update firebase-functions SDK to >=${MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES} to use them correctly`,
);
}
let discovered = await discovery.detectFromYaml(this.sourceDir, this.projectId, this.runtime);
if (!discovered) {
const basePort = 8000 + randomInt(0, 1000); // Add a jitter to reduce likelihood of race condition
Expand Down