Skip to content
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

[release-0.25] Properly handle events without the data field (#1460) #1503

Conversation

knative-prow-robot
Copy link
Contributor

This is an automated cherry-pick of #1502

Properly handle events without the `data` field.

)

A valid CloudEvent in the CE binary protocol binding of Kafka
might be composed by only Headers.

KafkaConsumer doesn't call the deserializer if the value
is null.

That means that we get a record with a null value even though
the record is a valid CloudEvent.

This patch handles events without the data field properly
by creating the CloudEvent object from record headers, if
the above conditions apply.

Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
@knative-prow-robot knative-prow-robot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 17, 2021
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/data-plane labels Nov 17, 2021
@pierDipi pierDipi changed the title [release-0.25] [release-0.26] Properly handle events without the data field (#1460) [release-0.25] Properly handle events without the data field (#1460) Nov 17, 2021
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2021
@knative-prow-robot
Copy link
Contributor Author

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knative-prow-robot, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2021
@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

❗ No coverage uploaded for pull request base (release-0.25@54532d7). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             release-0.25    #1503   +/-   ##
===============================================
  Coverage                ?   75.67%           
  Complexity              ?      458           
===============================================
  Files                   ?       86           
  Lines                   ?     3009           
  Branches                ?      131           
===============================================
  Hits                    ?     2277           
  Misses                  ?      567           
  Partials                ?      165           
Flag Coverage Δ
java-unittests 79.86% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54532d7...6b33b2a. Read the comment docs.

@knative-prow-robot knative-prow-robot merged commit bba0994 into knative-extensions:release-0.25 Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/data-plane cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants