-
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
[Cloud Security] Fix for console error message in rules benchmark page #177887
Conversation
/ci |
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
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.
we can go with either method, but why not only calling the API when the array is not empty?
no reason, when i made this change, the first thing that came up into my mind is just this solution |
in that case i think not calling the API is a slightly better solution, consider making this change before merge |
…a into rules-page-console-error
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
elastic#177887) ## Summary Currently in Rules benchmark page, users seems to be getting error message in their console (not affecting the UI). This error is caused by malformed request to detection rule API and this is due to us sending an empty Array. This is not a problem on other component as in other component the API is called after users clicks to open the component which will in turn fill in the array which means the array is never empty. This is not the issue with this case as the API is called even in the beginning The solution in this PR is basically just giving default return value if its ever empty
elastic#177887) ## Summary Currently in Rules benchmark page, users seems to be getting error message in their console (not affecting the UI). This error is caused by malformed request to detection rule API and this is due to us sending an empty Array. This is not a problem on other component as in other component the API is called after users clicks to open the component which will in turn fill in the array which means the array is never empty. This is not the issue with this case as the API is called even in the beginning The solution in this PR is basically just giving default return value if its ever empty
elastic#177887) ## Summary Currently in Rules benchmark page, users seems to be getting error message in their console (not affecting the UI). This error is caused by malformed request to detection rule API and this is due to us sending an empty Array. This is not a problem on other component as in other component the API is called after users clicks to open the component which will in turn fill in the array which means the array is never empty. This is not the issue with this case as the API is called even in the beginning The solution in this PR is basically just giving default return value if its ever empty (cherry picked from commit c1ccb1d)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ark page (#177887) (#178039) # Backport This will backport the following commits from `main` to `8.13`: - [[Cloud Security] Fix for console error message in rules benchmark page (#177887)](#177887) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Rickyanto Ang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-03-03T22:12:41Z","message":"[Cloud Security] Fix for console error message in rules benchmark page (#177887)\n\n## Summary\r\n\r\nCurrently in Rules benchmark page, users seems to be getting error\r\nmessage in their console (not affecting the UI).\r\n\r\nThis error is caused by malformed request to detection rule API and this\r\nis due to us sending an empty Array. This is not a problem on other\r\ncomponent as in other component the API is called after users clicks to\r\nopen the component which will in turn fill in the array which means the\r\narray is never empty. This is not the issue with this case as the API is\r\ncalled even in the beginning\r\n\r\nThe solution in this PR is basically just giving default return value if\r\nits ever empty","sha":"c1ccb1d3d3dbce9dac1bf96c2ddb99a31f233b85","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Cloud Security","backport:prev-minor","v8.13.0","v8.14.0"],"title":"[Cloud Security] Fix for console error message in rules benchmark page","number":177887,"url":"https://github.com/elastic/kibana/pull/177887","mergeCommit":{"message":"[Cloud Security] Fix for console error message in rules benchmark page (#177887)\n\n## Summary\r\n\r\nCurrently in Rules benchmark page, users seems to be getting error\r\nmessage in their console (not affecting the UI).\r\n\r\nThis error is caused by malformed request to detection rule API and this\r\nis due to us sending an empty Array. This is not a problem on other\r\ncomponent as in other component the API is called after users clicks to\r\nopen the component which will in turn fill in the array which means the\r\narray is never empty. This is not the issue with this case as the API is\r\ncalled even in the beginning\r\n\r\nThe solution in this PR is basically just giving default return value if\r\nits ever empty","sha":"c1ccb1d3d3dbce9dac1bf96c2ddb99a31f233b85"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177887","number":177887,"mergeCommit":{"message":"[Cloud Security] Fix for console error message in rules benchmark page (#177887)\n\n## Summary\r\n\r\nCurrently in Rules benchmark page, users seems to be getting error\r\nmessage in their console (not affecting the UI).\r\n\r\nThis error is caused by malformed request to detection rule API and this\r\nis due to us sending an empty Array. This is not a problem on other\r\ncomponent as in other component the API is called after users clicks to\r\nopen the component which will in turn fill in the array which means the\r\narray is never empty. This is not the issue with this case as the API is\r\ncalled even in the beginning\r\n\r\nThe solution in this PR is basically just giving default return value if\r\nits ever empty","sha":"c1ccb1d3d3dbce9dac1bf96c2ddb99a31f233b85"}}]}] BACKPORT--> Co-authored-by: Rickyanto Ang <[email protected]>
Summary
Currently in Rules benchmark page, users seems to be getting error message in their console (not affecting the UI).
This error is caused by malformed request to detection rule API and this is due to us sending an empty Array. This is not a problem on other component as in other component the API is called after users clicks to open the component which will in turn fill in the array which means the array is never empty. This is not the issue with this case as the API is called even in the beginning
The solution in this PR is basically just giving default return value if its ever empty