-
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] Refactor resolver children _source #77343
[Security Solution] Refactor resolver children _source #77343
Conversation
Pinging @elastic/endpoint-app-team (Feature:Resolver) |
Pinging @elastic/endpoint-data-visibility-team (Team:Endpoint Data Visibility) |
@jonathan-buttner AFAIK the children API is unused. What is the motivation for this PR? |
@oatkiller sorry "children API" is misleading, I meant it in a general sense. The |
}>; | ||
} | ||
| { | ||
event: Partial<{ |
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 does this second part of the union do? Doesn't the first part being marked 'partial' make this redundant?
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.
The first Partial
marks the fields like endgame
and event
as optional but not the fields inside those fields (it's not recursive). This line marks type
as optional and any future fields added to event
.
*/ | ||
type TimestampFields = Pick<SafeResolverEvent, '@timestamp'>; | ||
|
||
export function timestampSafeVersion(event: TimestampFields): undefined | number { |
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.
🔴 doc comments on exports
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 comment
*/ | ||
type GetAncestryArrayFields = AncestryArrayFields & ParentEntityIDFields; | ||
|
||
export function getAncestryAsArray(event: GetAncestryArrayFields | undefined): string[] { |
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.
🔴 doc comments on exports
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 comment
💚 Build SucceededBuild metricsasync chunks size
History
To update your PR or re-run it, just comment with: |
* Moving generator to safe type version * Finished generator and alert * Gzipping again * Finishing type conversions for backend * Trying to cast front end tests back to unsafe type for now * Working reducer tests * Adding more comments and fixing alert type * Restoring resolver test data * Updating snapshot with timestamp info * Getting the models figured out * Event models type fixes * Adding more comments * Fixing more comments * Adding comments
* Moving generator to safe type version * Finished generator and alert * Gzipping again * Finishing type conversions for backend * Trying to cast front end tests back to unsafe type for now * Working reducer tests * Adding more comments and fixing alert type * Restoring resolver test data * Updating snapshot with timestamp info * Getting the models figured out * Event models type fixes * Adding more comments * Fixing more comments * Adding comments
This PR refactors a portion of the children functionality to reduce the
_source
fields used when querying the document. Only a portion of the fields are needed for an intermediate step while finding the children nodes of a process. To accomplish this, a number of the model function's parameters were changed to only take the necessary fields for a single function.