You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
any news on this? its concerning that you cant deploy event functions with retries since the ability to retry an event is kind of the whole point.
for anyone stuck on this you can update this file (with patch-package) to set a retryPolicy instead of the warning in the console as a temporary measure
patches/firebase-tools+12.4.2.patch
diff --git a/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js b/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js
index 38ed977..8da2118 100644
--- a/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js+++ b/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js@@ -241,7 +241,8 @@ function functionFromEndpoint(endpoint, source) {
proto.renameIfPresent(gcfFunction.eventTrigger, endpoint.eventTrigger, "triggerRegion", "region");
proto.copyIfPresent(gcfFunction.eventTrigger, endpoint.eventTrigger, "channel");
if (endpoint.eventTrigger.retry) {
- logger_1.logger.warn("Cannot set a retry policy on Cloud Function", endpoint.id);+ gcfFunction.eventTrigger.retryPolicy = 'RETRY_POLICY_RETRY'+ // logger_1.logger.warn("Cannot set a retry policy on Cloud Function", endpoint.id);
}
gcfFunction.serviceConfig.environmentVariables = Object.assign(Object.assign({}, gcfFunction.serviceConfig.environmentVariables), { FUNCTION_SIGNATURE_TYPE: "cloudevent" });
}
[REQUIRED] Environment info
firebase-tools: 11.21.0
Platform: macOS
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
firebase deploy --only functions
[REQUIRED] Expected behavior
Should deploy function with retry policy
[REQUIRED] Actual behavior
Shows a warning
Cannot set a retry policy on Cloud Function
and does not set the retry policy.Warning is coming from here:
firebase-tools/src/gcp/cloudfunctionsv2.ts
Line 528 in a2b9389
EventTrigger
hasretryPolicy
field, so it should be set whenretry
option is specified.https://cloud.google.com/functions/docs/reference/rest/v2/projects.locations.functions#eventtrigger
The text was updated successfully, but these errors were encountered: