-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EventTransform API types #8447
Conversation
Signed-off-by: Pierangelo Di Pilato <[email protected]>
Signed-off-by: Pierangelo Di Pilato <[email protected]>
Signed-off-by: Pierangelo Di Pilato <[email protected]>
b5c208c
to
56f404a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8447 +/- ##
==========================================
- Coverage 64.10% 63.92% -0.18%
==========================================
Files 388 391 +3
Lines 23363 23498 +135
==========================================
+ Hits 14976 15021 +45
- Misses 7591 7677 +86
- Partials 796 800 +4 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Pierangelo Di Pilato <[email protected]>
/test unit-tests |
/test reconciler-tests |
1 similar comment
/test reconciler-tests |
|
||
func (js *JsonataEventTransformationSpec) Validate(context.Context) *apis.FieldError { | ||
// Jsonata parsers for Go are not maintained, therefore, we will not parse the expression here. | ||
// The downside is that the errors will only be present in the status of the EventTransform resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not the end of the world, if reflected broken expressions via "runtime errors" propagated to the status of the thing
"source": source, | ||
"reason": data.reason, | ||
"message": data.message, | ||
"data": $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has the $
a special meaning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, $
is basically the input / root node
{"hello": "Matthias"}
with transformation {"data": $ }
results in {"data": {"hello": "Matthias"} }
See for example: https://try.jsonata.org/quwrKXzni
For the same input:
{"data": $.hello, "data2": hello, "full": $ }
returns
{
"data": "Matthias",
"data2": "Matthias",
"full": {
"hello": "Matthias"
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matzew, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Event transformations are essential to connect different systems, with the EventTransform we will support this use cases where a generic and declarative event transformation can be used and we would not require custom code to do that.
The API can be used in different places, between a source/webhook and a broker, between a broker and a sink or even leverage the built-in Trigger transformation feature with response.
Related to:
We would also solve use cases like this https://cloud-native.slack.com/archives/C06AH2C3K8B/p1731786548587349 where a sink is OpenAI compatible LLM endpoint without writing custom code.
First commit is the main commit, rest is codegen and fixes
Proposed Changes
Pre-review Checklist
Release Note
Docs