allow filtering of changelogs by types of changes #8425

Closed
opened 2025-12-29 20:36:34 +01:00 by adam · 4 comments
Owner

Originally created by @ITJamie on GitHub (Aug 5, 2023).

NetBox version

v3.5.7

Feature type

Data model extension

Proposed functionality

An additional json field on the changelog model which contained a dict of true/false booleans for each model field to give high level info of what changes are in each changelog. This would allow for filtering of changelogs in a sane way (and scale across all the object types)

eg: for "device" model:

{
  "name": true, # eg if name changed
  "rack": false, # eg if assigned rack changed
  "position": true, # eg if position in rack changed
  "custom_fields": # if any of the custom fields changed value
}

when the changelog entry is being created it would loop through the pre/post changed json dicts and create true/false for each field depending on if the fieldcontent changed.
part of the migration could be to backfill in these changes (or add a command to do it, similar to the command which rebuilds the search cache)

Use case

right now there is no way to filter down changelogs on an object to specific types of changes.
by extending the changelog model with a "change_metadata" it could be possible to easily add filtering to the changelog views.

trying to do this by parsing the pre/post change fields is computationally expensive

Database changes

additional jsonb field for the change metadata

External dependencies

No response

Originally created by @ITJamie on GitHub (Aug 5, 2023). ### NetBox version v3.5.7 ### Feature type Data model extension ### Proposed functionality An additional json field on the changelog model which contained a dict of true/false booleans for each model field to give high level info of what changes are in each changelog. This would allow for filtering of changelogs in a sane way (and scale across all the object types) eg: for "device" model: ``` { "name": true, # eg if name changed "rack": false, # eg if assigned rack changed "position": true, # eg if position in rack changed "custom_fields": # if any of the custom fields changed value } ``` when the changelog entry is being created it would loop through the pre/post changed json dicts and create true/false for each field depending on if the fieldcontent changed. part of the migration could be to backfill in these changes (or add a command to do it, similar to the command which rebuilds the search cache) ### Use case right now there is no way to filter down changelogs on an object to specific types of changes. by extending the changelog model with a "change_metadata" it could be possible to easily add filtering to the changelog views. trying to do this by parsing the pre/post change fields is computationally expensive ### Database changes additional jsonb field for the change metadata ### External dependencies _No response_
adam added the type: featurepending closure labels 2025-12-29 20:36:34 +01:00
adam closed this issue 2025-12-29 20:36:34 +01:00
Author
Owner

@ITJamie commented on GitHub (Aug 5, 2023):

note this could also allow filtering out of "no difference" changelog entrys for those who dislike that (https://github.com/netbox-community/netbox/issues/6599)

@ITJamie commented on GitHub (Aug 5, 2023): note this could also allow filtering out of "no difference" changelog entrys for those who dislike that (https://github.com/netbox-community/netbox/issues/6599)
Author
Owner

@jeremystretch commented on GitHub (Aug 28, 2023):

@ITJamie could you please provide a more reader-friendly title for this issue?

@jeremystretch commented on GitHub (Aug 28, 2023): @ITJamie could you please provide a more reader-friendly title for this issue?
Author
Owner

@github-actions[bot] commented on GitHub (Nov 30, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Nov 30, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Dec 30, 2023):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Dec 30, 2023): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8425