From 8465eee4651ddf61c766d5a00192c69ab7fa73f1 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 6 Jan 2026 22:10:27 -0600 Subject: [PATCH 1/6] Update for NetBox 4.5.0 --- .github/workflows/build-test.yml | 4 ++-- .github/workflows/ci.yml | 2 +- .github/workflows/pypi.yml | 4 ++-- netbox_config_backup/graphql/filters.py | 11 +++++------ pyproject.toml | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9a0334e..e2657e6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -9,10 +9,10 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.14 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.14 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 427c47e..1122b70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: NETBOX_CONFIGURATION: netbox.configuration_testing strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.12', '3.13', '3.14'] services: redis: image: redis diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index a449fc5..91a94eb 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -11,10 +11,10 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.14 uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.14 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/netbox_config_backup/graphql/filters.py b/netbox_config_backup/graphql/filters.py index b09c2dc..baff213 100644 --- a/netbox_config_backup/graphql/filters.py +++ b/netbox_config_backup/graphql/filters.py @@ -5,7 +5,7 @@ import strawberry_django # NetBox Imports -from netbox.graphql.filter_mixins import BaseObjectTypeFilterMixin +from netbox.graphql.filters import PrimaryModelFilter # Plugin Imports from netbox_config_backup import models @@ -18,9 +18,8 @@ @strawberry_django.filter(models.Backup, lookups=True) -class BackupFilter(BaseObjectTypeFilterMixin): - device: ( - Annotated['DeviceFilter', strawberry.lazy('dcim.graphql.filters')] - | None # noqa: F821 - ) = strawberry_django.filter_field() # noqa: F821 +class BackupFilter(PrimaryModelFilter): + device: Annotated['DeviceFilter', strawberry.lazy('dcim.graphql.filters')] | None = ( # noqa: F821 + strawberry_django.filter_field() + ) # noqa: F821 device_id: strawberry.ID | None = strawberry_django.filter_field() diff --git a/pyproject.toml b/pyproject.toml index 7633a7c..a01aeaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ description = "A NetBox Switch Configuration Backup Plugin" readme = "README.md" requires-python = ">=3.10" keywords = ["netbox-plugin", ] -version = "2.1.9" +version = "2.2.0" license = {file = "LICENSE"} classifiers = [ "Programming Language :: Python :: 3", From 4310fee740475520f21c23feac7721db841066f2 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 6 Jan 2026 22:42:37 -0600 Subject: [PATCH 2/6] Update minimum version requirement to 4.5.0 --- netbox_config_backup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_config_backup/__init__.py b/netbox_config_backup/__init__.py index d909220..6059ab1 100644 --- a/netbox_config_backup/__init__.py +++ b/netbox_config_backup/__init__.py @@ -13,7 +13,7 @@ class NetboxConfigBackup(PluginConfig): author = metadata.get('Author') author_email = metadata.get('Author-email') base_url = 'configbackup' - min_version = '4.4.0' + min_version = '4.5.0' required_settings = [ 'repository', 'committer', From 79b6f966de1e0e57f54bab30e9d2e8c78b83dcf7 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 6 Jan 2026 22:46:23 -0600 Subject: [PATCH 3/6] Update DB migration --- .../migrations/0023_netbox_v040500.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 netbox_config_backup/migrations/0023_netbox_v040500.py diff --git a/netbox_config_backup/migrations/0023_netbox_v040500.py b/netbox_config_backup/migrations/0023_netbox_v040500.py new file mode 100644 index 0000000..c3d8614 --- /dev/null +++ b/netbox_config_backup/migrations/0023_netbox_v040500.py @@ -0,0 +1,22 @@ +# Generated by Django 5.2.5 on 2026-01-07 04:43 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('netbox_config_backup', '0022_model_ordering'), + ('users', '0015_owner'), + ] + + operations = [ + migrations.AddField( + model_name='backup', + name='owner', + field=models.ForeignKey( + blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.owner' + ), + ), + ] From ed7c8a99647d8479ea4c2abb100e1c326539972b Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 6 Jan 2026 23:14:24 -0600 Subject: [PATCH 4/6] Update config file --- .github/configuration.testing.py | 8 ++++++-- pyproject.toml | 2 +- ruff.toml | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/configuration.testing.py b/.github/configuration.testing.py index 0588711..86bdd63 100644 --- a/.github/configuration.testing.py +++ b/.github/configuration.testing.py @@ -29,7 +29,7 @@ 'netbox_napalm_plugin': { 'NAPALM_USERNAME': 'xxx', 'NAPALM_PASSWORD': 'yyy', - } + }, } REDIS = { @@ -46,7 +46,11 @@ 'PASSWORD': '', 'DATABASE': 1, 'SSL': False, - } + }, } SECRET_KEY = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' + +API_TOKEN_PEPPERS = { + 1: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', +} diff --git a/pyproject.toml b/pyproject.toml index a01aeaf..c1bb3d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ maintainers = [ ] description = "A NetBox Switch Configuration Backup Plugin" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.12" keywords = ["netbox-plugin", ] version = "2.2.0" license = {file = "LICENSE"} diff --git a/ruff.toml b/ruff.toml index d3ac971..8b11054 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,6 @@ -exclude = [] +exclude = [ + '.github', +] line-length = 120 target-version = "py310" From 9480fda1b253fd61715ce750020392e67496c1d3 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 6 Jan 2026 23:17:19 -0600 Subject: [PATCH 5/6] Update config file --- ruff.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ruff.toml b/ruff.toml index 8b11054..654982d 100644 --- a/ruff.toml +++ b/ruff.toml @@ -3,6 +3,7 @@ exclude = [ ] line-length = 120 target-version = "py310" +output-format = "github" [lint] extend-select = ["E1", "E2", "E3", "E501", "W"] From 2ac43642b72deaa90706c00d2b58ab5c86cffd06 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 6 Jan 2026 23:39:03 -0600 Subject: [PATCH 6/6] Update graphql type --- netbox_config_backup/graphql/types.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/netbox_config_backup/graphql/types.py b/netbox_config_backup/graphql/types.py index 0a7db99..4323495 100644 --- a/netbox_config_backup/graphql/types.py +++ b/netbox_config_backup/graphql/types.py @@ -3,22 +3,16 @@ import strawberry import strawberry_django -from netbox.graphql.types import NetBoxObjectType +from netbox.graphql.types import PrimaryObjectType from .filters import * from netbox_config_backup import models -__all__ = ( - 'BackupType', -) +__all__ = ('BackupType',) -@strawberry_django.type( - models.Backup, - fields='__all__', - filters=BackupFilter -) -class BackupType(NetBoxObjectType): +@strawberry_django.type(models.Backup, fields='__all__', filters=BackupFilter) +class BackupType(PrimaryObjectType): name: str device: Annotated["DeviceType", strawberry.lazy('dcim.graphql.types')] | None