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

[ML] Fixes issue with empty object creation #186821

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Jun 24, 2024

Using Object.create(null) when creating objects for the anomaly results table.

@jgowdyelastic jgowdyelastic self-assigned this Jun 24, 2024
@jgowdyelastic jgowdyelastic marked this pull request as ready for review June 24, 2024 13:43
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner June 24, 2024 13:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jgowdyelastic jgowdyelastic enabled auto-merge (squash) June 25, 2024 13:47
Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

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

cc @jgowdyelastic

@jgowdyelastic jgowdyelastic merged commit 8e76b0b into elastic:main Jun 25, 2024
19 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 25, 2024
Using `Object.create(null)` when creating objects for the anomaly
results table.

(cherry picked from commit 8e76b0b)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 25, 2024
Using `Object.create(null)` when creating objects for the anomaly
results table.

(cherry picked from commit 8e76b0b)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17
8.14

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 25, 2024
# Backport

This will backport the following commits from `main` to `8.14`:
- [[ML] Fixing issue with empty object creation
(#186821)](#186821)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2024-06-25T15:23:25Z","message":"[ML]
Fixing issue with empty object creation (#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:Anomaly
Detection","v8.15.0","v7.17.23","v8.14.2"],"title":"[ML] Fixing issue
with empty object
creation","number":186821,"url":"https://github.com/elastic/kibana/pull/186821","mergeCommit":{"message":"[ML]
Fixing issue with empty object creation (#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da"}},"sourceBranch":"main","suggestedTargetBranches":["7.17","8.14"],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/186821","number":186821,"mergeCommit":{"message":"[ML]
Fixing issue with empty object creation (#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da"}},{"branch":"7.17","label":"v7.17.23","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.14","label":"v8.14.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: James Gowdy <jgowdy@elastic.co>
kibanamachine added a commit that referenced this pull request Jun 25, 2024
# Backport

This will backport the following commits from `main` to `7.17`:
- [[ML] Fixing issue with empty object creation
(#186821)](#186821)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2024-06-25T15:23:25Z","message":"[ML]
Fixing issue with empty object creation (#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:Anomaly
Detection","v8.15.0","v7.17.23","v8.14.2"],"title":"[ML] Fixing issue
with empty object
creation","number":186821,"url":"https://github.com/elastic/kibana/pull/186821","mergeCommit":{"message":"[ML]
Fixing issue with empty object creation (#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da"}},"sourceBranch":"main","suggestedTargetBranches":["7.17","8.14"],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/186821","number":186821,"mergeCommit":{"message":"[ML]
Fixing issue with empty object creation (#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da"}},{"branch":"7.17","label":"v7.17.23","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.14","label":"v8.14.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: James Gowdy <jgowdy@elastic.co>
@bhavyarm
Copy link
Contributor

bhavyarm commented Jul 3, 2024

@jgowdyelastic how do we test this PR? Thanks!

@szabosteve szabosteve changed the title [ML] Fixing issue with empty object creation [ML] Fixes issue with empty object creation Jul 31, 2024
adelisle pushed a commit to Makila-AI/kibana that referenced this pull request Aug 5, 2024
…lastic#186900)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[ML] Fixing issue with empty object creation
(elastic#186821)](elastic#186821)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2024-06-25T15:23:25Z","message":"[ML]
Fixing issue with empty object creation (elastic#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:Anomaly
Detection","v8.15.0","v7.17.23","v8.14.2"],"title":"[ML] Fixing issue
with empty object
creation","number":186821,"url":"https://github.com/elastic/kibana/pull/186821","mergeCommit":{"message":"[ML]
Fixing issue with empty object creation (elastic#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da"}},"sourceBranch":"main","suggestedTargetBranches":["7.17","8.14"],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/186821","number":186821,"mergeCommit":{"message":"[ML]
Fixing issue with empty object creation (elastic#186821)\n\nUsing
`Object.create(null)` when creating objects for the anomaly\r\nresults
table.","sha":"8e76b0b113089c793e4dba77610f90540ec9b8da"}},{"branch":"7.17","label":"v7.17.23","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.14","label":"v8.14.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: James Gowdy <jgowdy@elastic.co>
jgowdyelastic added a commit that referenced this pull request Aug 28, 2024
Replacing instances of empty object creation with `Object.create(null)`
to remove any risk of prototype pollution.
Only touching server and common code.

Follows on from #186821
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 28, 2024
Replacing instances of empty object creation with `Object.create(null)`
to remove any risk of prototype pollution.
Only touching server and common code.

Follows on from elastic#186821

(cherry picked from commit 5ea65f9)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 28, 2024
Replacing instances of empty object creation with `Object.create(null)`
to remove any risk of prototype pollution.
Only touching server and common code.

Follows on from elastic#186821

(cherry picked from commit 5ea65f9)
kibanamachine referenced this pull request Sep 2, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [[ML] Improving empty object creation
(#191518)](#191518)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2024-08-28T15:41:34Z","message":"[ML]
Improving empty object creation (#191518)\n\nReplacing instances of
empty object creation with `Object.create(null)`\r\nto remove any risk
of prototype pollution.\r\nOnly touching server and common
code.\r\n\r\nFollows on from
https://github.com/elastic/kibana/pull/186821","sha":"5ea65f9ed741514c264642b3a5ccb83bf648ff7a","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v8.16.0","v8.14.4","v7.17.24","v8.15.1"],"title":"[ML]
Improving empty object
creation","number":191518,"url":"https://github.com/elastic/kibana/pull/191518","mergeCommit":{"message":"[ML]
Improving empty object creation (#191518)\n\nReplacing instances of
empty object creation with `Object.create(null)`\r\nto remove any risk
of prototype pollution.\r\nOnly touching server and common
code.\r\n\r\nFollows on from
https://github.com/elastic/kibana/pull/186821","sha":"5ea65f9ed741514c264642b3a5ccb83bf648ff7a"}},"sourceBranch":"main","suggestedTargetBranches":["8.14","7.17","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191518","number":191518,"mergeCommit":{"message":"[ML]
Improving empty object creation (#191518)\n\nReplacing instances of
empty object creation with `Object.create(null)`\r\nto remove any risk
of prototype pollution.\r\nOnly touching server and common
code.\r\n\r\nFollows on from
https://github.com/elastic/kibana/pull/186821","sha":"5ea65f9ed741514c264642b3a5ccb83bf648ff7a"}},{"branch":"8.14","label":"v8.14.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"7.17","label":"v7.17.24","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants