`Clusters::Applications` install and upgrade call stacks seem to be overcomplicated.
Currently our Clusters::Applications
installation and upgrade code stack feels a bit cumbersome and involves some code duplication and rabbit holes. Right now, there are the two long possible stack calls when we install or upgrade an application
Installation Stack
Clusters::ApplicationsController
-> Clusters::Applications::CreateService
-> Clusters::Applications::ScheduleInstallationService
-> ClusterInstallAppWorker
-> Clusters::Applications::InstallService
-> ClusterWaitForAppInstallationWorker
-> CheckInstallationProgressService
Upgrade Stack
Clusters::ApplicationsController
-> Clusters::Applications::CreateService
-> Clusters::Applications::ScheduleInstallationService
-> ClusterUpgradeAppWorker
-> Clusters::Applications::UpgradeService
-> ClusterWaitForAppInstallationWorker
-> CheckInstallationProgressService
Seems that it would be possible to reduce these call stacks by redesigning the code a little bit.
Concerns
- There's definitely a trade-off between the long chain and having isolated code which we can re-use. It's very much analogous to skinny controllers. We extract useful code to services so they can be easily re-used in other places. So we might want to re-extract in the future, which is going to be small waste of time consider the code is already isolated currently.