cold-mechanic-10814
05/12/2025, 1:13 PMyaml_file(
name="my_yaml",
source=http_source(
"<https://raw.githubusercontent.com/codefresh-io/yaml-examples/refs/heads/master/codefresh-build-1.yml>",
len=197,
sha256="4f0f073a576fc44d1ad670bf886fb24f394f63b6eabb7677eb197d427f5db7b0",
),
convert_to_json=True
)
json_file(
name="my_json",
source="codefresh-build-1.json",
dependencies=[":my_yaml"]
)
The yaml_file target works fine. The rule is of the form
@rule
async def generate_yaml_from_yaml_source(
request: GenerateYAMLSourcesRequest,
) -> GeneratedSources:
Where GenerateYAMLSourcesRequest is subclass of GenerateSourcesRequest.
It's when I try to trigger the generation for the json_file target that the issue occurs. The target is also backed by a rule based on a subclass of GenerateSourcesRequest , and in addition has code to resolve the dependencies and provide them as a snapshot during the generation. The code fails, seemingly before my rule is triggered, with the following error:
native_engine.IntrinsicError: Unmatched glob from src/python/libs/portland/connectors/my_connector:my_json's `source` field: "src/python/libs/portland/connectors/my_connector/codefresh-build-1.json"
What's the appropriate way to chain these codegen steps - with the caveat that the json_file target won't always be used in a chain, it should also be used independently.fast-nail-55400
05/12/2025, 4:00 PMsource field from the json_file target type?fast-nail-55400
05/12/2025, 4:00 PMfast-nail-55400
05/12/2025, 4:01 PMcodefresh-build-1.json in the repository, correct? If so, the "Unmatched glob" error makes sense since technically the source field didn't match a file in the repository.fast-nail-55400
05/12/2025, 4:02 PMGenerateSourcesRequest for the json_file target type?cold-mechanic-10814
05/12/2025, 8:37 PMcodefresh-build-1.json isn't materialized in the repository. It's an output of the yaml_file target.
The request looks like this:
class GenerateJSONFileSourceRequest(GenerateSourcesRequest):
input = JSONFileSourceField
output = FileSourceField
Where JSONFileSourceField is a subclass of AssetSourceField. I tried making it a subclass of FileSourceField, but pants threw an exception about ambiguous generation targetscold-mechanic-10814
05/14/2025, 1:52 PM