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

Deploying functions with failurePolicy should not always require --force #798

Closed
rbruggem opened this issue Oct 21, 2020 · 4 comments · Fixed by firebase/firebase-tools#3164

Comments

@rbruggem
Copy link

Related issues

The comment explains how it should work.

#425 (comment)

[REQUIRED] Version info

node: 10.18.1

firebase-functions: 3.11.0

firebase-tools: 8.12.0

8.12.0

firebase-admin: 8.6.0

[REQUIRED] Test case

firebase deploy --only functions:THEFUNCTION errors with:
Error: Pass the --force option to deploy functions with a failure policy

[REQUIRED] Steps to reproduce

Add failurePolicy: { retry: {} } to an existing function which does not have a failure policy set.

[REQUIRED] Expected behavior

Running firebase deploy --only functions:THEFUNCTION would deploy the function successfully without the use of --force.

[REQUIRED] Actual behavior

Error: Pass the --force option to deploy functions with a failure policy

Were you able to successfully deploy your functions?

Only with --force which is not ideal to have in a CICD pipeline.

@google-oss-bot
Copy link
Collaborator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@joehan
Copy link
Contributor

joehan commented Nov 12, 2020

Hey @rbruggem , I believe that this is working as intended ATM. Trying to set a failurePolicy on a function that does not have one yet should trigger this warning or require --force. The idea behind this is that setting a failure policy can cause functions to be retired many times, which can be dangerous if your functions perform expensive operations or are not built to be idempotent.

@inlined
Copy link
Member

inlined commented Feb 16, 2021

Closing since this is WAI.

@inlined inlined closed this as completed Feb 16, 2021
@inlined
Copy link
Member

inlined commented Feb 16, 2021

Reopening for continued discussion. The claim that this is WAI suggested that we only require --force or a confirmation when first adding a failure policy to the function. The confirmation is actually happening every time a function with a failure policy is used. Will raise with the team.

@inlined inlined reopened this Feb 16, 2021
inlined added a commit to firebase/firebase-tools that referenced this issue Feb 22, 2021
Fixes firebase/firebase-functions#798

We can now conditionally list functions earlier in the deploy pipeline
if there are any functions with a failure policy in the current
set of functions to deploy. Silence the prompt if all functions with
failure policies already had failure policies.

Also modifies prepare.ts to avoid redndantly calling listallfunctions
later.
inlined added a commit to firebase/firebase-tools that referenced this issue Mar 3, 2021
* Only prompt for failurePolicies if they are new.

Fixes firebase/firebase-functions#798

We can now conditionally list functions earlier in the deploy pipeline
if there are any functions with a failure policy in the current
set of functions to deploy. Silence the prompt if all functions with
failure policies already had failure policies.

Also modifies prepare.ts to avoid redundantly calling listallfunctions
later.
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this issue Dec 14, 2021
* Only prompt for failurePolicies if they are new.

Fixes firebase/firebase-functions#798

We can now conditionally list functions earlier in the deploy pipeline
if there are any functions with a failure policy in the current
set of functions to deploy. Silence the prompt if all functions with
failure policies already had failure policies.

Also modifies prepare.ts to avoid redundantly calling listallfunctions
later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants