-
Notifications
You must be signed in to change notification settings - Fork 120
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 kafka ce extensions for partition and offset #3464
Add kafka ce extensions for partition and offset #3464
Conversation
Skipping CI for Draft Pull Request. |
/test all |
@matzew @pierDipi it looks like a lot of tests are failing because they don't expect the event to have the two new extensions I've added. Since the issue doesn't specify that this needs to be an CE extension, I'm wondering - should I switch my implementation to just set a header (and not a CE extension)? I personally think the CE extension approach is better since it will let users write filters for different conditions if they want to on their triggers. However, I'd rather check first before I fix all the tests :) |
@Cali0707 the spec says this https://github.com/knative/specs/blob/main/specs/eventing/data-plane.md#event-acknowledgement-and-delivery-retry:
so tests should not fail when attributes are added |
Also we can ask the author of the issue to give us feedback as the exit criteria on the issue may be ambiguous as we're using binary content mode to send events over HTTP, so CE attributes are headers
|
I think the issue is the tests are expecting a specific cloud event currently, which we aren't matching? For example:
Should I be fixing these @pierDipi ? |
well:
when we add those to each request, I guess we either need to check they are there, or ignore them (being more lenient on extra headers, which may have a downside) |
Signed-off-by: Calum Murray <cmurray@redhat.com>
3208d66
to
8381272
Compare
/test all |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3464 +/- ##
============================================
- Coverage 62.30% 62.24% -0.06%
- Complexity 843 844 +1
============================================
Files 186 186
Lines 12588 12579 -9
Branches 272 272
============================================
- Hits 7843 7830 -13
- Misses 4133 4136 +3
- Partials 612 613 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Calum Murray <cmurray@redhat.com>
/test all |
Signed-off-by: Calum Murray <cmurray@redhat.com>
/test reconciler-tests |
builder.withExtension("knativekafkapartition", partition); | ||
builder.withExtension("knativekafkaoffset", offset); |
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.
can we make those private static final String
?
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 understand the prefix of knative... but wondering if the actual upstream/spec, would want to say something on the metadata in https://github.com/cloudevents/spec/blob/main/cloudevents/bindings/kafka-protocol-binding.md ?
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 didn't see anything in particular while reading the docs there, I'll ask at the serverless WG meeting tomorrow
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.
From today's cloudevents call, we should use our own attribute names prefixed by knative
and then document those in our repo
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.
that's fair and thanks for raising this
@@ -172,7 +172,7 @@ func assertExpectedRoutedEvents(prober *eventshub.EventProber, expected map[stri | |||
if len(want) != 0 && len(got) != 0 { | |||
// ID is adjusted by eventshub. | |||
except := []cmp.Option{ | |||
cmpopts.IgnoreFields(conformanceevent.ContextAttributes{}, "ID"), | |||
cmpopts.IgnoreFields(conformanceevent.ContextAttributes{}, "ID", "Extensions"), |
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.
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
/cc @pierDipi |
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
/retest |
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: Cali0707, 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 |
@pierDipi do you think this needs a corresponding docs update? |
/retest |
1 similar comment
/retest |
Signed-off-by: Calum Murray <cmurray@redhat.com>
/retest |
/lgtm |
/retest-required |
/retest |
Fixes #3072
Proposed Changes
Release Note
Docs