-
Notifications
You must be signed in to change notification settings - Fork 900
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
Fix: use 'functions' config if no 'functions:functionN' one found #1213
Conversation
Despite the fact that the docs don't cover this yet https://firebase.google.com/docs/cli/#the_firebasejson_file , looks like from v6.7.0 one might be able to config `firebase.json` a level deeper than a service (individual functions, in my case) so, that `firebase deploy --only functions:functionN` would consider that, but the problem is now the `functions` level config is ignored if I deploy specific functions (so no `lint`, no custom script, you might use). So please let's use 'functions' config if no 'functions:functionN' one found? It might be deeper than I managed to dig, but this fix works for me.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
I signed it! |
(@yzalvov I think you have to post |
@googlebot I signed it! |
I think that this should be fine. As it stands now you can only have lifecycle hooks for each resource or for the product overall. This is because the config will either be an object (if there is only a single resource) or an array (if there are many resources). Functions is a little bit weird in that you can deploy each one individually but the config is set up for the entire product (which is why I didn't realize that the lifecycle hooks would act strangely for it). Let me go find one of my old PRs for this repo where the googlebot didn't think I was part of the organization and see what I needed to say to it. |
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.
Wait, we should add a changelog entry. It should be something like fixed - Functions lifecycle hooks should trigger for individual deploys
You need to leave a comment with just |
I signed it! |
Arg, let me investigate the CLA stuff. |
Alright I figured out the CLA problem, the commit has
|
Despite the fact that the docs don't cover this yet #the_firebasejson_file, looks like from v6.7.0 one might be able to config
firebase.json
a level deeper than for a service (individual functions, in my case) so thatfirebase deploy --only functions:functionN
would consider that, but the problem is now thefunctions
level config is ignored if I deploy specific functions (so nolint
, no custom scripts).So please let's use 'functions' config if no 'functions:functionN' one found? It might be deeper than I managed to dig, but this fix works for me.
Description
Bug:
firebase.json
functions
config is ignored if specific functions are deployed.Scenarios Tested
Before the fix:
After the fix: