-
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] fixes Data Quality dashboard errors when a basePath
is configured
#156233
[Security Solution] fixes Data Quality dashboard errors when a basePath
is configured
#156233
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
Files by Code Ownerelastic/security-threat-hunting-explore
|
jest.clearAllMocks(); | ||
|
||
render( | ||
<TestProviders> | ||
<DataQualityDetails {...defaultProps} /> | ||
</TestProviders> | ||
); | ||
|
||
await waitFor(() => {}); |
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.
why?
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.
Guessing it's to make sure the DataQuality dashboard renders? Either way, do you mind adding a comment for these @andrew-goldstein ? 😄
@@ -200,46 +202,50 @@ const DataQualityComponent: React.FC = () => { | |||
[createCaseFlyout] | |||
); | |||
|
|||
if (isSourcererLoading) { |
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.
if (isSourcererLoading) { | |
if (isSourcererLoading || isSignalIndexNameLoading) { |
Why not move both conditions up?
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, I can finally run with my base path 🎉 just a few minor comments, LGTM. Thanks for the fix!
jest.clearAllMocks(); | ||
}); | ||
|
||
describe('happy path', () => { |
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.
nit: If you do end up adding another commit, can you re-label this to successful response from ilm endpoint
or something.. This is fine too, just not the most descriptive 😄
jest.clearAllMocks(); | ||
}); | ||
|
||
describe('happy path', () => { |
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.
samesies if you end up adding a commit
mockHttpFetch.mockResolvedValue(mockStatsGreenIndex); | ||
}); | ||
|
||
test('it returns the expected stats', async () => { |
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.
Side question. I've seen it debated on a few PR's. Do you consider a benefit to having separate test blocks vs multiple expects in a single test block? Or even just testing the whole result.current
object in one test?
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.
Side question. I've seen it debated on a few PR's. Do you consider a benefit to having separate test blocks vs multiple expects in a single test block? Or even just testing the whole
result.current
object in one test?
I generally prefer to read and write "one assertion per test". That said, these tests had redundant test setup code. Per our offline discussion, I refactored-out the redundant setup code, and applied this pattern to the other test files in this PR.
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.
Nice work! Tested locally with and without a basePath, and just for completeness, multiple spaces in each. Everything looks to be working as expected. Thanks for getting this fix in!
…sePath` is configured This PR implements a fix for an [issue](elastic#156231) where the Data Quality dashboard displays errors when a `basePath` is configured, preventing indices from being checked. ### Desk testing - Verify the fix per the reporduction steps in <elastic#156231> - Also verify the page still behaves correctly when Kibana is started with no base path, via: ``` yarn start --no-base-path ``` ### Before / after screenshots **Before:** ![before](https://user-images.githubusercontent.com/4459398/235273609-952fd7e4-0a22-4344-b1e4-48411c6d0e33.png) _Above: Before the fix, errors occur when a `basePath` is configured_ **After:** ![after](https://user-images.githubusercontent.com/4459398/235276257-c62feb05-699a-418c-8da2-b90b6683e5b4.png) _Above: After the fix, errors do NOT occur_
f891f21
to
8ebf765
Compare
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…ath` is configured (elastic#156233) ## [Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured This PR implements a fix for an [issue](elastic#156231) where the Data Quality dashboard displays errors when a `basePath` is configured, preventing indices from being checked. ### Desk testing - Verify the fix per the reporduction steps in <elastic#156231> - Also verify the page still behaves correctly when Kibana is started with no base path, via: ``` yarn start --no-base-path ``` ### Before / after screenshots **Before:** ![before](https://user-images.githubusercontent.com/4459398/235273609-952fd7e4-0a22-4344-b1e4-48411c6d0e33.png) _Above: Before the fix, errors occur when a `basePath` is configured_ **After:** ![after](https://user-images.githubusercontent.com/4459398/235276257-c62feb05-699a-418c-8da2-b90b6683e5b4.png) _Above: After the fix, errors do NOT occur_ (cherry picked from commit 3389a2b)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…`basePath` is configured (#156233) (#156730) # Backport This will backport the following commits from `main` to `8.8`: - [[Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured (#156233)](#156233) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-04T19:24:39Z","message":"[Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured (#156233)\n\n## [Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured\r\n\r\nThis PR implements a fix for an [issue](#156231) where the Data Quality dashboard displays errors when a `basePath` is configured, preventing indices from being checked.\r\n\r\n### Desk testing\r\n\r\n- Verify the fix per the reporduction steps in <https://github.com/elastic/kibana/issues/156231>\r\n- Also verify the page still behaves correctly when Kibana is started with no base path, via:\r\n\r\n```\r\nyarn start --no-base-path\r\n```\r\n\r\n### Before / after screenshots\r\n\r\n**Before:**\r\n\r\n![before](https://user-images.githubusercontent.com/4459398/235273609-952fd7e4-0a22-4344-b1e4-48411c6d0e33.png)\r\n\r\n_Above: Before the fix, errors occur when a `basePath` is configured_\r\n\r\n**After:**\r\n\r\n![after](https://user-images.githubusercontent.com/4459398/235276257-c62feb05-699a-418c-8da2-b90b6683e5b4.png)\r\n\r\n_Above: After the fix, errors do NOT occur_","sha":"3389a2b35bf65fbb32ab10769997d4a210e95607","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team: SecuritySolution","Team:Threat Hunting:Investigations","v8.8.0","v8.9.0"],"number":156233,"url":"https://github.com/elastic/kibana/pull/156233","mergeCommit":{"message":"[Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured (#156233)\n\n## [Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured\r\n\r\nThis PR implements a fix for an [issue](#156231) where the Data Quality dashboard displays errors when a `basePath` is configured, preventing indices from being checked.\r\n\r\n### Desk testing\r\n\r\n- Verify the fix per the reporduction steps in <https://github.com/elastic/kibana/issues/156231>\r\n- Also verify the page still behaves correctly when Kibana is started with no base path, via:\r\n\r\n```\r\nyarn start --no-base-path\r\n```\r\n\r\n### Before / after screenshots\r\n\r\n**Before:**\r\n\r\n![before](https://user-images.githubusercontent.com/4459398/235273609-952fd7e4-0a22-4344-b1e4-48411c6d0e33.png)\r\n\r\n_Above: Before the fix, errors occur when a `basePath` is configured_\r\n\r\n**After:**\r\n\r\n![after](https://user-images.githubusercontent.com/4459398/235276257-c62feb05-699a-418c-8da2-b90b6683e5b4.png)\r\n\r\n_Above: After the fix, errors do NOT occur_","sha":"3389a2b35bf65fbb32ab10769997d4a210e95607"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156233","number":156233,"mergeCommit":{"message":"[Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured (#156233)\n\n## [Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured\r\n\r\nThis PR implements a fix for an [issue](#156231) where the Data Quality dashboard displays errors when a `basePath` is configured, preventing indices from being checked.\r\n\r\n### Desk testing\r\n\r\n- Verify the fix per the reporduction steps in <https://github.com/elastic/kibana/issues/156231>\r\n- Also verify the page still behaves correctly when Kibana is started with no base path, via:\r\n\r\n```\r\nyarn start --no-base-path\r\n```\r\n\r\n### Before / after screenshots\r\n\r\n**Before:**\r\n\r\n![before](https://user-images.githubusercontent.com/4459398/235273609-952fd7e4-0a22-4344-b1e4-48411c6d0e33.png)\r\n\r\n_Above: Before the fix, errors occur when a `basePath` is configured_\r\n\r\n**After:**\r\n\r\n![after](https://user-images.githubusercontent.com/4459398/235276257-c62feb05-699a-418c-8da2-b90b6683e5b4.png)\r\n\r\n_Above: After the fix, errors do NOT occur_","sha":"3389a2b35bf65fbb32ab10769997d4a210e95607"}}]}] BACKPORT--> Co-authored-by: Andrew Macri <[email protected]>
* main: (153 commits) [Security Solution] {{state.signals_count}} Object not working (#156472) (#156707) [Synthetics] refresh data on visualization scrubbing (#156777) [RAM] Docs for slack improvements (#153885) [RAM] Alert search bar only KQL (#155947) [ML] Functional tests - stabilize export job tests (#156586) [Saved Search] Update saved search schema to allow empty `sort` arrays (#156769) [ML] Rename `curated` model type to `elastic` (#156684) [Discover] Enable sharing for text based languages (#156652) [api-docs] 2023-05-05 Daily api_docs build (#156781) Upgrade EUI to v77.2.2 (#155208) [RAM][Maintenance Window][8.8]Fix window maintenance workflow (#156427) [DOCS] Case file attachments (#156459) [D4C] additional error handling for 'block' action added + policy editor UI fixes (#156629) [Enterprise Search] refactor(SearchApplications): rename telemetry ids (#156733) [Enterprise Search] Add telemetry to ELSER deployment buttons + error (#156545) [Security Solution] fixes Data Quality dashboard errors when a `basePath` is configured (#156233) [Logs onboarding] StepsFooter outside of main panel (#156686) [Security Solution] Add a migration to unmute custom Security Solution rules (#156593) [Enterprise Search][Behavioral Analytics] Update formulas (#156704) Add API Events to Endpoint Security Advanced Policy (#156718) ...
[Security Solution] fixes Data Quality dashboard errors when a
basePath
is configuredThis PR implements a fix for an issue where the Data Quality dashboard displays errors when a
basePath
is configured, preventing indices from being checked.Desk testing
basePath
is configured #156231Before / after screenshots
Before:
Above: Before the fix, errors occur when a
basePath
is configuredAfter:
Above: After the fix, errors do NOT occur