From fc0acb020f9d33d0d8f2f237c3821629de7a802d Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 10 Apr 2025 17:17:21 -0400 Subject: [PATCH] Merge main into feature --- .../ISSUE_TEMPLATE/01-feature_request.yaml | 2 +- .github/ISSUE_TEMPLATE/02-bug_report.yaml | 2 +- .github/workflows/close-incomplete-issues.yml | 1 + .github/workflows/close-stale-issues.yml | 1 + .github/workflows/lock-threads.yml | 1 + .../workflows/update-translation-strings.yml | 1 + .tx/config | 2 +- base_requirements.txt | 8 +- contrib/generated_schema.json | 7 + .../administration/authentication/overview.md | 1 + docs/configuration/miscellaneous.md | 12 + docs/customization/custom-scripts.md | 1 + docs/customization/export-templates.md | 1 + docs/development/release-checklist.md | 72 +- docs/development/style-guide.md | 2 +- docs/development/translations.md | 5 +- docs/installation/upgrading.md | 50 +- docs/integrations/graphql-api.md | 2 +- docs/integrations/rest-api.md | 2 +- docs/plugins/development/index.md | 1 + docs/release-notes/version-2.1.md | 2 +- docs/release-notes/version-4.2.md | 122 + mkdocs.yml | 2 + netbox/circuits/filtersets.py | 7 +- netbox/circuits/forms/filtersets.py | 12 +- netbox/circuits/graphql/types.py | 2 +- netbox/circuits/models/circuits.py | 3 +- netbox/circuits/tables/circuits.py | 2 +- netbox/circuits/tables/providers.py | 2 - netbox/circuits/tests/test_filtersets.py | 24 +- netbox/circuits/views.py | 5 +- netbox/core/api/schema.py | 40 +- netbox/core/apps.py | 12 + netbox/core/choices.py | 2 + netbox/core/events.py | 13 - netbox/core/forms/filtersets.py | 2 + netbox/core/models/jobs.py | 9 +- netbox/core/plugins.py | 8 + netbox/core/views.py | 6 +- netbox/dcim/api/views.py | 14 +- netbox/dcim/choices.py | 8 + netbox/dcim/exceptions.py | 2 + netbox/dcim/filtersets.py | 1 + netbox/dcim/forms/bulk_edit.py | 8 +- netbox/dcim/forms/bulk_import.py | 54 +- netbox/dcim/forms/filtersets.py | 2 +- netbox/dcim/forms/object_create.py | 2 + netbox/dcim/graphql/mixins.py | 1 + netbox/dcim/graphql/types.py | 2 +- .../dcim/migrations/0205_moduletypeprofile.py | 2 +- netbox/dcim/models/cables.py | 91 +- netbox/dcim/models/device_components.py | 7 +- netbox/dcim/models/devices.py | 31 +- netbox/dcim/models/modules.py | 2 + netbox/dcim/search.py | 1 + netbox/dcim/svg/racks.py | 6 +- netbox/dcim/tables/devices.py | 4 +- netbox/dcim/tables/devicetypes.py | 13 +- netbox/dcim/tables/sites.py | 10 +- netbox/dcim/tables/template_code.py | 44 +- netbox/dcim/tests/test_api.py | 40 +- netbox/dcim/tests/test_cablepaths.py | 5 +- netbox/dcim/tests/test_forms.py | 48 +- netbox/dcim/tests/test_models.py | 65 +- netbox/dcim/views.py | 85 +- netbox/extras/choices.py | 15 +- netbox/extras/constants.py | 9 +- netbox/extras/dashboard/widgets.py | 38 +- netbox/extras/forms/filtersets.py | 9 + netbox/extras/forms/model_forms.py | 29 +- netbox/extras/forms/reports.py | 4 +- netbox/extras/forms/scripts.py | 6 +- netbox/extras/jobs.py | 9 +- .../management/commands/housekeeping.py | 3 +- .../extras/management/commands/runscript.py | 7 +- .../0123_journalentry_kind_default.py | 25 + ...move_staging.py => 0124_remove_staging.py} | 2 +- ...y => 0125_alter_tag_options_tag_weight.py} | 2 +- ...me.py => 0126_exporttemplate_file_name.py} | 2 +- ..._configtemplate_as_attachment_and_more.py} | 2 +- ...127_tableconfig.py => 0128_tableconfig.py} | 2 +- netbox/extras/models/configs.py | 2 +- netbox/extras/models/customfields.py | 51 +- netbox/extras/models/scripts.py | 9 + netbox/extras/reports.py | 2 +- netbox/extras/scripts.py | 7 +- netbox/extras/tables/tables.py | 5 +- netbox/extras/tests/test_dashboard.py | 48 + netbox/extras/tests/test_filtersets.py | 1 + netbox/extras/tests/test_models.py | 28 + netbox/extras/urls.py | 3 + netbox/extras/views.py | 80 +- netbox/ipam/filtersets.py | 26 +- netbox/ipam/forms/bulk_import.py | 32 +- netbox/ipam/forms/filtersets.py | 28 +- netbox/ipam/forms/model_forms.py | 10 +- netbox/ipam/graphql/types.py | 11 +- netbox/ipam/tests/test_filtersets.py | 21 +- netbox/ipam/tests/test_forms.py | 43 + netbox/ipam/tests/test_views.py | 26 +- netbox/ipam/views.py | 1 + netbox/netbox/api/viewsets/__init__.py | 5 + netbox/netbox/authentication/__init__.py | 2 +- netbox/netbox/configuration_example.py | 5 + netbox/netbox/forms/base.py | 9 - netbox/netbox/forms/mixins.py | 10 + netbox/netbox/models/__init__.py | 3 +- netbox/netbox/settings.py | 6 + .../migrations/0002_dummynetboxmodel.py | 30 + netbox/netbox/tests/dummy_plugin/models.py | 6 + netbox/netbox/tests/dummy_plugin/urls.py | 2 + netbox/netbox/tests/dummy_plugin/views.py | 19 +- netbox/netbox/tests/test_models.py | 23 + netbox/netbox/views/generic/bulk_views.py | 9 +- netbox/netbox/views/generic/feature_views.py | 2 +- netbox/project-static/dist/netbox.css | Bin 554086 -> 554086 bytes netbox/project-static/dist/netbox.js | Bin 382486 -> 383482 bytes netbox/project-static/dist/netbox.js.map | Bin 535986 -> 537270 bytes netbox/project-static/package.json | 6 +- .../src/buttons/selectMultiple.ts | 8 +- netbox/project-static/src/htmx.ts | 4 +- .../project-static/styles/custom/_misc.scss | 2 +- netbox/project-static/yarn.lock | 24 +- netbox/release.yaml | 4 +- netbox/templates/500.html | 58 +- netbox/templates/dcim/device.html | 9 + .../templates/extras/inc/format_toggle.html | 4 +- .../object_render_config.html} | 5 +- netbox/templates/extras/script.html | 4 + netbox/templates/extras/script_list.html | 7 +- netbox/templates/extras/script_result.html | 2 +- netbox/templates/extras/tag.html | 31 +- .../templates/inc/panels/related_objects.html | 2 + netbox/templates/virtualization/cluster.html | 4 +- .../templates/virtualization/virtualdisk.html | 2 +- .../virtualization/virtualmachine.html | 4 +- .../virtualmachine/render_config.html | 75 - netbox/tenancy/forms/bulk_edit.py | 1 + netbox/tenancy/graphql/types.py | 7 +- netbox/tenancy/tables/contacts.py | 3 +- netbox/translations/cs/LC_MESSAGES/django.mo | Bin 230181 -> 241597 bytes netbox/translations/cs/LC_MESSAGES/django.po | 8037 +++++++++-------- netbox/translations/da/LC_MESSAGES/django.mo | Bin 225478 -> 234197 bytes netbox/translations/da/LC_MESSAGES/django.po | 7903 ++++++++-------- netbox/translations/de/LC_MESSAGES/django.mo | Bin 237308 -> 246570 bytes netbox/translations/de/LC_MESSAGES/django.po | 7954 ++++++++-------- netbox/translations/en/LC_MESSAGES/django.po | 2807 +++--- netbox/translations/es/LC_MESSAGES/django.mo | Bin 239192 -> 248390 bytes netbox/translations/es/LC_MESSAGES/django.po | 7926 ++++++++-------- netbox/translations/fr/LC_MESSAGES/django.mo | Bin 237945 -> 250399 bytes netbox/translations/fr/LC_MESSAGES/django.po | 8025 ++++++++-------- netbox/translations/it/LC_MESSAGES/django.mo | Bin 237392 -> 246488 bytes netbox/translations/it/LC_MESSAGES/django.po | 7912 ++++++++-------- netbox/translations/ja/LC_MESSAGES/django.mo | Bin 254773 -> 264416 bytes netbox/translations/ja/LC_MESSAGES/django.po | 8021 ++++++++-------- netbox/translations/nl/LC_MESSAGES/django.mo | Bin 233233 -> 242162 bytes netbox/translations/nl/LC_MESSAGES/django.po | 7928 ++++++++-------- netbox/translations/pl/LC_MESSAGES/django.mo | Bin 235040 -> 244029 bytes netbox/translations/pl/LC_MESSAGES/django.po | 7903 ++++++++-------- netbox/translations/pt/LC_MESSAGES/django.mo | Bin 235452 -> 244565 bytes netbox/translations/pt/LC_MESSAGES/django.po | 7908 ++++++++-------- netbox/translations/ru/LC_MESSAGES/django.mo | Bin 301870 -> 313534 bytes netbox/translations/ru/LC_MESSAGES/django.po | 7938 ++++++++-------- netbox/translations/tr/LC_MESSAGES/django.mo | Bin 229529 -> 238157 bytes netbox/translations/tr/LC_MESSAGES/django.po | 7892 ++++++++-------- netbox/translations/uk/LC_MESSAGES/django.mo | Bin 302307 -> 313588 bytes netbox/translations/uk/LC_MESSAGES/django.po | 7858 ++++++++-------- netbox/translations/zh/LC_MESSAGES/django.mo | Bin 212098 -> 220218 bytes netbox/translations/zh/LC_MESSAGES/django.po | 7881 ++++++++-------- netbox/utilities/conversion.py | 25 +- netbox/utilities/fields.py | 132 + netbox/utilities/forms/fields/dynamic.py | 6 +- netbox/utilities/forms/fields/fields.py | 7 +- netbox/utilities/forms/forms.py | 5 +- netbox/utilities/query.py | 17 +- netbox/utilities/serialization.py | 15 +- netbox/utilities/templates/builtins/tag.html | 2 +- netbox/utilities/templatetags/helpers.py | 31 +- netbox/utilities/tests/test_conversions.py | 53 + netbox/utilities/views.py | 8 +- .../api/serializers_/virtualmachines.py | 33 +- netbox/virtualization/apps.py | 7 - netbox/virtualization/choices.py | 2 + netbox/virtualization/forms/bulk_edit.py | 14 +- netbox/virtualization/graphql/types.py | 4 +- .../migrations/0040_convert_disk_size.py | 5 +- netbox/virtualization/signals.py | 11 +- .../virtualization/tables/virtualmachines.py | 8 +- netbox/virtualization/tests/test_api.py | 41 +- netbox/virtualization/views.py | 46 +- netbox/vpn/filtersets.py | 8 +- netbox/vpn/forms/filtersets.py | 14 +- netbox/vpn/graphql/types.py | 4 +- netbox/vpn/models/tunnels.py | 6 +- netbox/wireless/signals.py | 7 +- requirements.txt | 32 +- ruff.toml | 1 + 197 files changed, 63430 insertions(+), 52999 deletions(-) create mode 100644 netbox/dcim/exceptions.py create mode 100644 netbox/extras/migrations/0123_journalentry_kind_default.py rename netbox/extras/migrations/{0123_remove_staging.py => 0124_remove_staging.py} (91%) rename netbox/extras/migrations/{0124_alter_tag_options_tag_weight.py => 0125_alter_tag_options_tag_weight.py} (90%) rename netbox/extras/migrations/{0125_exporttemplate_file_name.py => 0126_exporttemplate_file_name.py} (84%) rename netbox/extras/migrations/{0126_configtemplate_as_attachment_and_more.py => 0127_configtemplate_as_attachment_and_more.py} (95%) rename netbox/extras/migrations/{0127_tableconfig.py => 0128_tableconfig.py} (97%) create mode 100644 netbox/extras/tests/test_dashboard.py create mode 100644 netbox/ipam/tests/test_forms.py create mode 100644 netbox/netbox/tests/dummy_plugin/migrations/0002_dummynetboxmodel.py create mode 100644 netbox/netbox/tests/test_models.py rename netbox/templates/{dcim/device/render_config.html => extras/object_render_config.html} (95%) delete mode 100644 netbox/templates/virtualization/virtualmachine/render_config.html create mode 100644 netbox/utilities/tests/test_conversions.py diff --git a/.github/ISSUE_TEMPLATE/01-feature_request.yaml b/.github/ISSUE_TEMPLATE/01-feature_request.yaml index 62c33b424..e4eb15d4f 100644 --- a/.github/ISSUE_TEMPLATE/01-feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/01-feature_request.yaml @@ -15,7 +15,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v4.2.3 + placeholder: v4.2.7 validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/02-bug_report.yaml b/.github/ISSUE_TEMPLATE/02-bug_report.yaml index 0fa8b4084..f411aeaed 100644 --- a/.github/ISSUE_TEMPLATE/02-bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/02-bug_report.yaml @@ -27,7 +27,7 @@ body: attributes: label: NetBox Version description: What version of NetBox are you currently running? - placeholder: v4.2.3 + placeholder: v4.2.7 validations: required: true - type: dropdown diff --git a/.github/workflows/close-incomplete-issues.yml b/.github/workflows/close-incomplete-issues.yml index 4d31d735e..1b3adf901 100644 --- a/.github/workflows/close-incomplete-issues.yml +++ b/.github/workflows/close-incomplete-issues.yml @@ -12,6 +12,7 @@ permissions: jobs: stale: + if: github.repository == 'netbox-community/netbox' runs-on: ubuntu-latest steps: - uses: actions/stale@v9 diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 89b3d5f9a..723fd6241 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -13,6 +13,7 @@ permissions: jobs: stale: + if: github.repository == 'netbox-community/netbox' runs-on: ubuntu-latest steps: - uses: actions/stale@v9 diff --git a/.github/workflows/lock-threads.yml b/.github/workflows/lock-threads.yml index 0f3636784..b77a84ad1 100644 --- a/.github/workflows/lock-threads.yml +++ b/.github/workflows/lock-threads.yml @@ -13,6 +13,7 @@ permissions: jobs: lock: + if: github.repository == 'netbox-community/netbox' runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v5 diff --git a/.github/workflows/update-translation-strings.yml b/.github/workflows/update-translation-strings.yml index e78cd4296..8a4f05456 100644 --- a/.github/workflows/update-translation-strings.yml +++ b/.github/workflows/update-translation-strings.yml @@ -13,6 +13,7 @@ env: jobs: makemessages: + if: github.repository == 'netbox-community/netbox' runs-on: ubuntu-latest env: NETBOX_CONFIGURATION: netbox.configuration_testing diff --git a/.tx/config b/.tx/config index 342331d4e..b0562b978 100755 --- a/.tx/config +++ b/.tx/config @@ -1,7 +1,7 @@ [main] host = https://app.transifex.com -[o:netbox-community:p:netbox:r:9cbf4fcf95b3d92e4ebbf1a5e5d1caee] +[o:netbox-community:p:netbox:r:034999968a7366ba27a8bdf1ab63bf42] file_filter = netbox/translations//LC_MESSAGES/django.po source_file = netbox/translations/en/LC_MESSAGES/django.po type = PO diff --git a/base_requirements.txt b/base_requirements.txt index 7eaa9d928..b810cb56f 100644 --- a/base_requirements.txt +++ b/base_requirements.txt @@ -8,7 +8,10 @@ django-cors-headers # Runtime UI tool for debugging Django # https://github.com/jazzband/django-debug-toolbar/blob/main/docs/changes.rst -django-debug-toolbar +# See: https://django-debug-toolbar.readthedocs.io/en/latest/changes.html#id1 +# "Wrap SHOW_TOOLBAR_CALLBACK function with sync_to_async or async_to_sync to allow sync/async +# compatibility." breaks stawberry-graphql-django at version 0.52.0 (current) +django-debug-toolbar==5.0.1 # Library for writing reusable URL query filters # https://github.com/carltongibson/django-filter/blob/main/CHANGES.rst @@ -96,8 +99,7 @@ mkdocs-material # Introspection for embedded code # https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md -# See #18568 -mkdocstrings[python-legacy]==0.27.0 +mkdocstrings[python] # Library for manipulating IP prefixes and addresses # https://github.com/netaddr/netaddr/blob/master/CHANGELOG.rst diff --git a/contrib/generated_schema.json b/contrib/generated_schema.json index 639f0df8d..66a61cbad 100644 --- a/contrib/generated_schema.json +++ b/contrib/generated_schema.json @@ -427,6 +427,7 @@ "e3", "xdsl", "docsis", + "moca", "bpon", "epon", "10g-epon", @@ -500,6 +501,9 @@ "n", "mrj21", "fc", + "fc-pc", + "fc-upc", + "fc-apc", "lc", "lc-pc", "lc-upc", @@ -565,6 +569,9 @@ "n", "mrj21", "fc", + "fc-pc", + "fc-upc", + "fc-apc", "lc", "lc-pc", "lc-upc", diff --git a/docs/administration/authentication/overview.md b/docs/administration/authentication/overview.md index e582f009e..19c86a4c0 100644 --- a/docs/administration/authentication/overview.md +++ b/docs/administration/authentication/overview.md @@ -54,6 +54,7 @@ Icons](https://github.com/google/material-design-icons) icon's name; or be `None` for no icon. For instance, the OIDC backend may be customized with + ```python SOCIAL_AUTH_BACKEND_ATTRS = { 'oidc': ("My awesome SSO", "login"), diff --git a/docs/configuration/miscellaneous.md b/docs/configuration/miscellaneous.md index c14c0ac77..b9d079564 100644 --- a/docs/configuration/miscellaneous.md +++ b/docs/configuration/miscellaneous.md @@ -233,3 +233,15 @@ This parameter controls how frequently a failed job is retried, up to the maximu Default: `0` (retries disabled) The maximum number of times a background task will be retried before being marked as failed. + +## DISK_BASE_UNIT + +Default: `1000` + +The base unit for disk sizes. Set this to `1024` to use binary prefixes (MiB, GiB, etc.) instead of decimal prefixes (MB, GB, etc.). + +## RAM_BASE_UNIT + +Default: `1000` + +The base unit for RAM sizes. Set this to `1024` to use binary prefixes (MiB, GiB, etc.) instead of decimal prefixes (MB, GB, etc.). diff --git a/docs/customization/custom-scripts.md b/docs/customization/custom-scripts.md index 56dd08a76..e7536a654 100644 --- a/docs/customization/custom-scripts.md +++ b/docs/customization/custom-scripts.md @@ -310,6 +310,7 @@ A particular object within NetBox. Each ObjectVar must specify a particular mode * `query_params` - A dictionary of query parameters to use when retrieving available options (optional) * `context` - A custom dictionary mapping template context variables to fields, used when rendering `