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
[Security Solution][Endpoint] Potential improvements in endpoint user artifact packager #160387
[Security Solution][Endpoint] Potential improvements in endpoint user artifact packager #160387
Changes from 16 commits
7aed42e
7f3cc68
d768630
11eed82
f54a82c
9608d18
14cd787
ca73b54
61b8331
57df8f2
6c48302
805f152
287f839
efca38d
0f7ae0b
cd628a2
ad11a8f
26e99fc
07f122e
74bca2b
88d5d70
dce6775
92b521b
5c9ef42
21041b6
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.
nit:
body
is deprecated overoperations
forbulk
. You can renamebody
tooperations
. You can change the otherbulk
calls in the file as well.Similarly, the
create
method (used increateArtifact
) prefersdocument
instead of abody
in the request, and thesearch
(used inlistArtifacts
) method acceptssort
directly in the request instead of being nested inside abody
.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 don't think you need to
wait_for
ondelete
right?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 we don't wait for the deletions to be done, then the
clanup
phase will try to remove artifacts that might be removed later. This is why I used here thewait_for
, otherwise, thecleanup
method in manifest manager will hit errors because it queried some orphan artifacts (not yet removed from the search) but already removed from the index.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.
Got it. Thanks.
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:
uniqueIdFromId
is a bit confusing, is id the artifact id? We could rename the function touniqueIdFromArtifactId
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 id of the artifact without the packageName, so it adds the packageName to the current id as an ES id:
${packageName}:${artifactId}
.Is the same thing
uniqueIdFromArtifact
does, but as we only have the id here I thought would be better to just create this new method instead of load the artifact to generate the unique Id with the existing method.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.
You can also rename this to
packagePrefixedId
. That might be less confusing to read. 😅