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

CE SQL test with missing attribute in OR or AND should pass? #7653

Open
pierDipi opened this issue Feb 2, 2024 · 3 comments
Open

CE SQL test with missing attribute in OR or AND should pass? #7653

pierDipi opened this issue Feb 2, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)

Comments

@pierDipi
Copy link
Member

pierDipi commented Feb 2, 2024

Describe the bug

I've tried this CE SQL test in TestCESQLFilter:

		"missing attribute with OR - pass": {
			expression: "((id = 'myId' OR type LIKE '%.success') AND (id = 'notmyId' OR source LIKE 'https://%' OR type LIKE '%.warning')) OR (myext = 'customext')",
			event: makeEvent(func(e *cloudevents.Event) {
				e.SetID("myId")
				e.SetSource("https://example.com/")
			}),
			want: eventfilter.PassFilter,
		},

and it's failing, shouldn't this pass ?

To Reproduce

See above

Knative release version
< main

@pierDipi pierDipi added the kind/bug Categorizes issue or PR as related to a bug. label Feb 2, 2024
@pierDipi pierDipi changed the title CE SQL test with missing attribute in OR should pass? CE SQL test with missing attribute in OR or AND should pass? Feb 2, 2024
@pierDipi
Copy link
Member Author

pierDipi commented Feb 2, 2024

Kinda similar situation with AND + OR, this one fails too

		"missing attribute with AND - pass": {
			expression: "((id = 'myId' OR type LIKE '%.success') AND (id = 'notmyId' OR source LIKE 'https://%' OR type LIKE '%.warning')) AND (myext = 'customext' OR id = 'myId')",
			event: makeEvent(func(e *cloudevents.Event) {
				e.SetID("myId")
				e.SetSource("https://example.com")
			}),
			want: eventfilter.PassFilter,
		},

@Cali0707
Copy link
Member

Cali0707 commented Feb 5, 2024

@pierDipi - this is related to cloudevents/spec#1230

I think the answer is that they should pass, but we need to fix the SDKs and then pull those changes in

@pierDipi
Copy link
Member Author

pierDipi commented Feb 6, 2024

/triage accepted

@knative-prow knative-prow bot added the triage/accepted Issues which should be fixed (post-triage) label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants