Skip to content

Commit 2d3a1fb

Browse files
authored
Set extraEnv in vscode process (#8354)
* Set extraEnv in vscode process * format
1 parent 7a7f3a5 commit 2d3a1fb

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

firebase-vscode/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- [Added] Added rerun execution button in variables context
44
- [Added] Provide default required variables during execution
5+
- [Fixed] Fixed an issue where nvironment variables provided in `extraEnv` were not respected in some cases
56

67
## 0.14.2
78

firebase-vscode/src/data-connect/service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
IntrospectionQuery,
55
getIntrospectionQuery,
66
} from "graphql";
7-
import { assertExecutionResult } from "../../common/graphql";
87
import { DataConnectError } from "../../common/error";
98
import { AuthService } from "../auth/service";
109
import { UserMockKind } from "../../common/messaging/protocol";
@@ -15,6 +14,7 @@ import { dataConnectConfigs } from "../data-connect/config";
1514
import { firebaseRC } from "../core/config";
1615
import {
1716
dataconnectDataplaneClient,
17+
dataconnectOrigin,
1818
executeGraphQL,
1919
DATACONNECT_API_VERSION,
2020
} from "../../../src/dataconnect/dataplaneClient";
@@ -236,6 +236,7 @@ export class DataConnectService {
236236
});
237237
if (params.instance === InstanceType.PRODUCTION) {
238238
const client = dataconnectDataplaneClient();
239+
pluginLogger.info(`ExecuteGraphQL (${dataconnectOrigin()}) request: ${JSON.stringify(prodBody, undefined, 4)}`);
239240
const resp = await executeGraphQL(client, servicePath, prodBody);
240241
return this.handleProdResponse(resp);
241242
} else {

firebase-vscode/src/utils/settings.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export function getSettings(): Settings {
3333
firebaseBinaryKind = "firepit-global";
3434
}
3535

36+
const extraEnv = config.get<Record<string,string>>("extraEnv", {})
37+
process.env = { ...process.env, ...extraEnv };
38+
3639
return {
3740
firebasePath,
3841
firebaseBinaryKind,
@@ -46,7 +49,7 @@ export function getSettings(): Settings {
4649
exportPath: config.get<string>("emulators.exportPath", "./exportedData"),
4750
exportOnExit: config.get<boolean>("emulators.exportOnExit", false),
4851
debug: config.get<boolean>("debug", false),
49-
extraEnv: config.get<Record<string,string>>("extraEnv", {}),
52+
extraEnv,
5053
};
5154
}
5255

src/dataconnect/dataplaneClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { dataconnectOrigin } from "../api";
2+
export { dataconnectOrigin } from "../api";
23
import { Client, ClientResponse } from "../apiv2";
34
import * as types from "./types";
45

@@ -11,7 +12,6 @@ export function dataconnectDataplaneClient(): Client {
1112
auth: true,
1213
});
1314
}
14-
1515
export async function executeGraphQL(
1616
client: Client,
1717
servicePath: string,

0 commit comments

Comments
 (0)