-
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] Display unavailable ML jobs #205483
[Security Solution] Display unavailable ML jobs #205483
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
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.
LGTM @nikitaindik!
Pulled down and tested locally by removing some and all jobs from an ML rule and then updating both of them
@nikitaindik Please fill in custom fields |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
The CI Stats report is too large to be displayed here, check out the CI build annotation for this information. History
cc @nikitaindik |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12632565829 |
**Resolves: elastic#202700 ## Summary This PR resolves an issue where an ML job referenced by a rule does not appear in the Rule Details, Upgrade flyout, or Rule Editing pages if the job is missing or not yet created. For example, if you had an ML rule with a single selected job and this job was not available, you would see a blank space instead of job name. ## Screenshots **Rule Details: Before** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 32" src="https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682" /> **Rule Details: After** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 05" src="https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b" /> **Rule Edit: Before** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 21" src="https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4" /> **Rule Edit: After** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 09" src="https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08" /> **Upgrade flyout: Before** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 22 30" src="https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505" /> **Upgrade flyout: After** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 21 55" src="https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70" /> ## Testing You can test by removing an ML job referenced by a rule in `http://localhost:<port>/kbn/app/ml/jobs`. (cherry picked from commit e04b200)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Display unavailable ML jobs (#205483)](#205483) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nikita Indik","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-06T12:33:10Z","message":"[Security Solution] Display unavailable ML jobs (#205483)\n\n**Resolves: https://github.com/elastic/kibana/issues/202700**\n\n## Summary\nThis PR resolves an issue where an ML job referenced by a rule does not\nappear in the Rule Details, Upgrade flyout, or Rule Editing pages if the\njob is missing or not yet created.\n\nFor example, if you had an ML rule with a single selected job and this\njob was not available, you would see a blank space instead of job name.\n\n## Screenshots\n**Rule Details: Before**\n<img width=\"578\" alt=\"Schermafbeelding 2025-01-03 om 13 20 32\"\nsrc=\"https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682\"\n/>\n\n**Rule Details: After**\n<img width=\"578\" alt=\"Schermafbeelding 2025-01-03 om 13 20 05\"\nsrc=\"https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b\"\n/>\n\n**Rule Edit: Before**\n<img width=\"427\" alt=\"Schermafbeelding 2025-01-03 om 13 21 21\"\nsrc=\"https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4\"\n/>\n\n**Rule Edit: After**\n<img width=\"427\" alt=\"Schermafbeelding 2025-01-03 om 13 21 09\"\nsrc=\"https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08\"\n/>\n\n**Upgrade flyout: Before**\n<img width=\"1066\" alt=\"Schermafbeelding 2025-01-03 om 13 22 30\"\nsrc=\"https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505\"\n/>\n\n**Upgrade flyout: After**\n<img width=\"1066\" alt=\"Schermafbeelding 2025-01-03 om 13 21 55\"\nsrc=\"https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70\"\n/>\n\n## Testing\nYou can test by removing an ML job referenced by a rule in\n`http://localhost:<port>/kbn/app/ml/jobs`.","sha":"e04b20018a441e679848e114df68ba688976c83c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","Feature:Rule Creation","Feature:Rule Details","Feature:Rule Edit","backport:version","v8.18.0"],"title":"[Security Solution] Display unavailable ML jobs","number":205483,"url":"https://github.com/elastic/kibana/pull/205483","mergeCommit":{"message":"[Security Solution] Display unavailable ML jobs (#205483)\n\n**Resolves: https://github.com/elastic/kibana/issues/202700**\n\n## Summary\nThis PR resolves an issue where an ML job referenced by a rule does not\nappear in the Rule Details, Upgrade flyout, or Rule Editing pages if the\njob is missing or not yet created.\n\nFor example, if you had an ML rule with a single selected job and this\njob was not available, you would see a blank space instead of job name.\n\n## Screenshots\n**Rule Details: Before**\n<img width=\"578\" alt=\"Schermafbeelding 2025-01-03 om 13 20 32\"\nsrc=\"https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682\"\n/>\n\n**Rule Details: After**\n<img width=\"578\" alt=\"Schermafbeelding 2025-01-03 om 13 20 05\"\nsrc=\"https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b\"\n/>\n\n**Rule Edit: Before**\n<img width=\"427\" alt=\"Schermafbeelding 2025-01-03 om 13 21 21\"\nsrc=\"https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4\"\n/>\n\n**Rule Edit: After**\n<img width=\"427\" alt=\"Schermafbeelding 2025-01-03 om 13 21 09\"\nsrc=\"https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08\"\n/>\n\n**Upgrade flyout: Before**\n<img width=\"1066\" alt=\"Schermafbeelding 2025-01-03 om 13 22 30\"\nsrc=\"https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505\"\n/>\n\n**Upgrade flyout: After**\n<img width=\"1066\" alt=\"Schermafbeelding 2025-01-03 om 13 21 55\"\nsrc=\"https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70\"\n/>\n\n## Testing\nYou can test by removing an ML job referenced by a rule in\n`http://localhost:<port>/kbn/app/ml/jobs`.","sha":"e04b20018a441e679848e114df68ba688976c83c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205483","number":205483,"mergeCommit":{"message":"[Security Solution] Display unavailable ML jobs (#205483)\n\n**Resolves: https://github.com/elastic/kibana/issues/202700**\n\n## Summary\nThis PR resolves an issue where an ML job referenced by a rule does not\nappear in the Rule Details, Upgrade flyout, or Rule Editing pages if the\njob is missing or not yet created.\n\nFor example, if you had an ML rule with a single selected job and this\njob was not available, you would see a blank space instead of job name.\n\n## Screenshots\n**Rule Details: Before**\n<img width=\"578\" alt=\"Schermafbeelding 2025-01-03 om 13 20 32\"\nsrc=\"https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682\"\n/>\n\n**Rule Details: After**\n<img width=\"578\" alt=\"Schermafbeelding 2025-01-03 om 13 20 05\"\nsrc=\"https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b\"\n/>\n\n**Rule Edit: Before**\n<img width=\"427\" alt=\"Schermafbeelding 2025-01-03 om 13 21 21\"\nsrc=\"https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4\"\n/>\n\n**Rule Edit: After**\n<img width=\"427\" alt=\"Schermafbeelding 2025-01-03 om 13 21 09\"\nsrc=\"https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08\"\n/>\n\n**Upgrade flyout: Before**\n<img width=\"1066\" alt=\"Schermafbeelding 2025-01-03 om 13 22 30\"\nsrc=\"https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505\"\n/>\n\n**Upgrade flyout: After**\n<img width=\"1066\" alt=\"Schermafbeelding 2025-01-03 om 13 21 55\"\nsrc=\"https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70\"\n/>\n\n## Testing\nYou can test by removing an ML job referenced by a rule in\n`http://localhost:<port>/kbn/app/ml/jobs`.","sha":"e04b20018a441e679848e114df68ba688976c83c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nikita Indik <[email protected]>
**Resolves: elastic#202700 ## Summary This PR resolves an issue where an ML job referenced by a rule does not appear in the Rule Details, Upgrade flyout, or Rule Editing pages if the job is missing or not yet created. For example, if you had an ML rule with a single selected job and this job was not available, you would see a blank space instead of job name. ## Screenshots **Rule Details: Before** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 32" src="https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682" /> **Rule Details: After** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 05" src="https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b" /> **Rule Edit: Before** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 21" src="https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4" /> **Rule Edit: After** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 09" src="https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08" /> **Upgrade flyout: Before** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 22 30" src="https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505" /> **Upgrade flyout: After** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 21 55" src="https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70" /> ## Testing You can test by removing an ML job referenced by a rule in `http://localhost:<port>/kbn/app/ml/jobs`.
**Resolves: elastic#202700 ## Summary This PR resolves an issue where an ML job referenced by a rule does not appear in the Rule Details, Upgrade flyout, or Rule Editing pages if the job is missing or not yet created. For example, if you had an ML rule with a single selected job and this job was not available, you would see a blank space instead of job name. ## Screenshots **Rule Details: Before** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 32" src="https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682" /> **Rule Details: After** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 05" src="https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b" /> **Rule Edit: Before** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 21" src="https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4" /> **Rule Edit: After** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 09" src="https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08" /> **Upgrade flyout: Before** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 22 30" src="https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505" /> **Upgrade flyout: After** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 21 55" src="https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70" /> ## Testing You can test by removing an ML job referenced by a rule in `http://localhost:<port>/kbn/app/ml/jobs`.
**Resolves: elastic#202700 ## Summary This PR resolves an issue where an ML job referenced by a rule does not appear in the Rule Details, Upgrade flyout, or Rule Editing pages if the job is missing or not yet created. For example, if you had an ML rule with a single selected job and this job was not available, you would see a blank space instead of job name. ## Screenshots **Rule Details: Before** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 32" src="https://github.com/user-attachments/assets/e8bc073f-0420-4888-8dd9-b4dc70fd0682" /> **Rule Details: After** <img width="578" alt="Schermafbeelding 2025-01-03 om 13 20 05" src="https://github.com/user-attachments/assets/bd4d0f91-8adf-45c5-8d31-b42ac483027b" /> **Rule Edit: Before** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 21" src="https://github.com/user-attachments/assets/bffcb871-8cfc-4f50-8d19-c14b122c0be4" /> **Rule Edit: After** <img width="427" alt="Schermafbeelding 2025-01-03 om 13 21 09" src="https://github.com/user-attachments/assets/be8f60b9-17a6-48d2-978c-cfa63c426a08" /> **Upgrade flyout: Before** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 22 30" src="https://github.com/user-attachments/assets/553ff837-95cf-4670-91f1-dffb169ec505" /> **Upgrade flyout: After** <img width="1066" alt="Schermafbeelding 2025-01-03 om 13 21 55" src="https://github.com/user-attachments/assets/150cfb82-bc69-4aeb-a20a-03f54c7edc70" /> ## Testing You can test by removing an ML job referenced by a rule in `http://localhost:<port>/kbn/app/ml/jobs`.
@@ -9,6 +9,7 @@ import type { FC, ReactNode } from 'react'; | |||
import React, { memo } from 'react'; | |||
import styled from 'styled-components'; | |||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | |||
import { euiThemeVars } from '@kbn/ui-theme'; |
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.
@nikitaindik FYI these static references to theme variables are deprecated; please opt for use of useEuiTheme
instead.
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.
Right! I was doing the conversion during a prep for Borealis a couple weeks ago and must have missed this one because it's owned by DE.
Resolves: #202700
Summary
This PR resolves an issue where an ML job referenced by a rule does not appear in the Rule Details, Upgrade flyout, or Rule Editing pages if the job is missing or not yet created.
For example, if you had an ML rule with a single selected job and this job was not available, you would see a blank space instead of job name.
Screenshots
Rule Details: Before

Rule Details: After

Rule Edit: Before

Rule Edit: After

Upgrade flyout: Before

Upgrade flyout: After

Testing
You can test by removing an ML job referenced by a rule in
http://localhost:<port>/kbn/app/ml/jobs
.