-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement filtering on tags in Filter model #117
Comments
Unless we add a safe regex-editor, we shouldn't allow regexes. It's too easy to create a DoS. |
Hmmm, something to show how serious the source system considers the problem (severity/priority/whetever) will need to be filterable as well. If that is just single-digit integers it should be easy to make a filter: a list of all levels wanted :) |
I think the third type is the most viable and what most closely resembles the old system. We could also support:
I'll check the old code for how things worked with explicit object/parent_object/problemtype regarding boolean combinations. |
What I'd really like to have is that every filter in the same type is an OR while filters of different types is an AND. So that:
is interpreted as
Thinking some more, being able to filter on tags with |
Wait, which third type? This one?
I think I'd prefer the dictionary format over this one, as it's more verbose, and therefore easier to read and harder to get wrong 😅
Yes, this is already implemented 🙂 |
Not fun sending a dictionary in a get-query though :) Anyway, just being able to filter on complete tags would be great. |
.. and we need to be able to filter on source type! |
Source type: On creation of a source type, we create a tag for that source type, with no connected incidents. It strikes me, we could have a "source" tag as well, hiding that part of the data model from the end user. It would then be a matter of just sending a list of tags when wanting to filter, an array, not a dict. |
Hm, I'm not really a fan of that idea.. The frontend might very well choose to display it that way, but I think the backend should use what is already implemented, without having to create "symbolic" tags. When it comes to sending arrays vs dicts, I think it shouldn't really be an argument that it's a "hassle" to send dicts, as the request parameters and bodies are not meant to be manually written anyway. |
Thinking out loud: There will be very few SourceSystemTypes. There can be potentially very many SourceSystems, objects, parent_objects, problem_types. This will affect the UI. If there is a "tags" column in the UI, the simplest way to make a filter is to click on the tags of a row. It might be relevant to give a subset of tags (like source system type, source?) their own column. This needs some mockups I think. |
Why not allow writing it manually? In a GET I mean. |
It's a matter of consistency, and using one system for filtering instead of combining several. Say you have (Or, hm, |
Well sure, we can absolutely allow that! I just don't think we should design it around being easy to write manually, as that should only be for manual testing. The design that makes the backend (and frontend) code and preferably the (prettified) request data most readable should be chosen, I think. We can add multiple endpoints that are "manual testing-friendly" as well, though, if the need is high enough.
In this case, I would have preferred the query string to look like this:
|
I'm not sure I'm following.. Could you explain where these columns and rows would be in the UI, and how they're used? Regarding the design of how a user filters on tags in the frontend, @jorgenbele and I had a discussion and came up with the following proposal:
|
We'd need mockups. Better to draw something in a hurry, check with end users in a user test, then implement, than implement first and have to make endless adjustments. |
So in sum: one form-field for sources, one for tags, both autocomplete? Another form field for source type? |
We didn't discuss that specifically - other than that tags would have its own form field, but yes, that sounds like a viable solution to me 🙂 |
We still need to be able to filter in the API, but not in this issue.Closing... |
A couple ideas:
"tags__key": ["nav_problem", "zabbix_problem"]
"tags__value": ["Netbox 4", "boxDown"]
No double underscores would filter on both key AND value:
"tags": ["object=Netbox 4", "problem_type=boxDown"]
And we could potentially also add support for e.g. regex:
"tags__value__regex": ["Netbox [0-9]+", "^https://argus\..*"]
"tags": ["object=Netbox 4", "problem_type=boxDown"]
Both of these ideas could benefit from being more fleshed out.
The text was updated successfully, but these errors were encountered: