Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly set FUNCTION_TARGET for multilevel grouped functions #6423

Merged
merged 2 commits into from
Oct 2, 2023
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
@@ -0,0 +1 @@
- Fixed an issue with deploying multilevel grouped functions containing v2 functions. (#6419)
4 changes: 2 additions & 2 deletions src/gcp/cloudfunctionsv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@
* @param type Type of deployment - create, update, or delete.
* @param err The error returned from the operation.
*/
function functionsOpLogReject(func: InputCloudFunction, type: string, err: any): void {

Check warning on line 251 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
if (err?.message?.includes("maxScale may not exceed")) {

Check warning on line 252 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .message on an `any` value

Check warning on line 252 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe call of an `any` typed value
const maxInstances = func.serviceConfig.maxInstanceCount || DEFAULT_MAX_INSTANCE_COUNT;
utils.logLabeledWarning(
"functions",
Expand All @@ -265,14 +265,14 @@
`You can adjust the max instances value in your function's runtime options:\n\t${suggestedFix}`
);
} else {
utils.logLabeledWarning("functions", `${err?.message}`);

Check warning on line 268 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Invalid type "any" of template literal expression

Check warning on line 268 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .message on an `any` value
if (err?.context?.response?.statusCode === 429) {

Check warning on line 269 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .context on an `any` value
utils.logLabeledWarning(
"functions",
`Got "Quota Exceeded" error while trying to ${type} ${func.name}. Waiting to retry...`
);
} else if (
err?.message?.includes(

Check warning on line 275 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .message on an `any` value

Check warning on line 275 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe call of an `any` typed value
"If you recently started to use Eventarc, it may take a few minutes before all necessary permissions are propagated to the Service Agent"
)
) {
Expand All @@ -288,8 +288,8 @@
);
}
throw new FirebaseError(`Failed to ${type} function ${func.name}`, {
original: err,

Check warning on line 291 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe assignment of an `any` value
status: err?.context?.response?.statusCode,

Check warning on line 292 in src/gcp/cloudfunctionsv2.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe assignment of an `any` value
context: { function: func.name },
});
}
Expand Down Expand Up @@ -331,7 +331,7 @@

cloudFunction.serviceConfig.environmentVariables = {
...cloudFunction.serviceConfig.environmentVariables,
FUNCTION_TARGET: functionId.replace("-", "."),
FUNCTION_TARGET: functionId.replaceAll("-", "."),
};

try {
Expand Down Expand Up @@ -439,7 +439,7 @@

cloudFunction.serviceConfig.environmentVariables = {
...cloudFunction.serviceConfig.environmentVariables,
FUNCTION_TARGET: functionId.replace("-", "."),
FUNCTION_TARGET: functionId.replaceAll("-", "."),
};

try {
Expand Down
Loading