Closed grihabor closed 1 week ago
Would this option benefit from a test of any sort?
I'm not sure if there is a good test that can check that we're not doing inference, but I can add one if you suggest how it should work exactly
I'm not sure if there is a good test that can check that we're not doing inference, but I can add one if you suggest how it should work exactly
Isn't this the exact same test as for doing inference, except that you the dependency shouldn't exist..?
The reason why I'm asking for a test is primarily because this PR fixes a regression. And I generally want tests for regressions since they are failure modes which actually occurred.
The operative question in my view: How do we know that this PR in fact fixed the regression?
How did you account for tracking down all relevant call sites?
A test can provide proof. Or some additional narrative context on testing methodology could be fine as well.
@grihabor Are you able to add a test and get this merged today? It is past time to get 2.23.0 out... :)
Isn't this the exact same test as for doing inference, except that you the dependency shouldn't exist..?
If this test existed, it wouldn't have caught this problem, because it wouldn't have tested that we don't calculate FirstPartyHelmDeploymentMapping
The operative question in my view: How do we know that this PR in fact fixed the regression?
I can explain how I noticed there is an issue. I ran this
$ pants experimental-deploy --no-experimental-deploy-publish-dependencies --dry-run :my-deployment
and got the error
UnownedDependencyError: Error resolving Docker image dependency of a Helm chart.
`my-image:0.1.0` was supplied, but Pants cannot determine
whether this should be a target's address or a 3rd-party dependency.
If this should be an external image, add `my-image:0.1.0` to `[helm-infer].external_docker_images`
If this should be a target address, use an absolute path instead (possibly `//my-image:0.1.0`).
This indirectly means that pants is trying to build FirstPartyHelmDeploymentMapping.
I could add the test that sets [helm-infer].unowned_dependency_behavior = "error"
and [helm-infer].deployment_dependencies = false
and makes sure there is no error, sounds good?
I could add the test that sets [helm-infer].unowned_dependency_behavior = "error" and [helm-infer].deployment_dependencies = false and makes sure there is no error, sounds good?
That works for me.
Done: https://github.com/pantsbuild/pants/pull/21633/commits/b8b3d834c37adffc354243965f660e37838520ca
PS Notes are probably not required, because there is already a note about the option: https://github.com/pantsbuild/pants/blob/b399758ce2c19027247c00ab29b15f8d9a042177/docs/notes/2.23.x.md?plain=1#L190
I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants.
Successfully opened https://github.com/pantsbuild/pants/pull/21635.
Thanks again for your contributions!
:robot: Beep Boop here's my run link
Option
[helm-infer].deployment_dependencies
was added in https://github.com/pantsbuild/pants/pull/21282. Unfortunately, I missed one place whereFirstPartyHelmDeploymentMapping
is requested:Here I move this logic inside the rule, so that all consumers correctly handle the case when
[helm-infer].deployment_dependencies
is set tofalse