[PR #5212] [MERGED] #4900: New model for cable paths #12985

Closed
opened 2025-12-29 22:24:44 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5212
Author: @jeremystretch
Created: 10/5/2020
Status: Merged
Merged: 10/8/2020
Merged by: @jeremystretch

Base: develop-2.10Head: 4900-cable-paths


📝 Commits (10+)

  • 587e6fc Initial work on cable paths (WIP)
  • 9851977 Add initial tests
  • 319329e Extend cable path tests
  • cd71799 Ignore the position stack when traversing single-position rear ports
  • e53ae1d Extend cable path tests
  • 46df5a9 Remove extraneous test objects
  • 19a3a4d Add GenericRelation to originating cable paths on PathEndpoint
  • 105c0fd Introduce retrace_paths management command
  • 8abc055 CircuitTermination and PowerFeed are path endpoints
  • cd398b1 retrace_paths should ignore case in model names

📊 Changes

66 files changed (+2591 additions, -2172 deletions)

View changed files

📝 docs/release-notes/version-2.10.md (+40 -1)
📝 netbox/circuits/api/serializers.py (+4 -3)
📝 netbox/circuits/api/views.py (+4 -5)
📝 netbox/circuits/filters.py (+2 -1)
netbox/circuits/migrations/0021_cache_cable_peer.py (+49 -0)
netbox/circuits/migrations/0022_cablepath.py (+26 -0)
📝 netbox/circuits/models.py (+2 -15)
📝 netbox/circuits/tests/test_filters.py (+13 -1)
📝 netbox/circuits/urls.py (+2 -2)
📝 netbox/circuits/views.py (+2 -2)
📝 netbox/dcim/api/nested_serializers.py (+6 -12)
📝 netbox/dcim/api/serializers.py (+122 -37)
📝 netbox/dcim/api/views.py (+46 -35)
📝 netbox/dcim/constants.py (+0 -6)
netbox/dcim/exceptions.py (+0 -14)
📝 netbox/dcim/fields.py (+14 -0)
📝 netbox/dcim/filters.py (+65 -95)
netbox/dcim/lookups.py (+10 -0)
netbox/dcim/management/__init__.py (+0 -0)
netbox/dcim/management/commands/__init__.py (+0 -0)

...and 46 more files

📄 Description

Closes: #4900

  • Introduce a new CablePath model for recording the origin, destination, intermediate nodes, and status of each end-to-end path
  • Add a ForeignKey to CablePath on each of the seven path endpoint models
  • Drop the old fields for connected_endpoint and connection_status
  • Cache peer termination on CableTermination instances
  • Remove trace API endpoint from FrontPort and RearPort
  • Remove connection_status field from nested API serializers for device components
  • Add cable_peer field to API serializer for all CableTermination models
  • Overhaul cable tracing logic with the new trace_paths() utility function
  • Completely rewrite all cable path tests
  • Add the retrace_paths management command (temporarily?)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/5212 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/5/2020 **Status:** ✅ Merged **Merged:** 10/8/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop-2.10` ← **Head:** `4900-cable-paths` --- ### 📝 Commits (10+) - [`587e6fc`](https://github.com/netbox-community/netbox/commit/587e6fcf72fe05a7597b8e565b782f659aacefb1) Initial work on cable paths (WIP) - [`9851977`](https://github.com/netbox-community/netbox/commit/985197788b0039976299de1fc56be25d90756dd8) Add initial tests - [`319329e`](https://github.com/netbox-community/netbox/commit/319329e2b230a65122031130d861816cf3f75160) Extend cable path tests - [`cd71799`](https://github.com/netbox-community/netbox/commit/cd7179937376ea7c7b81deedf37509717ed85143) Ignore the position stack when traversing single-position rear ports - [`e53ae1d`](https://github.com/netbox-community/netbox/commit/e53ae1d584267cd2a40e0ae701e150334364e10d) Extend cable path tests - [`46df5a9`](https://github.com/netbox-community/netbox/commit/46df5a97b22bfd4f3d5bb24525c346f78194f3c6) Remove extraneous test objects - [`19a3a4d`](https://github.com/netbox-community/netbox/commit/19a3a4d4ef2b6d5c974c66a7a6babcacf8ce7fce) Add GenericRelation to originating cable paths on PathEndpoint - [`105c0fd`](https://github.com/netbox-community/netbox/commit/105c0fd3d282bee4ab1602fc72190fc764811465) Introduce retrace_paths management command - [`8abc055`](https://github.com/netbox-community/netbox/commit/8abc05544cb2fbcbbf919b9546af2400b6123dde) CircuitTermination and PowerFeed are path endpoints - [`cd398b1`](https://github.com/netbox-community/netbox/commit/cd398b15d83107ba5ee6f296d566f1b9d7a21622) retrace_paths should ignore case in model names ### 📊 Changes **66 files changed** (+2591 additions, -2172 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.10.md` (+40 -1) 📝 `netbox/circuits/api/serializers.py` (+4 -3) 📝 `netbox/circuits/api/views.py` (+4 -5) 📝 `netbox/circuits/filters.py` (+2 -1) ➕ `netbox/circuits/migrations/0021_cache_cable_peer.py` (+49 -0) ➕ `netbox/circuits/migrations/0022_cablepath.py` (+26 -0) 📝 `netbox/circuits/models.py` (+2 -15) 📝 `netbox/circuits/tests/test_filters.py` (+13 -1) 📝 `netbox/circuits/urls.py` (+2 -2) 📝 `netbox/circuits/views.py` (+2 -2) 📝 `netbox/dcim/api/nested_serializers.py` (+6 -12) 📝 `netbox/dcim/api/serializers.py` (+122 -37) 📝 `netbox/dcim/api/views.py` (+46 -35) 📝 `netbox/dcim/constants.py` (+0 -6) ➖ `netbox/dcim/exceptions.py` (+0 -14) 📝 `netbox/dcim/fields.py` (+14 -0) 📝 `netbox/dcim/filters.py` (+65 -95) ➕ `netbox/dcim/lookups.py` (+10 -0) ➕ `netbox/dcim/management/__init__.py` (+0 -0) ➕ `netbox/dcim/management/commands/__init__.py` (+0 -0) _...and 46 more files_ </details> ### 📄 Description ### Closes: #4900 - Introduce a new CablePath model for recording the origin, destination, intermediate nodes, and status of each end-to-end path - Add a ForeignKey to CablePath on each of the seven path endpoint models - Drop the old fields for `connected_endpoint` and `connection_status` - Cache peer termination on CableTermination instances - Remove `trace` API endpoint from FrontPort and RearPort - Remove `connection_status` field from nested API serializers for device components - Add `cable_peer` field to API serializer for all CableTermination models - Overhaul cable tracing logic with the new `trace_paths()` utility function - Completely rewrite all cable path tests - Add the `retrace_paths` management command (temporarily?) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:24:44 +01:00
adam closed this issue 2025-12-29 22:24:44 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12985