-
Notifications
You must be signed in to change notification settings - Fork 253
Use set comparison for updating permissions, groups, actions, and object types #1456
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
Open
dchiquito
wants to merge
14
commits into
netbox-community:devel
Choose a base branch
from
dchiquito:users-ordering
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These suboptions of users, user groups, and permissions were previously compared as lists for the purposes of updates, and so would update the object whenever the order would change.
sc68cal
reviewed
Sep 5, 2025
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 looks good to me, just needs to be updated with the latest from devel
|
Working on a fix to devel that hopefully will fix the sanity failures |
|
This looks really good, I know you're still working on getting everything to pass but I think this has a lot of promise, so keep it up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
#1455
New Behavior
user.groups,user.permissions,user_group.permissions,permission.actions, andpermission.object_typesare all serialized as lists. When compared as lists, however, any ordering changes means that theuser,user_group, orpermissionare updated unnecessarily.Contrast to Current Behavior
Convert these fields into sets prior to comparison during the update process.
Discussion: Benefits and Drawbacks
Unnecessary updates can be very costly for objects with large numbers of permissions, so avoiding that would be great.
The only drawback I can think of would be a negligible increase in compute, which is offset by fewer required network requests.
I don't think ordering of these fields is a feature so this would be backwards compatible.
Changes to the Documentation
No changes.
Proposed Release Note Entry
user.groups,user.permissions,user_group.permissions,permission.actions, andpermission.object_typesare now treated as unordered sets for update comparison purposes.Double Check
develbranch.