[PR #19005] [MERGED] Closes #8423: Allow assigning Service to FHRP Group, in addition to Device and VirtualMachine #15500

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19005
Author: @jnovinger
Created: 3/25/2025
Status: Merged
Merged: 4/11/2025
Merged by: @arthanson

Base: featureHead: 8423-assign-service-to-fhrp-group


📝 Commits (10+)

  • 60e8268 Allow assigning Service to FHRP Group, in addition to Device and VirtualMachine
  • 0564ee9 Finish up add FHRP Group assignment to Service
  • 158bb0d Remove unnecessary limit_choices_to arg in new Service.parent_object_type field
  • 79e3067 Address PR feedback, add FHRP Group to ServiceFilterForm
  • 8cb2b8b Address PR feedback, clean up migrations
  • 37a2d90 Address PR feedback, add Services to FHRP Group related objects
  • be3d55a Address PR feedback, add ServiceFilterSet test for fhrpgroup
  • 048175f Fix Service detail page breadcrumb links
  • 384e347 Address PR feedback, switch parent GFK to dropdown on forms
  • 189eda8 Fix broken tests from changes to ServiceForm/ServiceCreateForm

📊 Changes

23 files changed (+535 additions, -138 deletions)

View changed files

📝 docs/models/ipam/service.md (+9 -0)
📝 netbox/dcim/models/devices.py (+7 -1)
📝 netbox/ipam/api/serializers_/services.py (+22 -7)
📝 netbox/ipam/constants.py (+6 -0)
📝 netbox/ipam/filtersets.py (+53 -16)
📝 netbox/ipam/forms/bulk_import.py (+53 -14)
📝 netbox/ipam/forms/filtersets.py (+6 -1)
📝 netbox/ipam/forms/model_forms.py (+45 -22)
📝 netbox/ipam/graphql/filters.py (+5 -8)
📝 netbox/ipam/graphql/types.py (+9 -4)
netbox/ipam/migrations/0079_add_service_fhrp_group_parent_gfk.py (+29 -0)
netbox/ipam/migrations/0080_populate_service_parent.py (+54 -0)
netbox/ipam/migrations/0081_remove_service_device_virtual_machine_add_parent_gfk_index.py (+39 -0)
📝 netbox/ipam/models/fhrp.py (+6 -0)
📝 netbox/ipam/models/services.py (+14 -28)
📝 netbox/ipam/search.py (+1 -1)
📝 netbox/ipam/tests/test_api.py (+9 -6)
📝 netbox/ipam/tests/test_filtersets.py (+47 -9)
📝 netbox/ipam/tests/test_views.py (+78 -11)
📝 netbox/ipam/views.py (+30 -6)

...and 3 more files

📄 Description

Closes: #8423

  • Allow assigning Service to FHRP Group, in addition to Device and VirtualMachine
  • Changes relation type for all three to a single GenericForeignKey that is required
    • Has the same semantics as before, that were enforced in Service.clean(), now enforced by the GFK and in model forms
  • Patches up REST API and GraphQL representations
  • Fixes up ServiceImportForm to work with the new Service.parent GFK

🔄 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/19005 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 3/25/2025 **Status:** ✅ Merged **Merged:** 4/11/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `feature` ← **Head:** `8423-assign-service-to-fhrp-group` --- ### 📝 Commits (10+) - [`60e8268`](https://github.com/netbox-community/netbox/commit/60e8268882f2e6481a958f921776320772098286) Allow assigning Service to FHRP Group, in addition to Device and VirtualMachine - [`0564ee9`](https://github.com/netbox-community/netbox/commit/0564ee9cfcfae8f01c4ee41d764b564a19800ed4) Finish up add FHRP Group assignment to Service - [`158bb0d`](https://github.com/netbox-community/netbox/commit/158bb0d09d3a8a8021d2f3217540228efd020579) Remove unnecessary limit_choices_to arg in new Service.parent_object_type field - [`79e3067`](https://github.com/netbox-community/netbox/commit/79e3067327656a58f534e17ea7f689427cc7d58c) Address PR feedback, add FHRP Group to ServiceFilterForm - [`8cb2b8b`](https://github.com/netbox-community/netbox/commit/8cb2b8b87a3757a230d052ec9225335fb8949ef0) Address PR feedback, clean up migrations - [`37a2d90`](https://github.com/netbox-community/netbox/commit/37a2d902a58ed61f8a2a9ea33a0fe3f3a050ec0a) Address PR feedback, add Services to FHRP Group related objects - [`be3d55a`](https://github.com/netbox-community/netbox/commit/be3d55a032b8710ac558de6eb995ea179e86d9c7) Address PR feedback, add ServiceFilterSet test for fhrpgroup - [`048175f`](https://github.com/netbox-community/netbox/commit/048175ff419e5762a3126c55b7d106f14c656c32) Fix Service detail page breadcrumb links - [`384e347`](https://github.com/netbox-community/netbox/commit/384e34733f2d74e66c6a4e658447f6559b82ae4b) Address PR feedback, switch parent GFK to dropdown on forms - [`189eda8`](https://github.com/netbox-community/netbox/commit/189eda8643d8008276a48f1a494971e4d9f187ae) Fix broken tests from changes to ServiceForm/ServiceCreateForm ### 📊 Changes **23 files changed** (+535 additions, -138 deletions) <details> <summary>View changed files</summary> 📝 `docs/models/ipam/service.md` (+9 -0) 📝 `netbox/dcim/models/devices.py` (+7 -1) 📝 `netbox/ipam/api/serializers_/services.py` (+22 -7) 📝 `netbox/ipam/constants.py` (+6 -0) 📝 `netbox/ipam/filtersets.py` (+53 -16) 📝 `netbox/ipam/forms/bulk_import.py` (+53 -14) 📝 `netbox/ipam/forms/filtersets.py` (+6 -1) 📝 `netbox/ipam/forms/model_forms.py` (+45 -22) 📝 `netbox/ipam/graphql/filters.py` (+5 -8) 📝 `netbox/ipam/graphql/types.py` (+9 -4) ➕ `netbox/ipam/migrations/0079_add_service_fhrp_group_parent_gfk.py` (+29 -0) ➕ `netbox/ipam/migrations/0080_populate_service_parent.py` (+54 -0) ➕ `netbox/ipam/migrations/0081_remove_service_device_virtual_machine_add_parent_gfk_index.py` (+39 -0) 📝 `netbox/ipam/models/fhrp.py` (+6 -0) 📝 `netbox/ipam/models/services.py` (+14 -28) 📝 `netbox/ipam/search.py` (+1 -1) 📝 `netbox/ipam/tests/test_api.py` (+9 -6) 📝 `netbox/ipam/tests/test_filtersets.py` (+47 -9) 📝 `netbox/ipam/tests/test_views.py` (+78 -11) 📝 `netbox/ipam/views.py` (+30 -6) _...and 3 more files_ </details> ### 📄 Description ### Closes: #8423 - Allow assigning Service to FHRP Group, in addition to Device and VirtualMachine - Changes relation type for all three to a single GenericForeignKey that is required - Has the same semantics as before, that were enforced in `Service.clean()`, now enforced by the GFK and in model forms - Patches up REST API and GraphQL representations - Fixes up `ServiceImportForm` to work with the new `Service.parent` GFK --- <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:22:19 +01:00
adam closed this issue 2025-12-30 00:22:19 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15500