Skip to content

Commit 8344573

Browse files
committed
address feedback
1 parent 0a25033 commit 8344573

File tree

5 files changed

+57
-56
lines changed

5 files changed

+57
-56
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Add new 2nd gen Firestore auth context triggers. (#1519)
1+
- Add new 2nd gen Firestore triggered functions with auth context. (#1519)

src/deploy/functions/prompts.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export async function promptForFailurePolicies(
7676
*/
7777
export async function promptForFunctionDeletion(
7878
functionsToDelete: (backend.TargetIds & { platform: backend.FunctionsPlatform })[],
79-
options: Options,
79+
options: Options
8080
): Promise<boolean> {
8181
let shouldDeleteFns = true;
8282
if (functionsToDelete.length === 0 || options.force) {
@@ -127,7 +127,7 @@ export async function promptForFunctionDeletion(
127127
*/
128128
export async function promptForUnsafeMigration(
129129
fnsToUpdate: EndpointUpdate[],
130-
options: Options,
130+
options: Options
131131
): Promise<EndpointUpdate[]> {
132132
const unsafeUpdates = fnsToUpdate.filter((eu) => eu.unsafe);
133133

@@ -142,11 +142,11 @@ export async function promptForUnsafeMigration(
142142
.map((eu) => eu.endpoint)
143143
.sort(backend.compareFunctions)
144144
.map(getFunctionLabel)
145-
.join(", "),
145+
.join(", ")
146146
) +
147147
". " +
148148
"While automatic migration is allowed for these functions, updating the underlying event type may result in data loss. " +
149-
"To avoid this, consider the best practices outlined in the migration guide: [TODO: link]";
149+
"To avoid this, consider the best practices outlined in the migration guide: https://firebase.google.com/docs/functions/manage-functions?gen=2nd#modify-trigger";
150150

151151
utils.logLabeledWarning("functions", warnMessage);
152152

@@ -155,7 +155,7 @@ export async function promptForUnsafeMigration(
155155
if (options.nonInteractive) {
156156
utils.logLabeledWarning(
157157
"functions",
158-
"Aborting updates for functions that may be unsafe to update. To update these functions anyway, deploy again in interactive mode or use the --force option.",
158+
"Skipping updates for functions that may be unsafe to update. To update these functions anyway, deploy again in interactive mode or use the --force option."
159159
);
160160
return safeUpdates;
161161
}
@@ -166,7 +166,7 @@ export async function promptForUnsafeMigration(
166166
name: "confirm",
167167
default: false,
168168
message: `[${getFunctionLabel(
169-
eu.endpoint,
169+
eu.endpoint
170170
)}] Would you like to proceed with the unsafe migration?`,
171171
});
172172
if (shouldUpdate) {

src/deploy/functions/release/fabricator.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class Fabricator {
102102
if (errs.length) {
103103
logger.debug(
104104
"Fabricator.applyRegionalChanges returned an unhandled exception. This should never happen",
105-
JSON.stringify(errs, null, 2),
105+
JSON.stringify(errs, null, 2)
106106
);
107107
}
108108

@@ -115,7 +115,7 @@ export class Fabricator {
115115
const handle = async (
116116
op: reporter.OperationType,
117117
endpoint: backend.Endpoint,
118-
fn: () => Promise<void>,
118+
fn: () => Promise<void>
119119
): Promise<void> => {
120120
const timer = new Timer();
121121
const result: Partial<reporter.DeployResult> = { endpoint };
@@ -135,7 +135,7 @@ export class Fabricator {
135135
for (const endpoint of changes.endpointsToCreate) {
136136
this.logOpStart("creating", endpoint);
137137
upserts.push(
138-
handle("create", endpoint, () => this.createEndpoint(endpoint, scraperV1, scraperV2)),
138+
handle("create", endpoint, () => this.createEndpoint(endpoint, scraperV1, scraperV2))
139139
);
140140
}
141141
for (const endpoint of changes.endpointsToSkip) {
@@ -144,7 +144,7 @@ export class Fabricator {
144144
for (const update of changes.endpointsToUpdate) {
145145
this.logOpStart("updating", update.endpoint);
146146
upserts.push(
147-
handle("update", update.endpoint, () => this.updateEndpoint(update, scraperV1, scraperV2)),
147+
handle("update", update.endpoint, () => this.updateEndpoint(update, scraperV1, scraperV2))
148148
);
149149
}
150150
await utils.allSettled(upserts);
@@ -175,7 +175,7 @@ export class Fabricator {
175175
async createEndpoint(
176176
endpoint: backend.Endpoint,
177177
scraperV1: SourceTokenScraper,
178-
scraperV2: SourceTokenScraper,
178+
scraperV2: SourceTokenScraper
179179
): Promise<void> {
180180
endpoint.labels = { ...endpoint.labels, ...deploymentTool.labels() };
181181
if (endpoint.platform === "gcfv1") {
@@ -192,7 +192,7 @@ export class Fabricator {
192192
async updateEndpoint(
193193
update: planner.EndpointUpdate,
194194
scraperV1: SourceTokenScraper,
195-
scraperV2: SourceTokenScraper,
195+
scraperV2: SourceTokenScraper
196196
): Promise<void> {
197197
update.endpoint.labels = { ...update.endpoint.labels, ...deploymentTool.labels() };
198198
if (update.deleteAndRecreate) {
@@ -398,7 +398,7 @@ export class Fabricator {
398398
logger.debug("Result function unexpectedly didn't have a service name.");
399399
utils.logLabeledWarning(
400400
"functions",
401-
"Updated function is not associated with a service. This deployment is in an unexpected state - please re-deploy your functions.",
401+
"Updated function is not associated with a service. This deployment is in an unexpected state - please re-deploy your functions."
402402
);
403403
return;
404404
}
@@ -511,7 +511,7 @@ export class Fabricator {
511511
onPoll: scraper.poller,
512512
});
513513
},
514-
{ retryCodes: [...DEFAULT_RETRY_CODES, CLOUD_RUN_RESOURCE_EXHAUSTED_CODE] },
514+
{ retryCodes: [...DEFAULT_RETRY_CODES, CLOUD_RUN_RESOURCE_EXHAUSTED_CODE] }
515515
)
516516
.catch((err: any) => {
517517
scraper.abort();
@@ -526,7 +526,7 @@ export class Fabricator {
526526
logger.debug("Result function unexpectedly didn't have a service name.");
527527
utils.logLabeledWarning(
528528
"functions",
529-
"Updated function is not associated with a service. This deployment is in an unexpected state - please re-deploy your functions.",
529+
"Updated function is not associated with a service. This deployment is in an unexpected state - please re-deploy your functions."
530530
);
531531
return;
532532
}
@@ -581,7 +581,7 @@ export class Fabricator {
581581
};
582582
await poller.pollOperation<void>(pollerOptions);
583583
},
584-
{ retryCodes: [...DEFAULT_RETRY_CODES, CLOUD_RUN_RESOURCE_EXHAUSTED_CODE] },
584+
{ retryCodes: [...DEFAULT_RETRY_CODES, CLOUD_RUN_RESOURCE_EXHAUSTED_CODE] }
585585
)
586586
.catch(rethrowAs(endpoint, "delete"));
587587
}
@@ -686,7 +686,7 @@ export class Fabricator {
686686
}
687687

688688
async registerBlockingTrigger(
689-
endpoint: backend.Endpoint & backend.BlockingTriggered,
689+
endpoint: backend.Endpoint & backend.BlockingTriggered
690690
): Promise<void> {
691691
await this.executor
692692
.run(() => services.serviceForEndpoint(endpoint).registerTrigger(endpoint))
@@ -723,7 +723,7 @@ export class Fabricator {
723723
}
724724

725725
async unregisterBlockingTrigger(
726-
endpoint: backend.Endpoint & backend.BlockingTriggered,
726+
endpoint: backend.Endpoint & backend.BlockingTriggered
727727
): Promise<void> {
728728
await this.executor
729729
.run(() => services.serviceForEndpoint(endpoint).unregisterTrigger(endpoint))
@@ -736,7 +736,7 @@ export class Fabricator {
736736
const label = helper.getFunctionLabel(endpoint);
737737
utils.logLabeledBullet(
738738
"functions",
739-
`${op} ${runtime} (${platform}) function ${clc.bold(label)}...`,
739+
`${op} ${runtime} (${platform}) function ${clc.bold(label)}...`
740740
);
741741
}
742742

@@ -764,7 +764,7 @@ export class Fabricator {
764764
const functionNames = endpoints.map((endpoint) => endpoint.id).join(",");
765765
return `${clc.bold(clc.magenta(`functions:`))} You can re-deploy skipped functions with:
766766
${clc.bold(`firebase deploy --only functions:${functionNames}`)} or ${clc.bold(
767-
`FUNCTIONS_DEPLOY_UNCHANGED=true firebase deploy`,
768-
)}`;
767+
`FUNCTIONS_DEPLOY_UNCHANGED=true firebase deploy`
768+
)}`;
769769
}
770770
}

src/deploy/functions/release/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function release(
6666
}
6767
for (const eu of fnsToUpdateSafe) {
6868
const e = eu.endpoint;
69-
const key = `${e.codebase}-${e.region}-${e.availableMemoryMb || "default"}`;
69+
const key = `${e.codebase || ""}-${e.region}-${e.availableMemoryMb || "default"}`;
7070
plan[key].endpointsToUpdate.push(eu);
7171
}
7272

0 commit comments

Comments
 (0)