pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.34k stars 638 forks source link

Make sure FirstPartyHelmDeploymentMapping doesn't get calculated if disabled (Cherry-pick of #21633) #21636

Closed tdyas closed 1 week ago

tdyas commented 1 week ago

Option [helm-infer].deployment_dependencies was added in https://github.com/pantsbuild/pants/pull/21282. Unfortunately, I missed one place where FirstPartyHelmDeploymentMapping is requested:

@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

tdyas commented 1 week ago

This PR did not automatically cherry pick to the 2.24.x branch because the 2.24.x milestone had not been created yet (it is now).

tdyas commented 1 week ago

cc @grihabor

grihabor commented 1 week ago

shall we merge it now?

tdyas commented 1 week ago

shall we merge it now?

I can't because it still needs a maintainer to approve.