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,3 +1,4 @@
- Fix type mismatch for parametrized function region. (#6205)
- Ignore `FIRESTORE_EMULATOR_HOST` environment variable on functions deploy. (#6442)
- Added support for enabling, disabling, and displaying Point In Time Recovery enablement state on Firestore databases (#6388)
- Added a `--verbosity` flag to `emulators:*` commands that limits what logs are printed (#2859)
Expand Down
16 changes: 15 additions & 1 deletion src/deploy/functions/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { assertExhaustive, mapObject, nullsafeVisitor } from "../../functional";
import { UserEnvsOpts, writeUserEnvs } from "../../functions/env";
import { FirebaseConfig } from "./args";
import { Runtime } from "./runtimes";
import { ExprParseError } from "./cel";

/* The union of a customer-controlled deployment and potentially deploy-time defined parameters */
export interface Build {
Expand Down Expand Up @@ -434,8 +435,21 @@ export function toBackend(
let regions: string[] = [];
if (!bdEndpoint.region) {
regions = [api.functionsDefaultRegion];
} else {
} else if (Array.isArray(bdEndpoint.region)) {
regions = params.resolveList(bdEndpoint.region, paramValues);
} else {
// N.B. setting region via GlobalOptions only accepts a String param.
// Therefore if we raise an exception by attempting to resolve a
// List param, we try resolving a String param instead.
try {
regions = params.resolveList(bdEndpoint.region, paramValues);
} catch (err: any) {
if (err instanceof ExprParseError) {
regions = [params.resolveString(bdEndpoint.region, paramValues)];
} else {
throw err;
}
}
}
for (const region of regions) {
const trigger = discoverTrigger(bdEndpoint, region, r);
Expand Down