Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
NETBOX_CONFIGURATION: netbox.configuration_lifecycle
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.12', '3.13', '3.14']
services:
redis:
image: redis
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,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
Expand Down
4 changes: 4 additions & 0 deletions contrib/configuration_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@

SECRET_KEY = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

API_TOKEN_PEPPERS = {
1: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
}

DEFAULT_PERMISSIONS = {}

LOGGING = {
Expand Down
2 changes: 1 addition & 1 deletion netbox_lifecycle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NetBoxLifeCycle(PluginConfig):
author = metadata.get('Author')
author_email = metadata.get('Author-email')
base_url = 'lifecycle'
min_version = '4.3.0'
min_version = '4.5.0'
required_settings = []
default_settings = {
'lifecycle_card_position': 'right_page',
Expand Down
16 changes: 8 additions & 8 deletions netbox_lifecycle/graphql/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import strawberry
import strawberry_django

from core.graphql.filter_mixins import BaseObjectTypeFilterMixin
from netbox.graphql.filters import PrimaryModelFilter
from netbox_lifecycle import models


Expand All @@ -19,28 +19,28 @@


@strawberry_django.filter(models.Vendor, lookups=True)
class VendorFilter(BaseObjectTypeFilterMixin):
class VendorFilter(PrimaryModelFilter):
pass


@strawberry_django.filter(models.SupportSKU, lookups=True)
class SupportSKUFilter(BaseObjectTypeFilterMixin):
class SupportSKUFilter(PrimaryModelFilter):
manufacturer: (
Annotated['ManufacturerFilter', strawberry.lazy('dcim.graphql.filters')] | None
) = strawberry_django.filter_field()
manufacturer_id: strawberry.ID | None = strawberry_django.filter_field()


@strawberry_django.filter(models.SupportContract, lookups=True)
class SupportContractFilter(BaseObjectTypeFilterMixin):
class SupportContractFilter(PrimaryModelFilter):
vendor: (
Annotated['ManufacturerFilter', strawberry.lazy('dcim.graphql.filters')] | None
) = strawberry_django.filter_field()
vendor_id: strawberry.ID | None = strawberry_django.filter_field()


@strawberry_django.filter(models.SupportContractAssignment, lookups=True)
class SupportContractAssignmentFilter(BaseObjectTypeFilterMixin):
class SupportContractAssignmentFilter(PrimaryModelFilter):
contract: (
Annotated[
'SupportContractFilter', strawberry.lazy('netbox_lifecycle.graphql.filters')
Expand Down Expand Up @@ -74,15 +74,15 @@ class SupportContractAssignmentFilter(BaseObjectTypeFilterMixin):


@strawberry_django.filter(models.License, lookups=True)
class LicenseFilter(BaseObjectTypeFilterMixin):
class LicenseFilter(PrimaryModelFilter):
manufacturer: (
Annotated['ManufacturerFilter', strawberry.lazy('dcim.graphql.filters')] | None
) = strawberry_django.filter_field()
manufacturer_id: strawberry.ID | None = strawberry_django.filter_field()


@strawberry_django.filter(models.LicenseAssignment, lookups=True)
class LicenseAssignmentFilter(BaseObjectTypeFilterMixin):
class LicenseAssignmentFilter(PrimaryModelFilter):
vendor: (
Annotated['VendorFilter', strawberry.lazy('netbox_lifecycle.graphql.filters')]
| None
Expand All @@ -107,7 +107,7 @@ class LicenseAssignmentFilter(BaseObjectTypeFilterMixin):


@strawberry_django.filter(models.HardwareLifecycle, lookups=True)
class HardwareLifecycleFilter(BaseObjectTypeFilterMixin):
class HardwareLifecycleFilter(PrimaryModelFilter):
device_type: (
Annotated['DeviceTypeFilter', strawberry.lazy('dcim.graphql.filters')] | None
) = strawberry_django.filter_field()
Expand Down
16 changes: 8 additions & 8 deletions netbox_lifecycle/graphql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ModuleType,
)
from virtualization.graphql.types import VirtualMachineType
from netbox.graphql.types import NetBoxObjectType
from netbox.graphql.types import PrimaryObjectType
from .filters import *

from netbox_lifecycle import models
Expand All @@ -28,12 +28,12 @@


@strawberry_django.type(models.Vendor, fields='__all__', filters=VendorFilter)
class VendorType(NetBoxObjectType):
class VendorType(PrimaryObjectType):
name: str


@strawberry_django.type(models.SupportSKU, fields='__all__', filters=SupportSKUFilter)
class SupportSKUType(NetBoxObjectType):
class SupportSKUType(PrimaryObjectType):

sku: str
manufacturer: ManufacturerType
Expand All @@ -42,7 +42,7 @@ class SupportSKUType(NetBoxObjectType):
@strawberry_django.type(
models.SupportContract, fields='__all__', filters=SupportContractFilter
)
class SupportContractType(NetBoxObjectType):
class SupportContractType(PrimaryObjectType):

vendor: VendorType
contract_id: str
Expand All @@ -52,7 +52,7 @@ class SupportContractType(NetBoxObjectType):


@strawberry_django.type(models.License, fields='__all__', filters=LicenseFilter)
class LicenseType(NetBoxObjectType):
class LicenseType(PrimaryObjectType):

manufacturer: ManufacturerType
name: str
Expand All @@ -63,7 +63,7 @@ class LicenseType(NetBoxObjectType):
fields='__all__',
filters=SupportContractAssignmentFilter,
)
class SupportContractAssignmentType(NetBoxObjectType):
class SupportContractAssignmentType(PrimaryObjectType):
contract: SupportContractType
sku: SupportSKUType | None
device: DeviceType | None
Expand All @@ -76,7 +76,7 @@ class SupportContractAssignmentType(NetBoxObjectType):
@strawberry_django.type(
models.LicenseAssignment, fields='__all__', filters=LicenseAssignmentFilter
)
class LicenseAssignmentType(NetBoxObjectType):
class LicenseAssignmentType(PrimaryObjectType):
license: LicenseType
vendor: VendorType
device: DeviceType | None
Expand All @@ -87,7 +87,7 @@ class LicenseAssignmentType(NetBoxObjectType):
@strawberry_django.type(
models.HardwareLifecycle, fields='__all__', filters=HardwareLifecycleFilter
)
class HardwareLifecycleType(NetBoxObjectType):
class HardwareLifecycleType(PrimaryObjectType):
assigned_object_type: (
Annotated["ContentTypeType", strawberry.lazy('netbox.graphql.types')] | None
)
Expand Down
85 changes: 85 additions & 0 deletions netbox_lifecycle/migrations/0018_netbox_v040500.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Generated by Django 5.2.5 on 2026-01-07 04:52

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("netbox_lifecycle", "0017_optional_lifecycle_dates"),
("users", "0015_owner"),
]

operations = [
migrations.AddField(
model_name="hardwarelifecycle",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
migrations.AddField(
model_name="license",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
migrations.AddField(
model_name="licenseassignment",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
migrations.AddField(
model_name="supportcontract",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
migrations.AddField(
model_name="supportcontractassignment",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
migrations.AddField(
model_name="supportsku",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
migrations.AddField(
model_name="vendor",
name="owner",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="users.owner",
),
),
]
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ maintainers = [
]
description = "NetBox Support Contract and EOL/EOS management"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.12"
keywords = ["netbox-plugin", ]
version = "1.1.6"
version = "1.1.7"
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python :: 3",
Expand Down
5 changes: 4 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
exclude = []
exclude = [
'.github',
'contrib',
]
line-length = 120
target-version = "py310"
output-format = "github"
Expand Down