-
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][Endpoint] Refactor resolver generator for ancestry array #70129
[Security_Solution][Endpoint] Refactor resolver generator for ancestry array #70129
Conversation
Pinging @elastic/endpoint-data-visibility-team (Team:Endpoint Data Visibility) |
Pinging @elastic/endpoint-app-team (Feature:Endpoint) |
@@ -492,6 +523,11 @@ export class EndpointDocGenerator { | |||
* @param options - Allows event field values to be specified | |||
*/ | |||
public generateEvent(options: EventOptions = {}): EndpointEvent { | |||
let ancestry: string[] | undefined; | |||
if (options?.useAncestryArray === true || options?.ancestry !== undefined) { |
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.
why do we need a useAncestryArray
option separate from the ancestry
option?
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 good point. I'll remove it. We can accomplish the same thing with ancestry = 0
👍
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
…y array (#70129) (#70518) * Refactor generator for ancestry support * Adding optional ancestry array * Fixing tests and type errors * Removing useAncestry field * Fixing test * An empty array will be returned because that's how ES will do it too Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
This PR refactors how the generator passes in options for building the tree. This makes assigning options like how large of an ancestry array to use easier to use throughout the generator.
I also added a
levels
field in the tree response to make it easier to access the levels of the tree when using the generator in tests.These are changes I've made while implementing msearch for resolver's backend and needed extra functionality for the tests.