-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Fleet] Fix EPR and custom integration categories merge #153221
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
Conversation
| export const INTEGRATION_CATEGORY_DISPLAY: { | ||
| [key: string]: { title: string; parent_id?: string }; | ||
| } = { | ||
| aws: { title: 'AWS', parent_id: undefined }, |
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.
Properties needed to be expanded to better handle the merge logic described in PR
The list here will be updated in #153216 for 8.8
|
Pinging @elastic/fleet (Team:Fleet) |
criamico
left a comment
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.
I don't yet see the new subcategories so I couldn't check all the edge cases.
Code LGTM 🚢
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: cc @jen-huang |
## Summary While testing elastic/integrations#5123 and elastic#153216, I discovered two problems with the list of categories on the Browse integration page: 1. The categories list doesn't respect `showIntegrationsSubcategories` feature flag. When it is turned off, it will still only display top-level parent categories. This PR fixes that so that when `showIntegrationsSubcategories` is turned off, _all_ categories will be listed on the left sidebar. When it is turned on, only the top-level categories will be listed. 2. The merging of the categories list from EPR (i.e. `<EPR_HOST>/categories`) with the categories hard-coded in Kibana for custom integration cards is flawed: there can be a situation where a category or subcategory is not returned by EPR, due to no EPR-hosted integrations having it, but it is registered by a custom card. In this case, the category is missing from the list. This PR fixes the merging logic. (cherry picked from commit 340ee10)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… (#153225) # Backport This will backport the following commits from `main` to `8.7`: - [[Fleet] Fix EPR and custom integration categories merge (#153221)](#153221) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jen Huang","email":"its.jenetic@gmail.com"},"sourceCommit":{"committedDate":"2023-03-15T15:54:16Z","message":"[Fleet] Fix EPR and custom integration categories merge (#153221)\n\n## Summary\r\n\r\nWhile testing elastic/integrations#5123 and\r\nhttps://github.com//pull/153216, I discovered two problems\r\nwith the list of categories on the Browse integration page:\r\n\r\n1. The categories list doesn't respect `showIntegrationsSubcategories`\r\nfeature flag. When it is turned off, it will still only display\r\ntop-level parent categories. This PR fixes that so that when\r\n`showIntegrationsSubcategories` is turned off, _all_ categories will be\r\nlisted on the left sidebar. When it is turned on, only the top-level\r\ncategories will be listed.\r\n2. The merging of the categories list from EPR (i.e.\r\n`<EPR_HOST>/categories`) with the categories hard-coded in Kibana for\r\ncustom integration cards is flawed: there can be a situation where a\r\ncategory or subcategory is not returned by EPR, due to no EPR-hosted\r\nintegrations having it, but it is registered by a custom card. In this\r\ncase, the category is missing from the list. This PR fixes the merging\r\nlogic.","sha":"340ee100869f13d86a12736e3e840eea806cb5cd","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.8.0"],"number":153221,"url":"https://github.com/elastic/kibana/pull/153221","mergeCommit":{"message":"[Fleet] Fix EPR and custom integration categories merge (#153221)\n\n## Summary\r\n\r\nWhile testing elastic/integrations#5123 and\r\nhttps://github.com//pull/153216, I discovered two problems\r\nwith the list of categories on the Browse integration page:\r\n\r\n1. The categories list doesn't respect `showIntegrationsSubcategories`\r\nfeature flag. When it is turned off, it will still only display\r\ntop-level parent categories. This PR fixes that so that when\r\n`showIntegrationsSubcategories` is turned off, _all_ categories will be\r\nlisted on the left sidebar. When it is turned on, only the top-level\r\ncategories will be listed.\r\n2. The merging of the categories list from EPR (i.e.\r\n`<EPR_HOST>/categories`) with the categories hard-coded in Kibana for\r\ncustom integration cards is flawed: there can be a situation where a\r\ncategory or subcategory is not returned by EPR, due to no EPR-hosted\r\nintegrations having it, but it is registered by a custom card. In this\r\ncase, the category is missing from the list. This PR fixes the merging\r\nlogic.","sha":"340ee100869f13d86a12736e3e840eea806cb5cd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/153221","number":153221,"mergeCommit":{"message":"[Fleet] Fix EPR and custom integration categories merge (#153221)\n\n## Summary\r\n\r\nWhile testing elastic/integrations#5123 and\r\nhttps://github.com//pull/153216, I discovered two problems\r\nwith the list of categories on the Browse integration page:\r\n\r\n1. The categories list doesn't respect `showIntegrationsSubcategories`\r\nfeature flag. When it is turned off, it will still only display\r\ntop-level parent categories. This PR fixes that so that when\r\n`showIntegrationsSubcategories` is turned off, _all_ categories will be\r\nlisted on the left sidebar. When it is turned on, only the top-level\r\ncategories will be listed.\r\n2. The merging of the categories list from EPR (i.e.\r\n`<EPR_HOST>/categories`) with the categories hard-coded in Kibana for\r\ncustom integration cards is flawed: there can be a situation where a\r\ncategory or subcategory is not returned by EPR, due to no EPR-hosted\r\nintegrations having it, but it is registered by a custom card. In this\r\ncase, the category is missing from the list. This PR fixes the merging\r\nlogic.","sha":"340ee100869f13d86a12736e3e840eea806cb5cd"}}]}] BACKPORT--> Co-authored-by: Jen Huang <its.jenetic@gmail.com>
Summary
While testing elastic/integrations#5123 and #153216, I discovered two problems with the list of categories on the Browse integration page:
showIntegrationsSubcategoriesfeature flag. When it is turned off, it will still only display top-level parent categories. This PR fixes that so that whenshowIntegrationsSubcategoriesis turned off, all categories will be listed on the left sidebar. When it is turned on, only the top-level categories will be listed.<EPR_HOST>/categories) with the categories hard-coded in Kibana for custom integration cards is flawed: there can be a situation where a category or subcategory is not returned by EPR, due to no EPR-hosted integrations having it, but it is registered by a custom card. In this case, the category is missing from the list. This PR fixes the merging logic.