-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Bulk actions]- Fix bulk actions data views behavior #138448
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
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.
Thank you for picking this up!
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: cc @yctercero |
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.
Looks fantastic. Thanks for the tests and the quick turnaround here.
expect(editedRuleParams).toHaveProperty('index', ['test-*']); | ||
}); | ||
|
||
test('should set dataViewId to undefined and index to undefined if overwrite_data_views=true on delete_index_patterns action and rule had no index patterns to begin with', () => { |
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.
💯
@@ -59,6 +71,10 @@ const applyBulkActionEditToRuleParams = ( | |||
"Index patterns can't be overwritten. Machine learning rule doesn't have index patterns property" | |||
); | |||
|
|||
if (ruleParams.dataViewId != null && !action.overwrite_data_views) { |
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.
Nit: maybe encapsulate this in a declarative helper? e.g.
if (ruleParams.dataViewId != null && !action.overwrite_data_views) { | |
if (actionNotValid(action, ruleParams)) { |
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 think there's a different helper method @banderror had suggested we could use. Can definitely cleanup/revisit post 8.4.
…or (elastic#138448) ## Summary Addresses [bug](elastic#138383) found where even when `overwrite_data_views` was false, the rule's `index` property was being modified. Please see added integration tests to understand desired behavior of changes. There is one edge case which is a bit weird, but I think too late to address in 8.4. If a user uses bulk delete on a rule with a data view and _no_ index patterns defined and `overwrite_data_views = true`, both data view and index will be set to `undefined`. Per our current behavior, a rule with no data source defaults to using the default index patterns. Not sure this is ideal, but it is in line with the behavior that already exists for a rule. (cherry picked from commit 9e8b5b9)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…or (elastic#138448) (elastic#138466) ## Summary Addresses [bug](elastic#138383) found where even when `overwrite_data_views` was false, the rule's `index` property was being modified. Please see added integration tests to understand desired behavior of changes. There is one edge case which is a bit weird, but I think too late to address in 8.4. If a user uses bulk delete on a rule with a data view and _no_ index patterns defined and `overwrite_data_views = true`, both data view and index will be set to `undefined`. Per our current behavior, a rule with no data source defaults to using the default index patterns. Not sure this is ideal, but it is in line with the behavior that already exists for a rule. (cherry picked from commit 9e8b5b9) Co-authored-by: Yara Tercero <[email protected]>
#141915) ## Summary - addresses #135201 - adds Data View cypress and integration tests according to [Data view Bulk Edit test plan](https://docs.google.com/document/d/116x7ITTTJQ6cTiwaGK831_f6Ox7XB3qyLiHxC3Cmf8w/edit#heading=h.j583i3o7bg2g) (internal document) - integration tests were added earlier in #138448
elastic#141915) ## Summary - addresses elastic#135201 - adds Data View cypress and integration tests according to [Data view Bulk Edit test plan](https://docs.google.com/document/d/116x7ITTTJQ6cTiwaGK831_f6Ox7XB3qyLiHxC3Cmf8w/edit#heading=h.j583i3o7bg2g) (internal document) - integration tests were added earlier in elastic#138448 (cherry picked from commit c7301e5)
#141915) (#142090) ## Summary - addresses #135201 - adds Data View cypress and integration tests according to [Data view Bulk Edit test plan](https://docs.google.com/document/d/116x7ITTTJQ6cTiwaGK831_f6Ox7XB3qyLiHxC3Cmf8w/edit#heading=h.j583i3o7bg2g) (internal document) - integration tests were added earlier in #138448 (cherry picked from commit c7301e5) Co-authored-by: Vitalii Dmyterko <[email protected]>
Summary
Addresses bug found where even when
overwrite_data_views
was false, the rule'sindex
property was being modified.Please see added integration tests to understand desired behavior of changes. There is one edge case which is a bit weird, but I think too late to address in 8.4. If a user uses bulk delete on a rule with a data view and no index patterns defined and
overwrite_data_views = true
, both data view and index will be set toundefined
. Per our current behavior, a rule with no data source defaults to using the default index patterns. Not sure this is ideal, but it is in line with the behavior that already exists for a rule.Checklist
For maintainers