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
Fixing multi resource lifecycle hooks #1130
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.
Can some unit tests be written for this functionality? Looks to me as if you could create some fake options with some echo
statements that would succeed. Or maybe it could return a representation of the commands run that would be able to be verified? I'll leave it to you, but I think some tests here might be worth while.
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.
I understand @bkendall's encouragement to add tests, but I won't block on them here...I'd like to get this released and scaffolding deploy tests will take a non-trivial amount of time I imagine. If you somehow find time, lovely 😄
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.
LGTM from me - comment from Michael to look at still...
Gave some tests a quick shot, both unit tests for just the lifecycle file and an integration test. I suspect creating meaningful tests are going to be quite a bit of work, and making them understandable and not brittle is going to require a fair amount of refactoring of how deploys are handled. |
Description
Fixing lifecycle hooks for Multi-Site deploys as found by this issue. Essentially the lifecycle hooks only deal with the top level object and were never changed to deal with an array of configs. I tried to make this generic so that it'll be usable by other mutli resource deploys (which I don't think exist but RTDB could and we could technically do it for individual functions).
Scenarios Tested
Verified both single Site deploy and Multi-Site deploys. Also made sure that it worked if
predeploy
orpostdeploy
was an array or a single string.Sample Commands
Everything used
firebase deploy --only hosting
but single Site deploy had afirebase.json
of:Multi-Site deploy had a
firebase.json
of: