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

New Event Filtering: Add rekt test to verify that empty filters does not override filter #7298

Closed
Cali0707 opened this issue Sep 25, 2023 · 8 comments · Fixed by #7534
Closed
Assignees
Labels
area/test-and-release Test infrastructure, tests or release help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature-request

Comments

@Cali0707
Copy link
Member

Problem
With the new subscriptionsapi filters moving to enabled by default, users can now use both the filters field on a trigger as well as the filter field on a trigger. The order of priority of these fields when filtering an event is:

  1. If there are filters in the filters field and the feature is enabled, use the filters field.
  2. If there are no filters in the filters field and the feature is enabled, fallback to the filter field.
  3. If there is a filter in the filter field apply it
  4. If the above fails, pass the event (there is no filtering to be done)

Exit Criteria
A test in the new trigger filters rekt tests which:

  1. Create a trigger
  2. Sets a filter, but nothing in the filters field
  3. Sends events to the broker which match the filter and verifies that they are delivered
  4. Sends events to the broker which do not match the filter and verifies that they are not delivered

Time Estimate (optional):
How many developer-days do you think this may take to resolve? 1

Additional context (optional)
Add any other context about the feature request here.

@Cali0707
Copy link
Member Author

/area test-and-release
/help

@knative-prow
Copy link

knative-prow bot commented Sep 25, 2023

@Cali0707:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/area test-and-release
/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot added area/test-and-release Test infrastructure, tests or release help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Sep 25, 2023
@rahulii
Copy link
Contributor

rahulii commented Oct 2, 2023

/assign

@Cali0707
Copy link
Member Author

Cali0707 commented Dec 5, 2023

Hey @rahulii any updates on this? Is there anything I can help you with here? If you're still working on this issue please let me know, otherwise I will unassign it from you this coming Friday so others can work on it.

@Cali0707
Copy link
Member Author

Cali0707 commented Dec 8, 2023

@rahulii I'm going to unassign this issue from you now so others can work on it. Feel free to re-assign yourself if you want to work on it again!

/unassign @rahulii

@pawarpranav83
Copy link
Contributor

pawarpranav83 commented Jan 5, 2024

Hi! Currently working on this test, will make a PR soon.

/assign

@pawarpranav83
Copy link
Contributor

@Cali0707
Approach - Add filter parameter (eventingv1.TriggerFilter) to createNewFiltersFeature and create a feature function in rekt/features/new_trigger_filters/feature.go for filter attributes and filters would be empty and append it to the featureSet.
Should I make these changes?

@Cali0707
Copy link
Member Author

Cali0707 commented Jan 5, 2024

@Cali0707 Approach - Add filter parameter (eventingv1.TriggerFilter) to createNewFiltersFeature and create a feature function in rekt/features/new_trigger_filters/feature.go for filter attributes and filters would be empty and append it to the featureSet. Should I make these changes?

@pradnyavmw sure that sounds like a reasonable approach, go for it! Would you also be able to add one more feature in rekt/features/new_trigger_filters/feature.go to verify that when both the filter and filters fields are set, filters overrides the filter field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test-and-release Test infrastructure, tests or release help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature-request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants