-
Notifications
You must be signed in to change notification settings - Fork 971
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better null handling for extensions want
- Loading branch information
Showing
3 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fixed an issue where functions deployment would fail if `firebase.json#extensions` was undefined. (#7575) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,9 +131,9 @@ export async function have(projectId: string): Promise<DeploymentInstanceSpec[]> | |
* any extensions the user has defined that way. | ||
* @param args.projectId The project we are deploying to | ||
Check warning on line 132 in src/deploy/extensions/planner.ts
|
||
* @param args.projectNumber The project number we are deploying to. | ||
* @param args.extensions The extensions section of firebase.jsonm | ||
* @param args.extensions The extensions section of firebase.json | ||
* @param args.emulatorMode Whether the output will be used by the Extensions emulator. | ||
* If true, this will check {instanceId}.env.local for params a | ||
* If true, this will check {instanceId}.env.local for params | ||
*/ | ||
export async function wantDynamic(args: { | ||
projectId: string; | ||
|
@@ -143,6 +143,9 @@ export async function wantDynamic(args: { | |
}): Promise<DeploymentInstanceSpec[]> { | ||
const instanceSpecs: DeploymentInstanceSpec[] = []; | ||
const errors: FirebaseError[] = []; | ||
if (!args.extensions) { | ||
return []; | ||
} | ||
for (const [instanceId, ext] of Object.entries(args.extensions)) { | ||
const autoPopulatedParams = await getFirebaseProjectParams(args.projectId, args.emulatorMode); | ||
const subbedParams = substituteParams(ext.params, autoPopulatedParams); | ||
|
@@ -207,6 +210,9 @@ export async function want(args: { | |
}): Promise<DeploymentInstanceSpec[]> { | ||
const instanceSpecs: DeploymentInstanceSpec[] = []; | ||
const errors: FirebaseError[] = []; | ||
if (!args.extensions) { | ||
return []; | ||
} | ||
for (const e of Object.entries(args.extensions)) { | ||
try { | ||
const instanceId = e[0]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters