-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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 Solutions][Detection Engine] Creates an autocomplete package and moves duplicate code between lists and security_solution there #105382
Conversation
…ibana tickets to all the TODO blocks
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
@elasticmachine merge upstream |
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 great, love single-purpose libraries like this package! I'm only nitpicking in the comments.
What I did:
- Tested locally, went through the steps to reproduce the related bugfix ([Security Solution] The detection rules have defined source values for severity overridden but there is no Source field selected for the same. #85951 (comment)), made sure the bug is still fixed.
- Looked briefly at the code of the package and how it's used from
security_solution
.
What I didn't do:
- Thorough line-by-line review of the package.
- Review of changes in
lists
. - Testing if it works with exceptions.
// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/105731 | ||
// import { IFieldType } from '../../../../../../../src/plugins/data/common'; | ||
type IFieldType = any; |
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: #103530 is merged
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.
Thanks, for letting me know that merged. They created a Kibana ticket for me I assigned it to myself. I have to fix these across all the packages and that will be a follow up all at once for these which I included in the comments of this PR:
#105731
@@ -0,0 +1,37 @@ | |||
/* |
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: I'd bring more structure to this package by separating components from utils etc. For example:
src/components/autocomplete_field
src/components/autocomplete_field_match
src/utils/fields/check_empty_value
etc
The current flat structure works since there's not too many files, but still a little bit hard to navigate.
Also, file names don't always correspond to component names, for example.
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 from this comment and the comment below, maybe we can do a follow up code sweep or discussion around file name changes, conventions?
I have been following mostly patterns seen within these folders to make things portable if we collapse between this package and the others, but I'm open if we want to do a broad cleanup/sweep of just naming changes in 1 faster PR.
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.
Yeah, that sounds good, if more people from the team say this kind of restructure/renaming makes sense, doing it in a separate PR either for only this one or across more packages (kbn-securitysolution-*
?) would be a good idea.
@@ -1,17 +1,23 @@ | |||
/* | |||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | |||
* or more contributor license agreements. Licensed under the Elastic License | |||
* 2.0; you may not use this file except in compliance with the Elastic License | |||
* 2.0. | |||
* 2.0 and the Server Side Public License, v 1; you may not use this file except |
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.
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 from this comment and the comment below, maybe we can do a follow up code sweep or discussion around file name changes, conventions?
I have been following mostly patterns seen within these folders to make things portable if we collapse between this package and the others, but I'm open if we want to do a broad cleanup/sweep of just naming changes in 1 faster PR.
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…e and moves duplicate code between lists and security_solution there (elastic#105382) ## Summary Creates an autocomplete package from `lists` and removes duplicate code between `lists` and `security_solutions` * Consolidates different PR's where we were changing different parts of autocomplete in different ways. * Existing Cypress tests should cover any mistakes hopefully Manual Testing: * Ensure this bug does not crop up again elastic#87004 * Make sure that the exception list autocomplete looks alright ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…e and moves duplicate code between lists and security_solution there (elastic#105382) ## Summary Creates an autocomplete package from `lists` and removes duplicate code between `lists` and `security_solutions` * Consolidates different PR's where we were changing different parts of autocomplete in different ways. * Existing Cypress tests should cover any mistakes hopefully Manual Testing: * Ensure this bug does not crop up again elastic#87004 * Make sure that the exception list autocomplete looks alright ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios # Conflicts: # x-pack/plugins/translations/translations/ja-JP.json
…e and moves duplicate code between lists and security_solution there (#105382) (#106612) ## Summary Creates an autocomplete package from `lists` and removes duplicate code between `lists` and `security_solutions` * Consolidates different PR's where we were changing different parts of autocomplete in different ways. * Existing Cypress tests should cover any mistakes hopefully Manual Testing: * Ensure this bug does not crop up again #87004 * Make sure that the exception list autocomplete looks alright ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios # Conflicts: # x-pack/plugins/translations/translations/ja-JP.json
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #105378
Creates an autocomplete package from
lists
and removes duplicate code betweenlists
andsecurity_solutions
Manual Testing:
Checklist