-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BCI-3988] - FilteredLogs receive []Expression instead of whole KeyFilter #14109
[BCI-3988] - FilteredLogs receive []Expression instead of whole KeyFilter #14109
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful with this change since this is used in other repos (although not in a lot of places), This should be either versioned or very carefully updated at the same time everywhere
core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go
Outdated
Show resolved
Hide resolved
core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What impact will this PR have on CCIP? Just want to make sure we are mindful of the concerns Makram raised. My other comments were mostly questions as I don't know much about how these expressions work.
assert.Equal(t, []query.Expression{}, result) | ||
}) | ||
|
||
t.Run("Invalid boolean expression", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the valid and invalid expressions documented somewhere? Would it make sense to go through all them in these tests and show how to properly use them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logpoller.Where()
function it's just a wrapper of the original one query.Where()
where you don't need to provide a key
param and just the expressions
The underlying function has extensive tests here which uses the test cases defined here. Also the usage eg. defined in the function comment is clear
Let me know your thoughts if this seems enough
t.Run("Valid combination of filters", func(t *testing.T) { | ||
result, err := logpoller.Where(expr1, expr2, expr3, expr4) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []query.Expression{expr1, expr2, expr3, expr4}, result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these filters are being combined as a logical "AND" - the events need to match all filters. What if you want a logical "OR" - events that match at least one of the filters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing this function at a high level, maybe it's redundant given the underlying tests. More details in my previous comment here: #14109 (comment)
Mateusz commented here the following:
We only need to merge core and they will eventually get these changes. We only cherry pick when changes needed are urgent as Makram said here too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, LGTM
Task Description:
Log poller Filtered logs have no use for Key, which makes the method confusing when used outside of CR
This PR:
FilteredLogs
method so it receives[]query.Expression
instead of wholequery.KeyFilter
as param.logpoller.Where
function that doesn't receive key. It wrapsquery.Where
Ticket:
Note:
[BCI-3863] - Use filtered logs in eventBinding GetLatestValue instead of manual filtering #14096 will introduce small conflicts as it adds a new reference tofixedFilteredLogs
Merged with:
[BCI-3988] - FilteredLogs receive []Expression instead of whole KeyFilter ccip#1403not needed based on Mateusz comment within the PR