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

Filters created once #7213

Merged
merged 11 commits into from
Sep 22, 2023
Merged

Filters created once #7213

merged 11 commits into from
Sep 22, 2023

Conversation

Cali0707
Copy link
Member

@Cali0707 Cali0707 commented Aug 28, 2023

Fixes #7210

Proposed Changes

  • Add filters map to make managing existing filters easy
  • Update filters interface to include cleanup method (needed for optimizations)
  • use the filters map with the events handler to remove the need to create filters on every use

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

New Event Filters are now only created once, rather than on each event

Docs

Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
@knative-prow
Copy link

knative-prow bot commented Aug 28, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 28, 2023
@knative-prow knative-prow bot requested review from creydr and lionelvillard August 28, 2023 19:13
@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 28, 2023
Signed-off-by: Calum Murray <[email protected]>
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 51.68% and project coverage change: -0.31% ⚠️

Comparison is base (d547e2d) 77.87% compared to head (3010456) 77.57%.
Report is 30 commits behind head on main.

❗ Current head 3010456 differs from pull request most recent head d5f514e. Consider uploading reports for the commit d5f514e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7213      +/-   ##
==========================================
- Coverage   77.87%   77.57%   -0.31%     
==========================================
  Files         246      249       +3     
  Lines       13214    13375     +161     
==========================================
+ Hits        10290    10375      +85     
- Misses       2402     2474      +72     
- Partials      522      526       +4     
Files Changed Coverage Δ
pkg/eventfilter/attributes/filter.go 92.30% <0.00%> (-1.81%) ⬇️
pkg/eventfilter/subscriptionsapi/all_filter.go 92.30% <0.00%> (-7.70%) ⬇️
pkg/eventfilter/subscriptionsapi/any_filter.go 92.30% <0.00%> (-7.70%) ⬇️
pkg/eventfilter/subscriptionsapi/cesql_filter.go 87.09% <0.00%> (-2.91%) ⬇️
pkg/eventfilter/subscriptionsapi/exact_filter.go 54.54% <0.00%> (-2.60%) ⬇️
pkg/eventfilter/subscriptionsapi/not_filter.go 86.66% <0.00%> (-6.20%) ⬇️
pkg/eventfilter/subscriptionsapi/suffix_filter.go 66.66% <0.00%> (-2.30%) ⬇️
pkg/broker/filter/filter_handler.go 67.16% <37.50%> (-3.71%) ⬇️
pkg/eventfilter/subscriptionsapi/no_filter.go 40.00% <40.00%> (ø)
pkg/eventfilter/subscriptionsapi/filters_map.go 89.28% <89.28%> (ø)
... and 1 more

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cali0707 Cali0707 marked this pull request as ready for review September 5, 2023 19:42
@knative-prow knative-prow bot requested review from aslom and odacremolbap September 5, 2023 19:42
@Cali0707 Cali0707 changed the title [WIP]: Filters created once Filters created once Sep 5, 2023
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 5, 2023
Signed-off-by: Calum Murray <[email protected]>
@Cali0707
Copy link
Member Author

Cali0707 commented Sep 6, 2023

/cc @pierDipi

@knative-prow knative-prow bot requested a review from pierDipi September 6, 2023 13:44
@Cali0707
Copy link
Member Author

Cali0707 commented Sep 6, 2023

/hold
Looks like the new rekt tests for filters are now failing, going to look into it...

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 6, 2023
@Cali0707
Copy link
Member Author

Cali0707 commented Sep 6, 2023

/retest

Signed-off-by: Calum Murray <[email protected]>
@Cali0707
Copy link
Member Author

Cali0707 commented Sep 6, 2023

@pierDipi @matzew @creydr it looks like there was an existing bug in the type assertions in the NewHandler function. I fixed it here: 1aa6e60. Should I backport this fix to any releases?

@Cali0707
Copy link
Member Author

Cali0707 commented Sep 6, 2023

Other experimental tests are currently failing, but it looks like all of the new trigger filters tests are passing (they also pass for me locally) so I am going to unhold this.
/unhold
TestMTChannelBrokerAnyTriggerFilters.txt
TestMTChannelBrokerNewTriggerFilters.txt

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 6, 2023
@Cali0707
Copy link
Member Author

/cc @matzew

@knative-prow knative-prow bot requested a review from matzew September 11, 2023 18:16
Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
@Cali0707 Cali0707 requested a review from pierDipi September 13, 2023 17:44
Copy link
Member

@pierDipi pierDipi 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 knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2023
@knative-prow
Copy link

knative-prow bot commented Sep 22, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2023
@pierDipi
Copy link
Member

nit: there are some style issues

@Cali0707
Copy link
Member Author

/hold
I'll fix the style issues :)

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2023
Signed-off-by: Calum Murray <[email protected]>
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2023
@Cali0707
Copy link
Member Author

/unhold
/cc @pierDipi

@knative-prow knative-prow bot requested a review from pierDipi September 22, 2023 14:03
@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2023
@Leo6Leo
Copy link
Member

Leo6Leo commented Sep 22, 2023

/lgtm
For the latest commit!

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2023
@knative-prow knative-prow bot merged commit 6194d9d into knative:main Sep 22, 2023
28 of 31 checks passed
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. 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.

New Events Filtering: Refactor Filters to be created once
3 participants