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

Handle CESQL parsing panics gracefully #6140

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

devguyio
Copy link
Contributor

@devguyio devguyio commented Feb 7, 2022

Proposed Changes

  • 🐛 If parsing the CE SQL expression panics, treat it as an invalid expression.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

When the `new-trigger-filters` experimental feature is enabled, a bug was fixed where some invalid CE SQL expressions caused a crash eventing webhook. Now those expressions will be considered invalid and the webhook will continue functioning normally. 

@knative-prow-robot knative-prow-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 7, 2022
@devguyio devguyio changed the title Fix cesql validation Handle CESQL parsing panics gracefully Feb 7, 2022
@devguyio devguyio force-pushed the fix-ce-validation branch 2 times, most recently from 6d04940 to 2888e86 Compare February 7, 2022 20:28
@devguyio devguyio added the kind/bug Categorizes issue or PR as related to a bug. label Feb 7, 2022
@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #6140 (38b1eed) into main (6b9499f) will decrease coverage by 0.02%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6140      +/-   ##
==========================================
- Coverage   82.09%   82.06%   -0.03%     
==========================================
  Files         231      231              
  Lines        7765     7769       +4     
==========================================
+ Hits         6375     6376       +1     
- Misses        940      942       +2     
- Partials      450      451       +1     
Impacted Files Coverage Δ
pkg/apis/eventing/v1/trigger_validation.go 84.66% <25.00%> (-1.64%) ⬇️

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 6b9499f...38b1eed. Read the comment docs.

Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
@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/apis/eventing/v1/trigger_validation.go 94.3% 92.7% -1.6

Copy link
Member

@matzew matzew left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2022
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: devguyio, matzew

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 merged commit 20718e2 into knative:main Feb 8, 2022
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. kind/bug Categorizes issue or PR as related to a bug. 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.

4 participants