diffsync icon indicating copy to clipboard operation
diffsync copied to clipboard

Allow DiffSyncModel to be present in multiple branches from top_level

Open Yoyasp opened this issue 10 months ago • 3 comments

Environment

  • DiffSync version: 2.0.0

Proposed Functionality

Allow instances of DiffSyncModels to be preset in multiple branches. This would allow a model to have an optional parent while still syncing all the objects without parents

Use Case

In the Netbox model we can have a VirtualChassis that includes member Device's, but also have Device's that are not part of a VirtualChassis. If i split up these entities in two DiffSyncModel's and make Device a child of the VirtualChassis i must choose whether i only want to sync the Device's that are part of a VirtualChassis:

  • by making the VirtualChassis a top_level entry. This however will ignore all the devices that are not a child of VirtualChassis. Or:
  • by making the Device a top_level entry. This however will not create the VirtualChassis.

If i add both VirtualChassis and Device to top_level i get an error that Device's that are a child of VirtualChassis are already created when it wants to add the Device from that top_level entry.

This is exactly the same object so i dont know why it couldnt be possible to just skip over trying to recreate this. This would also be a nicer option than what is suggested in #285 .

Yoyasp avatar Mar 19 '25 14:03 Yoyasp