Skip to content

Commit 7759745

Browse files
committed
Merge branch 'master' into rosalyntan.schema
2 parents 2e7185c + 1ed4791 commit 7759745

File tree

23 files changed

+212
-140
lines changed

23 files changed

+212
-140
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
- Adds listServices and also defines trigger within runv2.ts [#9482]

npm-shrinkwrap.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase-tools",
3-
"version": "14.25.1",
3+
"version": "14.26.0",
44
"description": "Command-Line Interface for Firebase",
55
"main": "./lib/index.js",
66
"bin": {

schema/firebase-config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"nodejs18",
88
"nodejs20",
99
"nodejs22",
10+
"nodejs24",
1011
"python310",
1112
"python311",
1213
"python312",
@@ -915,6 +916,7 @@
915916
"nodejs18",
916917
"nodejs20",
917918
"nodejs22",
919+
"nodejs24",
918920
"python310",
919921
"python311",
920922
"python312",

src/dataconnect/freeTrial.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as clc from "colorette";
22

33
import { queryTimeSeries, CmQuery } from "../gcp/cloudmonitoring";
4-
import * as utils from "../utils";
54

65
export function freeTrialTermsLink(): string {
76
return "https://firebase.google.com/pricing";
@@ -28,19 +27,11 @@ export async function checkFreeTrialInstanceUsed(projectId: string): Promise<boo
2827
// If the metric doesn't exist, free trial is not used.
2928
used = false;
3029
}
31-
if (used) {
32-
utils.logLabeledWarning(
33-
"dataconnect",
34-
"CloudSQL no cost trial has already been used on this project.",
35-
);
36-
} else {
37-
utils.logLabeledSuccess("dataconnect", "CloudSQL no cost trial available!");
38-
}
3930
return used;
4031
}
4132

42-
export function upgradeInstructions(projectId: string): string {
43-
return `To provision a CloudSQL Postgres instance on the Firebase Data Connect no-cost trial:
33+
export function upgradeInstructions(projectId: string, trialUsed: boolean): string {
34+
return `To provision a ${trialUsed ? "paid CloudSQL Postgres instance" : "CloudSQL Postgres instance on the Firebase Data Connect no-cost trial"}:
4435
4536
1. Please upgrade to the pay-as-you-go (Blaze) billing plan. Visit the following page:
4637

src/dataconnect/provisionCloudSql.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { promiseWithSpinner } from "../utils";
99
import { trackGA4 } from "../track";
1010
import * as utils from "../utils";
1111
import { Source } from "../init/features/dataconnect";
12+
import { checkBillingEnabled } from "../gcp/cloudbilling";
1213

1314
const GOOGLE_ML_INTEGRATION_ROLE = "roles/aiplatform.user";
1415

@@ -147,7 +148,12 @@ async function createInstance(args: {
147148
});
148149
utils.logLabeledBullet(
149150
"dataconnect",
150-
cloudSQLBeingCreated(projectId, instanceId, freeTrialLabel === "ft"),
151+
cloudSQLBeingCreated(
152+
projectId,
153+
instanceId,
154+
freeTrialLabel === "ft",
155+
await checkBillingEnabled(projectId),
156+
),
151157
);
152158
}
153159
}
@@ -158,18 +164,22 @@ async function createInstance(args: {
158164
export function cloudSQLBeingCreated(
159165
projectId: string,
160166
instanceId: string,
161-
includeFreeTrialToS?: boolean,
167+
isFreeTrial?: boolean,
168+
billingEnabled?: boolean,
162169
): string {
163170
return (
164171
`Cloud SQL Instance ${clc.bold(instanceId)} is being created.` +
165-
(includeFreeTrialToS
172+
(isFreeTrial
166173
? `\nThis instance is provided under the terms of the Data Connect no-cost trial ${freeTrialTermsLink()}`
167174
: "") +
168-
`
169-
Meanwhile, your data are saved in a temporary database and will be migrated once complete. Monitor its progress at
170-
171-
${cloudSqlAdminClient.instanceConsoleLink(projectId, instanceId)}
172-
`
175+
`\n
176+
Meanwhile, your data are saved in a temporary database and will be migrated once complete.` +
177+
(isFreeTrial && !billingEnabled
178+
? `
179+
Your free trial instance won't show in google cloud console until a billing account is added.
180+
However, you can still use the gcloud cli to monitor your database instance:\n\n\te.g. gcloud sql instances list --project ${projectId}\n`
181+
: `
182+
Monitor its progress at\n\n\t${cloudSqlAdminClient.instanceConsoleLink(projectId, instanceId)}\n`)
173183
);
174184
}
175185

src/deploy/dataconnect/prepare.spec.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ import * as filters from "../../dataconnect/filters";
99
import * as build from "../../dataconnect/build";
1010
import * as ensureApis from "../../dataconnect/ensureApis";
1111
import * as requireTosAcceptance from "../../requireTosAcceptance";
12-
import * as cloudbilling from "../../gcp/cloudbilling";
1312
import * as schemaMigration from "../../dataconnect/schemaMigration";
1413
import * as provisionCloudSql from "../../dataconnect/provisionCloudSql";
14+
import * as cloudbilling from "../../gcp/cloudbilling";
1515
import { FirebaseError } from "../../error";
1616

1717
describe("dataconnect prepare", () => {
1818
let sandbox: sinon.SinonSandbox;
1919
let loadAllStub: sinon.SinonStub;
2020
let buildStub: sinon.SinonStub;
21-
let checkBillingEnabledStub: sinon.SinonStub;
2221
let getResourceFiltersStub: sinon.SinonStub;
2322
let diffSchemaStub: sinon.SinonStub;
2423
let setupCloudSqlStub: sinon.SinonStub;
@@ -27,14 +26,14 @@ describe("dataconnect prepare", () => {
2726
sandbox = sinon.createSandbox();
2827
loadAllStub = sandbox.stub(load, "loadAll").resolves([]);
2928
buildStub = sandbox.stub(build, "build").resolves({} as any);
30-
checkBillingEnabledStub = sandbox.stub(cloudbilling, "checkBillingEnabled").resolves(true);
3129
sandbox.stub(ensureApis, "ensureApis").resolves();
3230
sandbox.stub(requireTosAcceptance, "requireTosAcceptance").returns(() => Promise.resolve());
3331
getResourceFiltersStub = sandbox.stub(filters, "getResourceFilters").returns(undefined);
3432
diffSchemaStub = sandbox.stub(schemaMigration, "diffSchema").resolves();
3533
setupCloudSqlStub = sandbox.stub(provisionCloudSql, "setupCloudSql").resolves();
3634
sandbox.stub(projectUtils, "needProjectId").returns("test-project");
3735
sandbox.stub(utils, "logLabeledBullet");
36+
sandbox.stub(cloudbilling, "checkBillingEnabled").resolves();
3837
});
3938

4039
afterEach(() => {
@@ -57,16 +56,6 @@ describe("dataconnect prepare", () => {
5756
});
5857
});
5958

60-
it("should throw an error if billing is not enabled", async () => {
61-
checkBillingEnabledStub.resolves(false);
62-
const context = {};
63-
const options = { config: {} } as any;
64-
await expect(prepare.default(context, options)).to.be.rejectedWith(
65-
FirebaseError,
66-
"To provision a CloudSQL Postgres instance on the Firebase Data Connect no-cost trial",
67-
);
68-
});
69-
7059
it("should build services", async () => {
7160
const serviceInfos = [{ sourceDirectory: "a" }, { sourceDirectory: "b" }];
7261
loadAllStub.resolves(serviceInfos as any);

src/deploy/dataconnect/prepare.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ import { ensureApis } from "../../dataconnect/ensureApis";
1111
import { requireTosAcceptance } from "../../requireTosAcceptance";
1212
import { DATA_CONNECT_TOS_ID } from "../../gcp/firedata";
1313
import { setupCloudSql } from "../../dataconnect/provisionCloudSql";
14-
import { checkBillingEnabled } from "../../gcp/cloudbilling";
1514
import { parseServiceName } from "../../dataconnect/names";
1615
import { FirebaseError } from "../../error";
1716
import { mainSchema, requiresVector } from "../../dataconnect/types";
1817
import { diffSchema } from "../../dataconnect/schemaMigration";
19-
import { upgradeInstructions } from "../../dataconnect/freeTrial";
18+
import { checkBillingEnabled } from "../../gcp/cloudbilling";
2019
import { Context, initDeployStats } from "./context";
2120

2221
/**
@@ -35,7 +34,6 @@ export default async function (context: Context, options: DeployOptions): Promis
3534
const { serviceInfos, filters, deployStats } = context.dataconnect;
3635
if (!(await checkBillingEnabled(projectId))) {
3736
deployStats.missingBilling = true;
38-
throw new FirebaseError(upgradeInstructions(projectId));
3937
}
4038
await requireTosAcceptance(DATA_CONNECT_TOS_ID)(options);
4139
for (const si of serviceInfos) {

src/deploy/functions/runtimes/supported/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ export const RUNTIMES = runtimes({
8989
deprecationDate: "2027-04-30",
9090
decommissionDate: "2028-10-31",
9191
},
92+
nodejs24: {
93+
friendly: "Node.js 24",
94+
status: "beta",
95+
deprecationDate: "2028-04-30",
96+
decommissionDate: "2028-10-31",
97+
},
9298
python310: {
9399
friendly: "Python 3.10",
94100
status: "GA",

src/emulator/downloadableEmulatorInfo.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,36 +54,36 @@
5454
},
5555
"dataconnect": {
5656
"darwin": {
57-
"version": "2.17.1",
58-
"expectedSize": 30004064,
59-
"expectedChecksum": "89314d496595b250e149d8705ccd2ddc",
60-
"expectedChecksumSHA256": "1e95733bf75fd433047345cb4c069ff4ddd2a2e296c53da3787dd708a26a8642",
61-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v2.17.1",
62-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.1"
57+
"version": "2.17.2",
58+
"expectedSize": 30012256,
59+
"expectedChecksum": "9e8d43abb6e93f4c969088078fdaf780",
60+
"expectedChecksumSHA256": "6001b86795f727f90755b497cba7ebcd2f50d024b0e56d1d6e957fcb98ff463c",
61+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v2.17.2",
62+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.2"
6363
},
6464
"darwin_arm64": {
65-
"version": "2.17.1",
66-
"expectedSize": 29476450,
67-
"expectedChecksum": "038125be57400e11f5013001cf68ce9e",
68-
"expectedChecksumSHA256": "a11f6ea1f8b8d80f502df6e9b34865fb12186b4157f2c282a0e6f99c53077ca2",
69-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v2.17.1",
70-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.1"
65+
"version": "2.17.2",
66+
"expectedSize": 29475730,
67+
"expectedChecksum": "1a82213baded25c2a6c584a72a5600f2",
68+
"expectedChecksumSHA256": "c51a6810e975e13ac5ea5f038addf259da8b0d17b0b739dab1267dca133e5a54",
69+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v2.17.2",
70+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.2"
7171
},
7272
"win32": {
73-
"version": "2.17.1",
74-
"expectedSize": 30496768,
75-
"expectedChecksum": "939a77bb9a549bc9460f888ac3442397",
76-
"expectedChecksumSHA256": "04d6859668c4afc1fa301f5cc892623669bcbf26ce5195bc80dc208783c33853",
77-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v2.17.1",
78-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.1.exe"
73+
"version": "2.17.2",
74+
"expectedSize": 30507008,
75+
"expectedChecksum": "1a071a45267279463516f8264aaa5a97",
76+
"expectedChecksumSHA256": "8f84b312a049f80e2f9466eb1f77d15e1dedec8ce0696c51fc221fbb3b436eee",
77+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v2.17.2",
78+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.2.exe"
7979
},
8080
"linux": {
81-
"version": "2.17.1",
82-
"expectedSize": 29925560,
83-
"expectedChecksum": "239d20f4aedf0bf6f79caca7453bf5cf",
84-
"expectedChecksumSHA256": "756fa6343a659a8a2606ee0df2a321ffaf47645fff8f4b209286681ee36820e3",
85-
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v2.17.1",
86-
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.1"
81+
"version": "2.17.2",
82+
"expectedSize": 29937848,
83+
"expectedChecksum": "70bc4fc8eecc1c1c6dd4f404ed7e2b89",
84+
"expectedChecksumSHA256": "9b90874daf84f0cfb7ae72f3a8c4ccec523593ccd318cd967f5bef7d574efa77",
85+
"remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v2.17.2",
86+
"downloadPathRelativeToCacheDir": "dataconnect-emulator-2.17.2"
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)