Hey folks I have a design question about the `expe...
# general
r
Hey folks I have a design question about the
experimental-deploy
goal. I have two terraform modules, module A and module B. Module A deploys some infrastructure that module B depends on (in this case, a SSM parameter) I have set module A's
terraform_deployment
target as a dependency of module B's
terraform_deployment
target. When I run
pants experimental-deploy src/infra/module_b:deployment
I'm not sure whether I should expect module A to also deploy. Currently the behaviour in the terraform backend is not to deploy the dependency. I think I would prefer that it deploy the dependency instead, but that does mean that
experimental-deploy
is deploying beyond my original target selection.
Another related thought experiment: Say I want to write a smoke test that exercises some deployed infrastructure. I could have some
python_tests
depend on a
terraform_deployment
target. Should the
terraform_deployment
target be deployed when I run those tests? Packaged dependencies (eg. a
docker_image
) would be built today but that's a much safer action than a deploy.
I want to "fix" the terraform backend and have it do _the right thing_™️ I'm just not exactly sure what that is 😅
In case anything I've said re: experimental deploy is unclear, I have an example I made to reproduce the issue.
p
Deploying target and transitive dependencies:
pants dependents --closed --transitive src/infra/module_b:deployment | xargs pants experimental-deploy
In general, goals don't chain across dependencies, so the current behaviour is, arguably for
experimental-deploy
, the correct behaviour. Same for the test->deploy question.
Actually, many goals chain.
r
Thanks Rigel - I understand this could be worked around using xargs as you explained. As you mentioned though (and this is my main concern) many goals do chain, and it isn't clear to me what the intended user experience is for the deploy goal. Perhaps that could be made more clear through docs? Then it’d be easier for me to contribute a solution.