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
Adds deploy --ignore-existing-functions command. #999
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I read it correctly that you cannot ignore existing functions in non interactive calls?
No, if you run |
But you will be able to delete deployed functions that don't exist in the new source code in non interactive mode? |
Yes, exactly if you run To clarify what you can do in the interactive and non-interactive mode when the deployment script detects missing functions in the local source code: Interactive mode:
Non-Interactive mode:
The third option in non-interactive mode is new in this pull request which now allows the same options as in interactive mode |
Thank you for the PR. Know this is on our radar, but adding flags has a bit more internal process required than you might expect. We'll keep this updated if this is something with which we want to move forward. |
@IchordeDionysos So, an initial conversation brought up this point. If you only want specific functions to be deployed (and others left alone), the solution that currently exists to do that is |
@bkendall Well if you have a lot of functions, you want to deploy at once this is not an ideal solution :) |
@IchordeDionysos For us everything works now! Thanks for adjusting the cli! |
I agree with @IchordeDionysos . |
Is there any progress? I hope this PR is merged. |
It's being discussed internally. I may have an update soon, but I can't make any promises (changing APIs, including our CLI flags, requires some internal review) |
I just found this after I made a similar feature request, just wanted to drop in and say this would also greatly help our process, hopefully it gets accepted! :) |
Hey, Especially as from my perspective there is no good abstraction of this flag which would work in different cases and commands (like |
Are there any updates or workarounds for this issue? We’d like to deploy some non-Firebase functions in the same project through Cloud Build, and would need to protect non-Firebase functions from being deleted by |
@dinvlad the Firebase CLI should ignore any functions that weren't deployed by the Firebase CLI, so you don't need |
@mbleigh If this is the case (for the use case of @dinvlad and ours), then here is a script detailing the exact bug in the Firebase CLI: Just run it and follow the instructions and it'll guide you through what the exact problem here is. |
The problem is in non-interactive mode there is absolutely NO way of telling the CLI for calling You can only let them get deleted. For us, it would be totally okay to NOT have this flag but to alter the default behavior in non-interactive mode from the deploy failing to just ignore functions which are not found in the local source code as it was the case before #877 even became a problem. 😄 |
Could you clarify, does that apply only to interactive mode? Because our use case is non-interactive (Cloud Build). |
It applies to both -- we leave functions deployed by other tools alone. Are
you seeing otherwise?
…On Thu, Jul 18, 2019, 6:36 AM Denis Loginov ***@***.***> wrote:
the Firebase CLI should ignore any functions that weren't deployed by the
Firebase CLI
Could you clarify, does that apply only to interactive mode? Because our
use case is non-interactive (Cloud Build).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#999?email_source=notifications&email_token=AAAAH7RMBPU2DPF27TXMR4DQABWXRA5CNFSM4GB5PPZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2IP5PY#issuecomment-512818879>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAAH7VALBCSYLKHTRLH5NLQABWXRANCNFSM4GB5PPZA>
.
|
@mbleigh thanks, I wasn’t aware of that. firebase-tools/src/deploymentTool.js Line 22 in dad143c
|
What is the status of this PR? |
I kinda have an update: having a "product-specific flag" ( |
What about |
This has been open for almost 2 years now, this is important for good CI, when can we expect a fix? |
Still waiting for this. I have to codebases keep overwriting each other. One is an Angular project and it auto-generates a server-side renderer function and deploys. The second one has all API functions, auth and database triggers, schedules etc. |
Any updates? |
Would love to see this be implemented to solve the use cases already covered above. |
I would love it also |
So... is this ever going to happen? |
Hey team, it would be great to have this merge however is there a workaround that we can use in the meantime? |
It looks like this is stale; it still refers to src/deploy/functions/release.js even though that code has been rewritten. I'm not against this change, though I'll have to run the new flag through an API proposal process internally. We don't typically perform releases near a holiday, so there's a chance this will drag on into early in the new year. |
I haven't put in any work in to refactor it as there was never any conclusion from the internal design review! So it would only make sense to refactor this if the design would be approved! The missing flag actually forced us to setup some complicated deployments for it to work with out workflow. |
Sounds good. FWIW, my design proposal differed a bit from your implementation. I allowed The early feedback was that it feels wrong to have a functions-specific flag on |
I agree with you for production code. But this flag would be very helpful for our development environment. Because when multiple developers are working on different features in different branches, they all have different cloud functions (related to the new features). If a developer wants to test the cloud function, he deploys the cloud function from his feature branch to the development environment. When now another PR got merged, triggers this our CI/CD pipeline which deploys all cloud function. This deletes the deployed cloud function from the feature branch (with the In terms of a staging or production environment, I agree with you. There would be this new flag a bad pattern. |
I am trying to not delete functions that are already deployed when i deploy using bitbucket pipeline I have the following:
I am receiving the following error
is ignore-existing-functions actually an option? Can anyone see what is wrong. |
@h11a My workaround to deploy functions and keep the existing functions, which are not included in the source code, is to use this command: echo \"n\n\" | firebase deploy --only functions --interactive |
Thanks! ended up having to install firebase-tools and run the command explicitly but its working well :) |
Update: there's some pushback against having product-specific flags in |
Crazy that this still remains unaddressed. |
Sorry, we should actually have updated this thread. We're not going to add "Codebases" let you keep multiple directories or even repositories of your functions code. With this, you can deploy a single codebase at a time and the other functions which aren't part of that codebase won't be updated (or deleted). To enable codebases, add a fragment similar to the following to your firebase.json
With this feature, you can say In the future, we will recognize that no functions in a codebase have been modified and skip their deployment entirely and the UX in our website will group functions by codebase. |
I would like to remind of and ask you to follow our community guidelines for respectful communication. The firebase CLI is a very large project and it was decided that adding one-off per-feature flags to I'm really proud of the team and don't appreciate them being called a failure. |
Hey @inlined,
I personally maintain two separate codebases for Python and Node.js based Firebase functions. However, every time I deploy either of them, I am prompted to delete the other codebase. For instance, let's say you have two codebases, in which you have two functions: I don't think this is niche use case and as time goes on python for firebase functions is going to get more and more popular. |
It sounds like you have the same codebase name for your node and python functions. If you have two different firebase.json and they have two codebases and they have separate names, then |
Description
Addressing second use case mentioned in #877.
Scenarios Tested
firebase deploy --ignore-existing-functions
worked and produced this output:...
i functions: updating Node.js 6 function someFunction(us-central1)...
i functions: continuing with other deployments.
✔ functions[someFunction(us-central1)]: Successful update operation.
...
firebase deploy --force --ignore-existing-functions
which errored out as expected:Error:
You can not specify both --force and --ignore-existing-functions
Sample Commands
When there are functions missing in the current working directory the deploy command asks the user how to continue.
Either delete the missing functions OR to just ignore them.
With the Pull Request #949 only the first case was covered.
Because if you specify --non-interactive the command errors out.
Now adding the command
--ignore-existing-functions
you can explicitly tellfirebase deploy
to "continuing with other deployments." as it is possible in interactive mode.firebase deploy --force
delete existing functionsfirebase deploy --ignore-existing-functions
keep existing functions