Allow complex depency flow by adding resource_deps to more functions
I have multiple services set up with multiple tilt files. For testing I sometimes run tilt files one by one, but to setup the whole cluster I want to be able to run all of them through a single Tiltfile, while still respecting decency flow.
The resources and resource_deps are perfect for this, however, they are only present on functions that create resources themselves (k8s, local, dc etc.), while for my use case I imagine I would need a resource_deps on the load_dynamic function.
Is there another way to go about dynamic and staged loading with multi Tiltfiles while still allowing them to be executed separately?
If not, I would like to propose adding resource_deps to other functions, such as load_dynamic
Have you seen https://docs.tilt.dev/multiple_repos.html? Maybe you can structure your sub-Tiltfiles so that each sets some constants that you can use in the main Tiltfile. For example, if you wanted to have a resource in the main Tiltfile that has all the resources in the sub Tiltfiles as dependencies, you could do something like
# frontend/Tiltfile
resources = ['frontend']
k8s_resource('frontend', ...)
# backend/Tiltfile
resources = ['backend']
k8s_resource('backend', ...)
# main Tiltfile
resources = []
frontend = load_dynamic('frontend/Tiltfile')
resources.extend(frontend['resources'])
backend = load_dynamic('backend/Tiltfile')
resources.extend(backend['resources'])
local_resource('main', 'echo All services ready', resource_deps=resources)