Skip to content
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

Merged
merged 3 commits into from
Apr 30, 2022

Conversation

parkiino
Copy link
Contributor

Summary

  • Updates the endpoint generators to use mergeWith instead of merge, which will now preserve array values.

Cleanup in some tests did not work properly because merge was overwriting array values.

@parkiino parkiino added release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution auto-backport Deprecated - use backport:version if exact versions are needed v8.2.0 v8.3.0 labels Apr 29, 2022
@parkiino parkiino requested a review from a team as a code owner April 29, 2022 19:46
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

Copy link
Contributor

@paul-tavares paul-tavares left a 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) => {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okie

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@parkiino parkiino merged commit 7cc364a into elastic:main Apr 30, 2022
@parkiino parkiino deleted the task/use-correct-merge branch April 30, 2022 05:40
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.2 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 131273

Questions ?

Please refer to the Backport tool documentation

@parkiino parkiino removed the v8.2.0 label May 1, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 1, 2022
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants