Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[ResponseOps][Alerts] Fix DSL filter issues in search bar #193623
[ResponseOps][Alerts] Fix DSL filter issues in search bar #193623
Changes from 29 commits
d7670dd
1ad044a
6195669
1ddb22a
924859f
e779800
670678b
02ed103
aace640
fd03949
78e1ed9
82677da
aaaa7fd
4a5d01e
719a841
eb0ebd8
e276245
b3aa283
d84431e
5046431
27d014b
4de4114
0cc7c9e
a99a408
136040d
f22c955
8c5edea
f348c2d
8b8a096
0041cf7
8f6d240
dd10186
b663e2b
411fcf6
dbcbceb
e134d0f
9ca50df
758856f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you please explain what you are trying to achieve here?
Filter
type has only 3 properties:$state, meta, query?
.When deconstructing a filter the
rest
parameter should be just thequery
param.In this ternary we are saying that if
filter.query
doesn't exist then usefilter.query
that doesn't exist.So I'm not sure what we are updating here.
It looks like the
Filter
objects are "hiding" something more hidden from the current Typing. This is definitely not great and cause tech debt that is hard to findThere 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.
On an subsequent check I see that the filter is currently constructed in the wrong way and in general it doesn't conform to its type:
Filter
The parameter
query
is not populated with the custom DSL, but the custom DSL always pollutes the rest of the object. I see this as a wrong implementation (not yours but the current unified search implementation) that needs to be fixed to make it work correctly in all cases.IMHO what we are trying to push here is a workaround of a bigger problem, than an actual fix.
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.
Exactly!
Above changes had to be done because when filters are updated via
onFiltersUpdate
, the DSL filter value is not wrapped in a query which throws validation error in the rule's action as it is expected to be aquery
object.filter_query.bug.mov
Agree, however as per my understanding not all plugins/ scenarios expects custom DSL value to be wrapped in a query object. Applying DSL filter to Alerts table works fine without query object.
Hence I fixed it wherever it was needed.
CC @cnasikas
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.
if you don't mind I'd like to see what could happen if I change your code like that: 9c8b5a3
let the CI run and see of this change trigger any error in the use of the unified search. This definitely work with your use case, but I'd like to check if this causes problem in the surrounding
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.
added