Your question is Automate a Common Deployment Task. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Nielsen ONE deployments may contain services that depend on other services being deployed first. Given a set of services and prerequisite relationships, generate the deployment waves that respect every dependency while allowing independent services to deploy together.
A dependency [service, prerequisite] means the prerequisite must appear in an earlier wave than the service. Within each wave, return service names in lexicographic order. Return an empty list if the dependencies contain a cycle, because no valid deployment plan exists.
Implement deploy_waves(services, dependencies).
services is a list of unique strings.dependencies is a list of two-element lists, each containing a service and one of its prerequisites.def deploy_waves(services, dependencies):