Component
Backend / Git integration (repository import)
Infrahub version
1.9.6
Current Behavior
During repository (git) import, objects/ are imported before the .infrahub.yml python_transforms are registered. An object that references a CoreTransformPython defined in the same repository therefore fails to resolve. For example, a CoreCustomWebhook with transformation: "MyTransform" aborts the import with:
Unable to find the node MyTransform / CoreTransformPython in the database.
The whole repository import aborts and the repository goes to sync_status: error-import. Because the failure happens during object import, the transforms/checks/generators are never registered either, so a retry can't converge.
The order is fixed in backend/infrahub/git/integrator.py (import_all, ~lines 201–216):
import_schema_files
import_all_graphql_query
import_objects ← objects referencing a CoreTransformPython fail here
import_all_python_files → import_python_transforms (transforms registered here)
So any object referencing a repo-defined Python artifact (transforms, and presumably checks/generators registered in step 4) cannot be imported.
Expected Behavior
Either objects that reference repo-defined Python artifacts should resolve (e.g. register Python files before importing objects, or resolve such references in a dependency-aware / two-pass manner); or, at minimum, the importer should emit a clear, actionable error naming the offending object file and the unresolved transform, instead of a generic "Unable to find the node …" that aborts the entire import.
Steps to Reproduce
-
Define a transform in .infrahub.yml:
python_transforms:
- name: MyTransform
class_name: MyTransform
file_path: transforms/my_transform.py
-
Add an object file (e.g. objects/00_webhooks.yml) referencing it:
apiVersion: infrahub.app/v1
kind: Object
spec:
kind: CoreCustomWebhook
data:
- name: my-webhook
event_type: infrahub.node.created
node_kind: SomeNode
url: https://example.com/webhook
transformation: "MyTransform"
-
Add the repository to Infrahub and let it sync.
-
Observe sync_status: error-import with "Unable to find the node MyTransform / CoreTransformPython in the database." No transforms or webhooks are created.
Additional Information
Component
Backend / Git integration (repository import)
Infrahub version
1.9.6
Current Behavior
During repository (git) import,
objects/are imported before the.infrahub.ymlpython_transformsare registered. An object that references aCoreTransformPythondefined in the same repository therefore fails to resolve. For example, aCoreCustomWebhookwithtransformation: "MyTransform"aborts the import with:The whole repository import aborts and the repository goes to
sync_status: error-import. Because the failure happens during object import, the transforms/checks/generators are never registered either, so a retry can't converge.The order is fixed in
backend/infrahub/git/integrator.py(import_all, ~lines 201–216):import_schema_filesimport_all_graphql_queryimport_objects← objects referencing aCoreTransformPythonfail hereimport_all_python_files→import_python_transforms(transforms registered here)So any object referencing a repo-defined Python artifact (transforms, and presumably checks/generators registered in step 4) cannot be imported.
Expected Behavior
Either objects that reference repo-defined Python artifacts should resolve (e.g. register Python files before importing objects, or resolve such references in a dependency-aware / two-pass manner); or, at minimum, the importer should emit a clear, actionable error naming the offending object file and the unresolved transform, instead of a generic "Unable to find the node …" that aborts the entire import.
Steps to Reproduce
Define a transform in
.infrahub.yml:Add an object file (e.g.
objects/00_webhooks.yml) referencing it:Add the repository to Infrahub and let it sync.
Observe
sync_status: error-importwith "Unable to find the node MyTransform / CoreTransformPython in the database." No transforms or webhooks are created.Additional Information
infrahub-testcontainers(Infrahub server 1.9.6) on macOS arm64.transformationlink.