[PR #20802] [MERGED] Closes #20788: Cable profiles and and position mapping #16053

Closed
opened 2025-12-30 00:25:32 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20802
Author: @jeremystretch
Created: 11/13/2025
Status: Merged
Merged: 11/25/2025
Merged by: @jnovinger

Base: featureHead: 20788-cable-profiles


📝 Commits (10+)

  • 0901694 Initial work on FR #20788 (cable profiles)
  • a20ac40 Add missing filters for cable_position
  • 481811e Misc cleanup
  • 7edea73 Add initial cable path tests for profiles
  • fe95d89 Fix test
  • 2fe5323 Add topology tests for cable profiles
  • fb2ea37 Simplify A/B side popping logic
  • 24c6653 Add profile for 4x4 MPO8 shuffle cable
  • a75dee7 Enable drag-and-drop of items within multiselect fields
  • aa7eeda Remove many-to-one profiles

📊 Changes

30 files changed (+1418 additions, -144 deletions)

View changed files

📝 docs/models/dcim/cable.md (+15 -0)
📝 netbox/circuits/filtersets.py (+1 -1)
netbox/circuits/migrations/0054_cable_position.py (+23 -0)
📝 netbox/dcim/api/serializers_/cables.py (+8 -5)
netbox/dcim/cable_profiles.py (+108 -0)
📝 netbox/dcim/choices.py (+13 -0)
📝 netbox/dcim/constants.py (+8 -0)
📝 netbox/dcim/filtersets.py (+12 -5)
📝 netbox/dcim/forms/bulk_edit.py (+8 -2)
📝 netbox/dcim/forms/bulk_import.py (+8 -2)
📝 netbox/dcim/forms/filtersets.py (+6 -1)
📝 netbox/dcim/forms/model_forms.py (+2 -2)
📝 netbox/dcim/management/commands/trace_paths.py (+2 -2)
netbox/dcim/migrations/0219_cable_profile.py (+40 -0)
netbox/dcim/migrations/0220_cable_position.py (+107 -0)
📝 netbox/dcim/models/cables.py (+69 -21)
📝 netbox/dcim/models/device_components.py (+22 -4)
📝 netbox/dcim/signals.py (+2 -2)
📝 netbox/dcim/tables/cables.py (+3 -2)
📝 netbox/dcim/tests/test_api.py (+4 -1)

...and 10 more files

📄 Description

Closes: #20788

  • Introduce cable profiles to define mapping & validation logic for various classes of cables (e.g. straight-through vs. breakout)
  • Add an optional profile choice field on dcim.Cable
  • Add a nullable cable_position integer field on all cabled objects (e.g. interfaces)
  • Rename create_cablepath() to create_cablepaths() and add position support
  • Extend cable tracing logic to consider the position of a path relative to its cable
  • Enable drag-and-drop of items within multi-select widgets
  • Refactor cable path tests
    • Split out base CablePathTestCase class
    • Introduced new profile-based tests in parallel to legacy (non-profile) tests
    • Did not alter any of the legacy tests, to ensure backward compatibility is retained
  • Update documentation for the Cable model

🔄 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/20802 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 11/13/2025 **Status:** ✅ Merged **Merged:** 11/25/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `feature` ← **Head:** `20788-cable-profiles` --- ### 📝 Commits (10+) - [`0901694`](https://github.com/netbox-community/netbox/commit/0901694b2b6f731e5a9ba669e56d6b353cdc7b6c) Initial work on FR #20788 (cable profiles) - [`a20ac40`](https://github.com/netbox-community/netbox/commit/a20ac40b487ca188fbc2a204c1facfad942f0071) Add missing filters for cable_position - [`481811e`](https://github.com/netbox-community/netbox/commit/481811e487ed4999ad3a8e0c39c7425e5a7dee16) Misc cleanup - [`7edea73`](https://github.com/netbox-community/netbox/commit/7edea73f8503b7b5bd0159333dea73d3f022d561) Add initial cable path tests for profiles - [`fe95d89`](https://github.com/netbox-community/netbox/commit/fe95d89db37d25e59f817186cfbc4c6114e38be1) Fix test - [`2fe5323`](https://github.com/netbox-community/netbox/commit/2fe5323dd2eecc6afb680de176c3714462000c36) Add topology tests for cable profiles - [`fb2ea37`](https://github.com/netbox-community/netbox/commit/fb2ea3744352375b37820e1b52d2bb45b4f999a3) Simplify A/B side popping logic - [`24c6653`](https://github.com/netbox-community/netbox/commit/24c6653356020ebd7bbe71a93189ae540d600655) Add profile for 4x4 MPO8 shuffle cable - [`a75dee7`](https://github.com/netbox-community/netbox/commit/a75dee745e93731392586d058faaa845048936b4) Enable drag-and-drop of items within multiselect fields - [`aa7eeda`](https://github.com/netbox-community/netbox/commit/aa7eedac4247a90a13a9201f576a5dfa7e5e9744) Remove many-to-one profiles ### 📊 Changes **30 files changed** (+1418 additions, -144 deletions) <details> <summary>View changed files</summary> 📝 `docs/models/dcim/cable.md` (+15 -0) 📝 `netbox/circuits/filtersets.py` (+1 -1) ➕ `netbox/circuits/migrations/0054_cable_position.py` (+23 -0) 📝 `netbox/dcim/api/serializers_/cables.py` (+8 -5) ➕ `netbox/dcim/cable_profiles.py` (+108 -0) 📝 `netbox/dcim/choices.py` (+13 -0) 📝 `netbox/dcim/constants.py` (+8 -0) 📝 `netbox/dcim/filtersets.py` (+12 -5) 📝 `netbox/dcim/forms/bulk_edit.py` (+8 -2) 📝 `netbox/dcim/forms/bulk_import.py` (+8 -2) 📝 `netbox/dcim/forms/filtersets.py` (+6 -1) 📝 `netbox/dcim/forms/model_forms.py` (+2 -2) 📝 `netbox/dcim/management/commands/trace_paths.py` (+2 -2) ➕ `netbox/dcim/migrations/0219_cable_profile.py` (+40 -0) ➕ `netbox/dcim/migrations/0220_cable_position.py` (+107 -0) 📝 `netbox/dcim/models/cables.py` (+69 -21) 📝 `netbox/dcim/models/device_components.py` (+22 -4) 📝 `netbox/dcim/signals.py` (+2 -2) 📝 `netbox/dcim/tables/cables.py` (+3 -2) 📝 `netbox/dcim/tests/test_api.py` (+4 -1) _...and 10 more files_ </details> ### 📄 Description ### Closes: #20788 - Introduce cable profiles to define mapping & validation logic for various classes of cables (e.g. straight-through vs. breakout) - Add an optional `profile` choice field on dcim.Cable - Add a nullable `cable_position` integer field on all cabled objects (e.g. interfaces) - Rename `create_cablepath()` to `create_cablepaths()` and add position support - Extend cable tracing logic to consider the position of a path relative to its cable - Enable drag-and-drop of items within multi-select widgets - Refactor cable path tests - Split out base CablePathTestCase class - Introduced new profile-based tests in parallel to legacy (non-profile) tests - Did not alter any of the legacy tests, to ensure backward compatibility is retained - Update documentation for the Cable model --- <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-30 00:25:32 +01:00
adam closed this issue 2025-12-30 00:25:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16053