-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
state/need-triageThis issue needs to be triagedThis issue needs to be triagedtype/featureNew feature or requestNew feature or request
Description
Component
infrahubctl CLI
Describe the Feature Request
Testing transforms that are used with webhooks is currently impractical because the data structure passed to the transform differs significantly between testing and production execution.
Describe the Use Case
When testing with infrahubctl transform:
- The transform's query attribute is executed via GraphQL
- The transform receives query results (structured as GraphQL response data)
When running in production (webhook triggered):
- The transform's query attribute is required but completely ignored
- The transform receives event payload data directly with structure:
{
"data": {"kind": "...", "action": "...", "node_id": "..."},
"id": "event-uuid",
"event": "infrahub.node.updated",
"branch": None,
"account_id": "account-uuid",
"occured_at": "2025-03-13T16:31:14.566032+00:00"
}
Why This Is a Problem
- Data structure mismatch: A transform that works correctly in testing will
fail in production because it expects query-structured data but receives
event-structured data - No way to test with event data: There's no CLI command or testing mechanism
to pass mock event payloads to a transform - Confusing API: The query attribute is required on webhook transforms but
serves no purpose - False confidence: Passing tests don't guarantee the transform will work
when triggered by actual webhooks
Additional Information
No response
Metadata
Metadata
Assignees
Labels
state/need-triageThis issue needs to be triagedThis issue needs to be triagedtype/featureNew feature or requestNew feature or request