-
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] Fix bug with redirect and add test #210188
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
@elasticmachine merge upstream |
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.
Looks great, thanks for the fix!
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.
Thanks for tests and changes look good with one nit
. See if it makes sense.
...ugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.test.ts
Show resolved
Hide resolved
Starting backport for target branches: 8.18, 8.x, 9.0 https://github.com/elastic/kibana/actions/runs/13265048098 |
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @semd |
## Summary It fixes a bug caused by the `latestStats$` being initialized with `[]` empty array. The hook considers the state is _loading_ while the hook is `null`. https://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26 The fix consists of initializing the `latestStats$` observable to `null` instead of `[]`. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit dc3b4c8)
## Summary It fixes a bug caused by the `latestStats$` being initialized with `[]` empty array. The hook considers the state is _loading_ while the hook is `null`. https://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26 The fix consists of initializing the `latestStats$` observable to `null` instead of `[]`. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit dc3b4c8)
## Summary It fixes a bug caused by the `latestStats$` being initialized with `[]` empty array. The hook considers the state is _loading_ while the hook is `null`. https://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26 The fix consists of initializing the `latestStats$` observable to `null` instead of `[]`. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit dc3b4c8)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… (#210587) # Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sergi Massaneda","email":"sergi.massaneda@elastic.co"},"sourceCommit":{"committedDate":"2025-02-11T14:20:50Z","message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security Solution] Fix bug with redirect and add test","number":210188,"url":"https://github.com/elastic/kibana/pull/210188","mergeCommit":{"message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210188","number":210188,"mergeCommit":{"message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
#210588) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sergi Massaneda","email":"sergi.massaneda@elastic.co"},"sourceCommit":{"committedDate":"2025-02-11T14:20:50Z","message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security Solution] Fix bug with redirect and add test","number":210188,"url":"https://github.com/elastic/kibana/pull/210188","mergeCommit":{"message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210188","number":210188,"mergeCommit":{"message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
#210589) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sergi Massaneda","email":"sergi.massaneda@elastic.co"},"sourceCommit":{"committedDate":"2025-02-11T14:20:50Z","message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security Solution] Fix bug with redirect and add test","number":210188,"url":"https://github.com/elastic/kibana/pull/210188","mergeCommit":{"message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210188","number":210188,"mergeCommit":{"message":"[Security Solution] Fix bug with redirect and add test (#210188)\n\n## Summary\r\n\r\nIt fixes a bug caused by the `latestStats# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT being initialized with `[]`\r\nempty array. The hook considers the state is _loading_ while the hook is\r\n`null`.\r\n\r\n\r\nhttps://github.com/elastic/kibana/blob/dde1bec88bc7a797c21d65305c23ab6c1dc6bed6/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts#L23-L26\r\n\r\nThe fix consists of initializing the `latestStats# Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix bug with redirect and add test (#210188)](#210188) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable to `null`\r\ninstead of `[]`.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"dc3b4c8c3113f71b250e9c4a037f8dee507178f0"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Summary
It fixes a bug caused by the
latestStats$
being initialized with[]
empty array. The hook considers the state is loading while the hook isnull
.kibana/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts
Lines 23 to 26 in dde1bec
The fix consists of initializing the
latestStats$
observable tonull
instead of[]
.