-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add subcategories definitions #914
Conversation
c379893
to
9e72c5d
Compare
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.
Should we state somewhere in the code that categories shouldn't have more than 1 nested level for now?
categories/categories.yml
Outdated
subcategories: | ||
app_search: | ||
title: "Application Search" | ||
connector: # TODO: Do we want three different connector categories? |
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.
@mukeshelastic @nimarezainia would you be able to weight in here? Do we want three categories?
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.
yes, let's limit the subcategories to only one level depth.. category -> subcategory. And author can specify only one subcategory
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.
And author can specify only one subcategory
Does it mean that a package can have only a subcategory? We don't have this limitation with categories, and this may complicate things.
categories/categories.go
Outdated
// TODO: Check for duplicated categories. | ||
return categoriesFile.Categories, nil |
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 was thinking just about those possible duplicated categories. Could a category be defined as a subcategory of more than category?
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.
This won't be possible with the current approach. We will need to use conventions (like network_security
vs. network_monitoring
) if we want something to be a subcategory in two different categories.
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.
Another option may be to require the use of subcategories in namespaced names, that would be to require to use subcategories as this for example:
categories:
- containers
- security.network
This would be a package that belongs to the containers
category and to the security
's network
subcategory.
This has the limitation that we cannot reorganize categories, like may happen if we decide to move current thread_intel
to be a security
subcategory.
Btw, notice that using another field for subcategories doesn't solve this problem. If for example we have network
as subcategory of security
and monitoring
, we wouldn't know to what category network
would be refering in a case like this one:
categories:
- security
- monitoring
subcategories:
- network
Current code doesn't support nesting categories. I have added also a comment to the header of the yaml file. |
Updated list of categories adding the ones I missed. There are still some open questions, they are as TODOs in the yml, but grouping them:
@jlind23 @mukeshelastic @dborodyansky please take a look to these open questions. I can also take the decision, but I may be overlooking something. |
Maybe we should ask the relevant peers from the solution teams to review and signoff? |
@jsoriano my answers below
This one will provide more clarity and avoid duplication problems in the near future.
Looking at the work done by @dborodyansky I would rather remove the old categories and display the ones. @kpollich could this be a breaking change on the UI end? Don't we have some hard coded featured integration that relies on some categories?
Keeping subcategories with different suffixes is the best path forward, we might have observability users eager to find monitoring related integrations under the observability umbrella and who won't take a look under the infrastructure umbrella for example.
We should keep them for now. The line about adding more categories was already explained by Akshay in this document: |
There is some hardcoding related to categories in the custom integrations plugin here: https://github.com/elastic/kibana/blob/2c774f536e2cd0b01b8829d842684e67df2c3d57/src/plugins/custom_integrations/common/index.ts We'll need to align this file to the new categories/subcategories concept in general, but if there are any renames we should tackle those first to avoid breakage. |
Thanks @jlind23 for your clarifications, a couple of follow ups:
👍
Removing categories is not an option, at least without breaking changes. The closer option would be option two, keeping old categories, but changing the titles.
👍 Regarding the current main
Or keep the three categories:
👍 |
Sorry I meant option 2 only after checking with @kpollich that this doesn't have any impact on the UI. |
TODOs resolved, and API changed, please review. |
"count": 14 | ||
"title": "Web Server", | ||
"count": 14, | ||
"subcategory_of": "infrastructure" | ||
} |
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.
These will be the changes in the API:
- Titles updated for some categories.
subcategory_of
added in subcategories.
"count": 3 | ||
"title": "Web Server", | ||
"count": 3, | ||
"subcategory_of": "infrastructure" |
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.
@kpollich with this API response, Fleet is not going to be able to get the title of the parent category, should I change this to something like this?
"subcategory_of": "infrastructure" | |
"parent_id": "infrastructure", | |
"parent_name": "Infrastructure" |
An alternative could be to include the parent category in the response, but this could affect current versions of kibana that would receive categories with count 0.
This also makes me wonder if we want to modify the search APIs, to include packages of subcategories, when searching for a main category. That would for example be to include packages of the web
subcategory, when looking for the integration
category.
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.
with this API response, Fleet is not going to be able to get the title of the parent category, should I change this to something like this?
It seems like the issue is that integrations can be placed in a subcategory even if there are no integrations placed in the parent category, resulting in a case where the parent category is not included in the response.
So we have a state like this
I think returning the parent_name
would be most helpful here, as it allows the UI to render the Infrastructure
category in this case even if it does not directly contain any integrations.
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.
PR updated to include the parent_name
in the API response, @kpollich please take another look.
Subcategories support.
It models the categories with the subcategories, loading them from a yaml file. We can consider later to move this yaml file to the spec so it can be also consumed from other places.
New
parent_id
andparent_name
fields are added to subcategories in the API.Part of elastic/package-spec#451.