fast-school-44220
08/28/2025, 8:32 PMfast-school-44220
08/28/2025, 8:37 PMInject -> Infer for dependency detection. But I'm also having a problem that when I include my UnionRule(GenerateSourcesRequest, <my class>) the entire system seems to lose all of the rules for all of the union members and I get 48 rule graph errors about "No installed rules".fast-school-44220
08/28/2025, 8:38 PMUnionRule call that needs to be updated in the documentation?gorgeous-winter-99296
08/29/2025, 6:27 AMclass GenerateKubernetesFromKustomizeRequest(GenerateSourcesRequest):
input = KustomizeSourcesField
output = KubernetesSourceField
def rules():
return [
*collect_rules(),
UnionRule(GenerateSourcesRequest, GenerateKubernetesFromKustomizeRequest),
]
And then the rule itself is declared like this:
@rule
async def generate_kubernetes_from_kustomize(
request: GenerateKubernetesFromKustomizeRequest,
kustomize: KustomizeTool,
platform: Platform,
) -> GeneratedSources:
Which has also been unchanged for quite a while.gorgeous-winter-99296
08/29/2025, 6:30 AMfast-school-44220
08/29/2025, 6:14 PMgorgeous-winter-99296
08/29/2025, 6:30 PMKustomizeTool and all uses thereof in the function makes Pants work but it's not detected as a codegenable-target?fast-school-44220
08/29/2025, 6:31 PMgorgeous-winter-99296
08/29/2025, 6:47 PMfast-school-44220
08/29/2025, 6:49 PMfast-school-44220
08/29/2025, 7:06 PMgorgeous-winter-99296
08/29/2025, 7:09 PMfast-school-44220
08/29/2025, 7:09 PMgorgeous-winter-99296
08/29/2025, 7:10 PMfast-school-44220
08/29/2025, 7:12 PMfast-school-44220
08/29/2025, 7:14 PMgorgeous-winter-99296
08/29/2025, 7:14 PMgorgeous-winter-99296
08/29/2025, 7:14 PMfast-school-44220
08/29/2025, 7:16 PMProcess and that was fine, but I figured I need to switch over to a proper codegen setup to be able to chain my rules.gorgeous-winter-99296
08/29/2025, 7:21 PMfast-school-44220
08/29/2025, 7:24 PMfast-school-44220
08/29/2025, 7:27 PMgorgeous-winter-99296
08/29/2025, 7:31 PMexport-codegen goal in general is a gods-end for testing codegen rules, since you can validate in vitro if your rule worksgorgeous-winter-99296
08/29/2025, 7:32 PMfast-school-44220
08/29/2025, 7:35 PMexport-codegen. I was looking at that exact code yesterday... I wish there was a debug print of all_generate_request_types and inputs_to_outputs.fast-school-44220
08/29/2025, 7:36 PMreq.exportable. Is that something I need to set in my request class? Is it more involved than just adding exportable = True ? Because that didn't work. 🙂gorgeous-winter-99296
08/29/2025, 7:37 PMfd export_codegen_goal.py ~/.cache/nce/ - should be able to modify the code if you can figure out which file matches the pants you're using. Or just run pants from source.gorgeous-winter-99296
08/29/2025, 7:37 PMfast-school-44220
08/29/2025, 7:42 PMfast-school-44220
08/29/2025, 8:44 PMfast-school-44220
08/29/2025, 8:48 PMfast-school-44220
08/29/2025, 10:59 PM