0
votes

When rolling back a Firebase Hosting deploy, is it possible to also roll back Firebase Functions to the state they were in as of the target Hosting rollback?

If not, is there some way to manually roll back functions?

I have not seen a way to do so in the documentation, but I'm hoping I've missed something, since this would be a nice way to ensure interoperability between functions and hosting in a rollback. https://firebase.google.com/docs/cli#roll_back_deploys

There's also this related question How to atomically update and roll back a Firebase Hosting site + Cloud Run service? , but it's about Firebase Hosting and Google Cloud Run.

1
The answer is the same as for the question you linked: there is no cross-product transactional rollback. The easiest way (and frankly: only one I know of) to roll back Cloud Functions is to deploy the previous version of the code.Frank van Puffelen
@FrankvanPuffelen Understood, thanks for answering. That might be worth noting at the linked spot documentation.ultraGentle

1 Answers

2
votes

Per Frank van Puffelen's comment, this can't be done in a single action. Instead of rolling back functions, you must re-deploy the version that was active during your hosting-rollback target.

So, if joint rollbacks are something you anticipate needing, it might be worth redeploying functions every time you deploy hosting. That way, if a joint rollback is ever needed, you can simply look for the matching date function deploy, rather than having to dig through various function versions in version control.