-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure FirstPartyHelmDeploymentMapping doesn't get calculated if disabled #21633
Make sure FirstPartyHelmDeploymentMapping doesn't get calculated if disabled #21633
Conversation
c5d97e9
to
c11db1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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... :) |
If this test existed, it wouldn't have caught this problem, because it wouldn't have tested that we don't calculate FirstPartyHelmDeploymentMapping |
I can explain how I noticed there is an issue. I ran this
and got the error
This indirectly means that pants is trying to build FirstPartyHelmDeploymentMapping. I could add the test that sets |
That works for me. |
Done: b8b3d83 PS Notes are probably not required, because there is already a note about the option: Line 190 in b399758
|
I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants. ✔️ 2.23.xSuccessfully opened #21635. Thanks again for your contributions! |
…isabled (pantsbuild#21633) Option `[helm-infer].deployment_dependencies` was added in pantsbuild#21282. Unfortunately, I missed one place where `FirstPartyHelmDeploymentMapping` is requested: ```python @rule(desc="Prepare Helm deployment post-renderer", level=LogLevel.DEBUG) async def prepare_post_renderer_for_helm_deployment( request: HelmDeploymentPostRendererRequest, union_membership: UnionMembership, docker_options: DockerOptions, ) -> SetupHelmPostRenderer: mapping = await Get( FirstPartyHelmDeploymentMapping, FirstPartyHelmDeploymentMappingRequest(request.field_set) ) ... ``` Here I move this logic inside the rule, so that all consumers correctly handle the case when `[helm-infer].deployment_dependencies` is set to `false`
…isabled (Cherry-pick of #21633) (#21635) Option `[helm-infer].deployment_dependencies` was added in #21282. Unfortunately, I missed one place where `FirstPartyHelmDeploymentMapping` is requested: ```python @rule(desc="Prepare Helm deployment post-renderer", level=LogLevel.DEBUG) async def prepare_post_renderer_for_helm_deployment( request: HelmDeploymentPostRendererRequest, union_membership: UnionMembership, docker_options: DockerOptions, ) -> SetupHelmPostRenderer: mapping = await Get( FirstPartyHelmDeploymentMapping, FirstPartyHelmDeploymentMappingRequest(request.field_set) ) ... ``` Here I move this logic inside the rule, so that all consumers correctly handle the case when `[helm-infer].deployment_dependencies` is set to `false` Co-authored-by: Gregory Borodin <grihabor@gmail.com>
…isabled (Cherry-pick of #21633) (#21636) Option `[helm-infer].deployment_dependencies` was added in #21282. Unfortunately, I missed one place where `FirstPartyHelmDeploymentMapping` is requested: ```python @rule(desc="Prepare Helm deployment post-renderer", level=LogLevel.DEBUG) async def prepare_post_renderer_for_helm_deployment( request: HelmDeploymentPostRendererRequest, union_membership: UnionMembership, docker_options: DockerOptions, ) -> SetupHelmPostRenderer: mapping = await Get( FirstPartyHelmDeploymentMapping, FirstPartyHelmDeploymentMappingRequest(request.field_set) ) ... ``` Here I move this logic inside the rule, so that all consumers correctly handle the case when `[helm-infer].deployment_dependencies` is set to `false` Co-authored-by: Gregory Borodin <grihabor@gmail.com>
Option
[helm-infer].deployment_dependencies
was added in #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