Skip to content

Commit 3445858

Browse files
authored
Ensure Vertex AI is enabled when used by the emulator (#8373)
1 parent 8ece698 commit 3445858

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
- Fixed a bug where function deploys didn't support shorthand notation and parameterized service account (#8366)
1717
- Fixed an issue where `sql:setup` would incorrectly remove the `cloudsqlsuperuser` role from `firebasesuperuser` (#8363)
1818
- Fixed a bug where `appdistribution:testers:list` would error out if there were no testers.
19+
- Fixed a bug where Vertex AI API would not be automatically enabled when emulating Data Connect services that use it.

src/emulator/dataconnectEmulator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { EventEmitter } from "events";
44
import * as clc from "colorette";
55
import * as path from "path";
66

7-
import { dataConnectLocalConnString } from "../api";
7+
import { dataConnectLocalConnString, vertexAIOrigin } from "../api";
88
import { Constants } from "./constants";
99
import {
1010
getPID,
@@ -30,6 +30,7 @@ import { cleanShutdown } from "./controller";
3030
import { connectableHostname } from "../utils";
3131
import { Account } from "../types/auth";
3232
import { getCredentialsEnvironment } from "./env";
33+
import { ensure } from "../ensureApiEnabled";
3334

3435
export interface DataConnectEmulatorArgs {
3536
projectId: string;
@@ -90,6 +91,7 @@ export class DataConnectEmulator implements EmulatorInstance {
9091
"Detected a 'demo-' project, but vector embeddings require a real project. Operations that use vector_embed will fail.",
9192
);
9293
} else {
94+
await ensure(this.args.projectId, vertexAIOrigin(), "dataconnect", /* silent=*/ true);
9395
this.logger.logLabeled(
9496
"WARN",
9597
"dataconnect",

0 commit comments

Comments
 (0)