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] Fixes elastic/kibana#84757 Use basePath in getAppOverviewUrl #87245

Conversation

kqualters-elastic
Copy link
Contributor

@kqualters-elastic kqualters-elastic commented Jan 4, 2021

Summary

Fixes #84757 by making use of basePath in the getAppOverviewUrl function used in SIEM navigation components.

image

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@kqualters-elastic kqualters-elastic added bug Fixes for quality problems that affect the customer experience v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.12.0 Team:Threat Hunting Security Solution Threat Hunting Team labels Jan 4, 2021
@kqualters-elastic kqualters-elastic requested review from a team as code owners January 4, 2021 21:57
@kqualters-elastic
Copy link
Contributor Author

@elasticmachine merge upstream

): ChromeBreadcrumb[] | null => {
const spyState: RouteSpyState = omit('navTabs', object);
const siemRootBreadcrumb = fullSiemRootBreadcrumb(basePath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it's worth it but do we need to add tests for this specific functionality? Like a test using a base path and checking that the SIEM URL includes it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add

@@ -128,7 +127,7 @@ describe('Navigation Breadcrumbs', () => {
);
expect(breadcrumbs).toEqual([
{
href: '/app/security/overview',
href: 'securitySolutionoverview',
Copy link
Contributor

@jonathan-buttner jonathan-buttner Jan 5, 2021

Choose a reason for hiding this comment

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

nit: took me a second to figure out why this changed. I believe it's because of the mock on 112 that's doing:

const getUrlForAppMock = (appId: string, options?: { path?: string; absolute?: boolean }) =>
  `${appId}${options?.path ?? ''}`;	

That's used instead of this right?

getUrlForApp(APP_ID, { path: SecurityPageName.overview }),

from here: https://github.com/elastic/kibana/pull/87245/files#diff-8c78fbdebc67d5ff9388db4a66a58416997b3745367d7c49d88a7834d963eec2R77

Maybe a comment explaining why it's no longer /app/security/overview?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment explaining that the mock function returns not an actual url.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, took me a sec to realize it was just replacing the APP_OVERVIEW_PATH const. Thanks

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 8.5MB 8.5MB +380.0B

Distributable file count

id before after diff
default 47252 48012 +760

History

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

@kqualters-elastic kqualters-elastic merged commit ebc119d into elastic:master Jan 6, 2021
@kqualters-elastic kqualters-elastic deleted the siem-breadcrumbs-respect-basepath branch January 6, 2021 19:20
kqualters-elastic added a commit that referenced this pull request Jan 7, 2021
…87245) (#87559)

* Use basePath in getAppOverviewUrl


Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
kqualters-elastic added a commit that referenced this pull request Jan 19, 2021
…87245) (#88754)

* Use basePath in getAppOverviewUrl


Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] server.basePath not honoured everywhere in SIEM app
4 participants