-
Notifications
You must be signed in to change notification settings - Fork 300
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 support for Dynamic / arbitrary groups of objects #896
Comments
I was thinking the UI can be extended for how RBAC creates attribute based access control (ABAC) and used here as well. |
I think there's room for some clarification here - in some past conversations "dynamic" groups have implied the ability to define a set of group membership criteria and have the members of the group automatically (dynamically) determined based on those criteria, as opposed to manually defined groups wherein the user creates a group and manually assigns each member into the group. Or to put it another way, once I have dynamic groups defined (based on querysets or other filtering criteria), and I create a new object/record that matches those criteria, is it expected to automatically become a member of all applicable groups, or is it on me as the user to assign it into those groups myself? |
To clarify what I had in mind, I created the included wireframe. Some notes:
|
It should be "dynamic" for this feature. Given #892, that FR may end up being the "static" part of this feature. @itdependsnetworks with what you are showing, are you just showing that as a way to build the groups as an option vs. quersyet vs. regex, etc. ? |
This is a potential UI design for queryset |
Some initial thoughts/ideas/brainstorming:
|
I've been thinking A LOT about this and I've tried different options in the last few months that I think are interesting for this discussion. When we are talking about
Based on these requirements, there are multiple aspects to consider:
Language of the QueryAs far as I know in Nautobot we have 2 types of Query languages :
A Compatibility with the UI & APIThere are few situations to consider:
QuerysetWe are using
Filterset
PerformanceThe dynamic calculation is interesting because there is really 2 ways to process that : A is very important when we want to execute a workflow on a given list of devices and B is important when an object need to retrieve all the properties of the groups it's part of (config Context)
ConclusionTo conclude this long brain dump Both
I have some ideas that I would like to try that I think would match all these criteria Please me know if I'm missing an important part or if I got something wrong |
To add to @glennmatthews 's brainstorming point about group of groups, as the plugin author I would like for following:
Allow for "group expressions". Maintaining the relationships between groups quickly become cumbersome, thus I would like to allow my plugin for following queries:
Allow to statically group instances of objects. Statically groups objects are to fill the use case of exceptions. Once most of the objects would be handled via dynamic groups, we should consider how to handle exceptions too.
I think we are missing the point what kind of interface should be provided for plugin authors. The goal is to simplify the developer's experience, thus developer's should not be re-implementing the object groupping / exceptions etc. As of today, some of the plugins are already reported for the improvements in terms of how objects are selected. |
@mzbroch regarding static groups, the thought was we would at a minimum have RegEx to build dynamic groups and thus, could have multiple RegEx's using exact matches yielding what would be a static group. Group expressions is an interesting idea. I'm sure there are multiple ways to do this, but will remind us of Ansible inventory patterns. Maybe this is an add-on or power-use method for expressions in the future. @dgarros Thanks for the PR on the prototype (#1047 ). The initial thought was to have a UI similar to what @itdependsnetworks proposed above with a row per filter criteria. The filter criteria could be a Queryset or RegEx (or more precise using the interface you have in the screen shots that is similar to config contexts). Is this inline with what you had in mind as well? Will defer to @glennmatthews @jathanism @lampwins on the implementation of your prototype! Thanks @dgarros ! |
Another place where dynamic groups would be useful would be in adding a feature to allow webhooks to be triggered only for objects in a specific dynamic group. |
An attempt at consolidating the requirements described in this issue thus far together with some additional requirements identified through internal discussions and documentation:
Non-requirements at this time:
|
@bryanculver I understood "Dynamic / arbitrary groups of objects" was not making it into 1.3 but my understanding was that all functionality was going to be in 1.4, is that not the case? As an example, this refers to #1483 which seems to have been added to 1.4 and removed. |
Dynamic groups were added in 1.3. Dynamic groups of groups is currently being considered for 1.4. Currently there is a spike and prototype ongoing as to how to implement this, see: #1614. Please be mindful that Epics are likely not going to ever be marked for a milestone in entirety because they often contain more stories and work, which may even include breaking changes, than can fit in a reasonable release window. Paging @lampwins. |
Dynamic Groups was added in 1.3. Groups of Dynamic Groups was added in 1.4. Future follow-ons can be followed in #3268 |
Overview
There is often a need to group objects together within a single model or content-type. For example, I may want to group all "primary" devices within pairs, all sites that have a circuit from a given carrier, all devices that terminate a circuit, etc. and the list can go on. The point is there is many reasons it makes sense to group objects together.
Once this feature is complete, it will enable applying config contexts to these groups, custom and computed fields to these groups, webhooks, etc. Anywhere a content-type is being selected, a group could also be applied.
User Story
As Nelly the Network Engineer,
I want to be able to create dynamic groups,
So that I can easily see which devices match a specific query further enabling network automation use cases on those "groups" of devices that often map back to "network services."
I know this is done when:
This is required for #768
TODO
FilterSet
filter fields are law and derive forms from them automatically #1483)The text was updated successfully, but these errors were encountered: