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

Running validation for events on broker ingress #5275

Merged
merged 2 commits into from
Apr 20, 2021

Conversation

matzew
Copy link
Member

@matzew matzew commented Apr 19, 2021

Signed-off-by: Matthias Wessendorf mwessend@redhat.com

Fixes #5143

Proposed Changes

  • running validation of the extracted cloudevent.

Release Note

Runnng validation for event ingress on mt broker 

Docs

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 19, 2021
@knative-prow-robot knative-prow-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 19, 2021
@matzew
Copy link
Member Author

matzew commented Apr 19, 2021

/assign @vaikas

Not sure if the CloudEvent SDK itself should kinda to that (or similar) inside it's ToEventing bindings

@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #5275 (b6fa77b) into main (31cda4c) will decrease coverage by 0.04%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5275      +/-   ##
==========================================
- Coverage   83.63%   83.58%   -0.05%     
==========================================
  Files         243      243              
  Lines        6879     6884       +5     
==========================================
+ Hits         5753     5754       +1     
- Misses        783      786       +3     
- Partials      343      344       +1     
Impacted Files Coverage Δ
pkg/broker/ingress/ingress_handler.go 75.75% <20.00%> (-2.97%) ⬇️

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 31cda4c...b6fa77b. Read the comment docs.

@@ -132,6 +132,14 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
return
}

// run validation for the extracted event
validationErr := event.Validate()
if validationErr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test for this change.

@n3wscott
Copy link
Contributor

/hold

Please make pkg/broker/ingress/ingress_handler.go code coverage get to 80% or more.

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 19, 2021
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
@matzew matzew force-pushed the run_event_validation_ingress branch from 39217ef to 8c1efef Compare April 20, 2021 08:31
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
@knative-prow-robot knative-prow-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 20, 2021
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/broker/ingress/ingress_handler.go 89.0% 86.2% -2.8

@n3wscott
Copy link
Contributor

/unhold
/lgtm
/approve

Thanks for the test!

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 20, 2021
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n3wscott

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 Apr 20, 2021
@n3wscott
Copy link
Contributor

/retest

@knative-prow-robot knative-prow-robot merged commit 5855490 into knative:main Apr 20, 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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broker accepts malformed events.
5 participants