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
Deleting in non-interactive mode is not possible #877
Comments
Hi, this is intentional behavior, since we got a lot of feedback that users did not like how the CLI automatically deleted their functions. So now we require user confirmation for deletions, which cannot be done in non-interactive. This is why the release was a major version bump, to indicate a breaking change in behavior. |
@laurenzlong could a flag be added to allow deletions in non-interactive mode? Deleting functions by hand in CLI for us is way less safe and inconvenient versus a good review/merge policy + CI deployments |
Could you expand on your rationale a bit more? Are you deleting functions often during CI? |
Sure: We're constantly refactoring old functions and often replacing (swapping https onRequest for onCall for example). It's easier for us to delete the old function and add a new one. Sometimes we simply aren't using the function anymore, and want it gone. I can understand why the default would be not to delete, but we're suprised it's not possible/blocked in non-interactive mode, assuming most people in that mode are thoroughly reviewing before deploying like we are? |
Thanks for the feedback Alan, I'll open up the discussion internally about this. |
Thanks Lauren 🙌 |
We have exactly the same issue. It would help as a lot as well. We had to give up our automated deployments using Google Cloud Builder because of the update. |
Not sure if anyone suggested it already. This is not always the option everyone want's to have. For example, if someone created a new function in a feature branch and deployed it using And then someone tries to deploy a new version, then our CI pipeline would start and call the command I see the benefit of a flag to get back the old behaviour, so both behaviours would be great to have in my opinion. |
Same here. Because we have lots of triggers and often times we need to move user database from prod to dev project for investigation and troubleshooting we need a way to disable all the triggers during json import. If there is a way to disable triggers in a more friendly way with the updated CLI I would much appreciate any input on how to achieve that. Otherwise removing functions from CLI in a batch is still something we rely on. |
@laurenzlong is this being addressed? |
We will be adding an option to force deletes of missing functions soon.
We've heard the feedback, hopefully this helps. The default behavior will
remain the same.
…On Fri, Oct 12, 2018, 5:06 AM Solomon Engel ***@***.*** wrote:
@laurenzlong <https://github.com/laurenzlong> is this being addressed?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#877 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAD_npvEeL-UEG_Q5YNtNylQCi_9hKKks5ukIWtgaJpZM4WCBfg>
.
|
@mbleigh Is there any option to not delete any function when I run For example, if I have 2 separate repositories with totally different functions which all deploy to the same Functions project. So e.g.:
Now if I run Is this possible? |
@IchordeDionysos that is not possible, as far as I'm aware. During the deploy process, the functions are inspected to figure out what needs to be removed and what needs to be added. If one is "missing" from the code, the CLI will attempt to delete it. |
Is this #999 something you are considering? :) |
I just put a note on that PR. While it's a good idea, there's a bit more internal process that has to happen to add a flag like this. I wouldn't expect something to happen in a number of days, but know that it's on our radar. |
@IchordeDionysos In the meantime, is it possible for you to use |
For us the issue is resolved. We're able to deploy via Google Cloud Builder again. |
…base-tools#877 see the github thread for more context: firebase/firebase-tools#877
Here's the "hack" that we are using to only upsert function (not delete others): echo "n\n" | firebase deploy --only functions --interactive --token $FIREBASE_TOKEN Would also appreciate having and explicit option such as |
Another "hack" alternative is to explicitly pass all function names after reading them from the index.ts
|
In some cases, using cloud function groups may be enough to ignore other functions. For example, In your root index.js file, you would export your groups: // metrics.js and accounts.js export multiple functions
exports.metrics = require('./metrics');
exports.accounts = require('./accounts');
... And the deploy command for the firebase deploy --only functions:metrics And when using the above deploy command with the |
Still no way to confirm in any case in non-interactive mode? A
|
I wanted to deploy through the cloud build. pachage.json{
...
"scripts"{
"deploy:staging": "firebase use staging && echo \"n\n\" | firebase deploy --only functions --interactive",
...
},
} cloudbuild.yamlsteps:
- id: Install packages
name: 'gcr.io/cloud-builders/npm'
args: ['install']
- id: Build firebase functions
name: 'gcr.io/cloud-builders/npm'
args: ['run', 'build']
- id: Deploy to firebase functions
name: 'gcr.io/cloud-builders/npm'
args: ['run', 'deploy:staging'] I hope to help someone. |
@Retsuki Do you have firebase tools as a dependency? It would really be nice to just have an ignore flag for this 😐 |
Version info
"firebase-tools": "4.1.1"
Platform Information
OS X and Bitbucket Pipelines CI
Steps to reproduce
In Bitbucket pipelines CI, using non-interactive mode with env variables
firebase use myproject
firebase deploy
with 5 functions in index.jsIn a later PR
firebase deploy
with just 4 functions in index.jsExpected behavior
Actual behavior
Error: The following functions are found in your project but do not exist in your local source code:
... list of functions ...
Aborting because deletion cannot proceed in non-interactive mode. To fix, manually delete the functions by running:
The text was updated successfully, but these errors were encountered: