-
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][Admin][Endpoint Generator] Endpoint generator uses correct merge to preserve array values #131273
Conversation
Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt) |
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 doing this. 🙏
I left a comment, but looks good to me. Let's see if the tests pass.
@@ -18,3 +20,13 @@ export const wrapErrorIfNeeded = (error: Error): EndpointDataLoadingError => | |||
|
|||
// Use it in Promise's `.catch()` as `.catch(wrapErrorAndRejectPromise)` | |||
export const wrapErrorAndRejectPromise = (error: Error) => Promise.reject(wrapErrorIfNeeded(error)); | |||
|
|||
export const mergeAndAppendArrays = <T, S>(destinationObj: T, srcObj: S) => { |
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.
can you add the return type to this function? I think it should be T
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.
okie
💚 Build SucceededMetrics [docs]
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…s correct merge to preserve array values (elastic#131273)
Summary
mergeWith
instead ofmerge
, which will now preserve array values.Cleanup in some tests did not work properly because merge was overwriting array values.