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 Solutions] Fix link to ML Job is wrong when searching within ML Job Settings UI #150881

Merged
merged 3 commits into from Feb 13, 2023

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Feb 10, 2023

issue: #150875

Summary

Describe the bug:
The link to an ML job is wrong when searching for a job.

Steps to reproduce:

  1. Open ML Job Settings UI
  2. Type DNS in the search bar
  3. Verify that the links have the wrong job Id.

Before

Feb-10-2023.14-13-34.mp4

After

Feb-10-2023.14-34-56.mov

@machadoum machadoum self-assigned this Feb 10, 2023
@machadoum machadoum added v8.7.0 v8.8.0 release_note:fix Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore labels Feb 10, 2023
@machadoum machadoum marked this pull request as ready for review February 10, 2023 13:41
@machadoum machadoum requested review from a team as code owners February 10, 2023 13:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@machadoum machadoum changed the title Fix link to ML Job is wrong when searching within ML Job Settings UI [Security Solutions] Fix link to ML Job is wrong when searching within ML Job Settings UI Feb 10, 2023
Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

@machadoum changes LGTM.

Interesting that this bug wasn't discovered earlier and useMLHref didn't expose dependencies array.

I found another occurrence as well which should be fixed most probably.

The only problem I see now is that linter doesn't help with dependencies so there is a chance that the problem will return in the new code. Maybe ML folks will be able to fix it somehow differently, for example use job id under the hood so we can be much more secure while using this hook.

@machadoum machadoum requested a review from a team as a code owner February 13, 2023 09:25
Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

ML changes LGTM

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

Looks good and the link works. I just left one minor comment.

) => {
return ml && ml.locator
? ml.locator!.useUrl(params)
? ml.locator!.useUrl(params, undefined, dependencies)
Copy link
Contributor

Choose a reason for hiding this comment

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

We are already checking if ml.locator isn't undefined, the ! can be removed.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
ml 79 80 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 1.3MB 1.3MB +4.0B
securitySolution 13.8MB 13.8MB +60.0B
total +64.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 42.5KB 42.5KB +11.0B
Unknown metric groups

API count

id before after diff
ml 255 256 +1

History

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

cc @machadoum

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGMT!

@machadoum machadoum merged commit 2315285 into elastic:main Feb 13, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 13, 2023
…n ML Job Settings UI (elastic#150881)

issue: elastic#150875

## Summary
Describe the bug:
The link to an ML job is wrong when searching for a job.

Steps to reproduce:
1. Open ML Job Settings UI
2. Type DNS in the search bar
3. Verify that the links have the wrong job Id.

### Before

https://user-images.githubusercontent.com/1490444/218104808-94c93669-2de3-4fba-88c9-5f2b7ccaa391.mp4

### After

https://user-images.githubusercontent.com/1490444/218105267-b5aa118c-9d78-4648-9892-68afd5e2707f.mov
(cherry picked from commit 2315285)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.7

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 Feb 13, 2023
… within ML Job Settings UI (#150881) (#150999)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solutions] Fix link to ML Job is wrong when searching
within ML Job Settings UI
(#150881)](#150881)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2023-02-13T12:30:26Z","message":"[Security
Solutions] Fix link to ML Job is wrong when searching within ML Job
Settings UI (#150881)\n\nissue:
#150875
Summary\r\nDescribe the bug:\r\nThe link to an ML job is wrong when
searching for a job.\r\n\r\nSteps to reproduce:\r\n1. Open ML Job
Settings UI\r\n2. Type DNS in the search bar\r\n3. Verify that the links
have the wrong job Id.\r\n\r\n###
Before\r\n\r\nhttps://user-images.githubusercontent.com/1490444/218104808-94c93669-2de3-4fba-88c9-5f2b7ccaa391.mp4\r\n\r\n###
After\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/1490444/218105267-b5aa118c-9d78-4648-9892-68afd5e2707f.mov","sha":"2315285e37274d8aa724d517055a34272efbe3d7","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Threat
Hunting","Team: SecuritySolution","Team:Threat
Hunting:Explore","v8.7.0","v8.8.0"],"number":150881,"url":"#150881
Solutions] Fix link to ML Job is wrong when searching within ML Job
Settings UI (#150881)\n\nissue:
#150875
Summary\r\nDescribe the bug:\r\nThe link to an ML job is wrong when
searching for a job.\r\n\r\nSteps to reproduce:\r\n1. Open ML Job
Settings UI\r\n2. Type DNS in the search bar\r\n3. Verify that the links
have the wrong job Id.\r\n\r\n###
Before\r\n\r\nhttps://user-images.githubusercontent.com/1490444/218104808-94c93669-2de3-4fba-88c9-5f2b7ccaa391.mp4\r\n\r\n###
After\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/1490444/218105267-b5aa118c-9d78-4648-9892-68afd5e2707f.mov","sha":"2315285e37274d8aa724d517055a34272efbe3d7"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"#150881
Solutions] Fix link to ML Job is wrong when searching within ML Job
Settings UI (#150881)\n\nissue:
#150875
Summary\r\nDescribe the bug:\r\nThe link to an ML job is wrong when
searching for a job.\r\n\r\nSteps to reproduce:\r\n1. Open ML Job
Settings UI\r\n2. Type DNS in the search bar\r\n3. Verify that the links
have the wrong job Id.\r\n\r\n###
Before\r\n\r\nhttps://user-images.githubusercontent.com/1490444/218104808-94c93669-2de3-4fba-88c9-5f2b7ccaa391.mp4\r\n\r\n###
After\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/1490444/218105267-b5aa118c-9d78-4648-9892-68afd5e2707f.mov","sha":"2315285e37274d8aa724d517055a34272efbe3d7"}}]}]
BACKPORT-->

Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.7.0 v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants