netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.79k stars 2.54k forks source link

Bulk-Delete: List Dependently-Deleted Entities #16191

Open chadhpaine opened 4 months ago

chadhpaine commented 4 months ago

NetBox version

v3.7.4

Feature type

New functionality

Proposed functionality

When performing a bulk-deletion of entities, Netbox should ask the user to confirm the deletion of both the set of entities selected explicitly for deletion as well as the set of sub-entities that would be deleted due to those sub-entities being dependent on an entity being targeted for deletion. An example of this is of a set of devices being deleted, where the devices each carry different sets of components; the bulk-deletion view should show the list of devices the user targeted (as it currently does), and well as a list of the components from those devices that will be deleted (this is the request), with a column showing which device each component is related to.

Use case

When performing atomic-deletion of entities such as devices and components, Netbox warns that sub-entities considered dependent on the entity-being-deleted will also be deleted.

image (from https://github.com/netbox-community/netbox/issues/15665#issuecomment-2066586599)

For purposes of this feature-request, we call such sub-entities "dependently-deleted entities" because their deletion is dependent on their association to the entity targeted for deletion - removing the association between a target entity and a sub-entity before deletion of the target entity is often sufficient to retain the sub-entity.

When performing bulk-deletion of the same kinds of targets, the bulk-deletion menu shows the list of targets, but does not for-each-target show the list of dependently-deleted entities that accompany it. As a result, the deletion of the dependently-deleted entities is therefore both silent and unacknowledged; customers may be unaware that they have removed data from their instance that they may (or may not) have wanted to retain, unless they also review the changelog.

image

This use-case is not limited to the relationship between devices and their components (#14488); it also incorporates relationships between inventory-items (and templates) and other components within a single device (#15665), between interfaces and their assigned IP addresses (#6015 mentions this feature), between virtual-machines and assigned virtual-disks (not mentioned in-issue but observed at demo.netbox.dev), and at numerous other points of entity-intersection throughout the application.

This feature would bring the functionality of the bulk-deletion view to-parity with its atomic-deletion counterpart. Providing a user with a visual reminder that their intended actions may have unintended consequences is important to ensure that customers have and consider their choice of which data to retain and which to discard.

Database changes

None

External dependencies

None

github-actions[bot] commented 4 weeks ago

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.