Commit Graph

15195 Commits

Author SHA1 Message Date
Jason Novinger 2ab29e277c Add tests for deadlock retry middleware logic
Tests cover: retry on deadlock, retry on lock timeout, single-retry
limit, non-retriable errors pass through, fresh request ID on retry,
and OperationalError without a psycopg cause.
2026-05-08 10:55:37 -05:00
Jason Novinger c4a1303db2 Retry request once on PostgreSQL deadlock or lock timeout
When a request fails due to a PostgreSQL deadlock (40P01) or lock
timeout (55P03), CoreMiddleware now catches the OperationalError,
closes the database connection, and re-dispatches the request with
a fresh request ID and clean event tracking state.

This addresses cascading failures caused by concurrent API write
operations (e.g. automated device reconciliation at high throughput)
where deadlocked requests return 500 errors and aggressive client
retries worsen contention.
2026-05-08 10:55:13 -05:00
Martin Hauser cd56523cc5 chore(ci): Limit CI push trigger to main and feature
Restrict the CI workflow's push trigger to the main and feature branches
while preserving the existing paths-ignore filters.

This avoids unnecessary push-triggered CI runs on topic branches without
changing pull request workflow behavior.

Fixes #19324
2026-05-08 08:06:34 -04:00
Arthur Hanson bf23a0b3fd
Fixes #22055: Report API exceptions to Monitoring Services (#22106)
Ensure CoreMiddleware emits Django's got_request_exception signal before
returning handled 500 responses for API requests and custom error templates.

This allows integrations such as Sentry to report exceptions that would
otherwise be hidden when middleware returns a custom error response.
2026-05-08 13:59:44 +02:00
Jeremy Stretch 523ecba867
Closes #22114: Split CI into conditional jobs (#22126) 2026-05-08 09:35:46 +02:00
github-actions 6926580124 Update source translation strings 2026-05-08 05:41:23 +00:00
Martin Hauser 770c3647fb feat(ui): Add nested breadcrumb display for GenericForeignKey attrs
Add `nested` and `max_depth` params to GenericForeignKeyAttr to render
hierarchical objects as breadcrumbs when they expose `get_ancestors()`.
Applied to scope fields in IPAM/wireless and circuit termination points.

Fixes #21938
2026-05-07 14:35:59 -04:00
Arthur Hanson c45482c4af
#21934 allow highlight override table stripping (#22018) 2026-05-07 14:33:03 -04:00
Jason Novinger c20e6dd2ee
Closes #20776: Add changelog message to bulk rename process (#22100)
Add changelog message support to BulkRenameView for models that support
change logging. Introduce NetBoxModelBulkRenameForm as a changelog-aware
wrapper around the existing utilities.forms.BulkRenameForm, preserving the
existing import path while avoiding circular imports.

Set _changelog_message before saving renamed objects in both MPTT and
non-MPTT rename paths, and add a regression test to verify that the
submitted message is recorded on the resulting ObjectChange records.

Remove unused VMInterfaceBulkRenameForm and VirtualDiskBulkRenameForm,
along with their unused view references, since BulkRenameView constructs
its form dynamically.
2026-05-07 18:23:00 +02:00
Jeremy Stretch f2187ceb8f
Closes #22102: Add a GIN index on CablePath to optimize filtering of cable paths by node (#22144) 2026-05-07 11:22:14 -05:00
Jeremy Stretch 088de70b10
Remove prohibition on AI-generated PRs and add guidance to AGENTS.md (#22133) 2026-05-07 18:13:02 +02:00
Jeremy Stretch 2703ff98a3
Closes #22128: Deprecate v1 API tokens (#22143)
Display a warning in the UI whenever a user goes to provision a v1
token (both via the admin token form and the user profile token form).
Update documentation to note that v1 tokens are deprecated and will be
removed in NetBox v5.0.
2026-05-07 08:48:25 -07:00
Jeremy Stretch 734a69c9a7
Closes #22141: Deprecate support for PostgreSQL 14 (#22142) 2026-05-07 17:14:02 +02:00
Jeremy Stretch e50aff8736
Documentation cleanup (#22127) 2026-05-06 16:58:08 -05:00
Jeremy Stretch b3bc4f8ef2
Closes CAP-100: Adopt AI best practices (#22120) 2026-05-06 13:04:23 -07:00
Martin Hauser 4407505f87 chore(ci): Collect coverage from parallel test workers
Configure coverage.py for multiprocessing so Django's parallel test
workers are included in the coverage data.

Move coverage source and report settings into pyproject.toml,
and combine per-process coverage data before generating the report.

Fixes #22118
2026-05-06 09:55:46 -04:00
github-actions 30f9d3ed60 Update source translation strings 2026-05-06 05:59:55 +00:00
Martin Hauser 7e9eac5b87
Closes #22093: Run coverage only on a single matrix entry (#22117)
Add explicit CI job names showing the Python and Node versions, with the
coverage job clearly marked in the GitHub Actions UI.

Run coverage only for the designated coverage matrix entry to avoid
redundant coverage collection and reporting across the full test matrix.

Also add the YAML document marker and clean up trailing whitespace.
2026-05-05 19:06:26 +02:00
Martin Hauser f3c5b00932
Closes #22056: Clean up obsolete .gitignore entries and add comments (#22116) 2026-05-05 11:25:06 -05:00
Martin Hauser 589169f860 chore(ruff): Consolidate tool config into pyproject.toml
Move Ruff configuration from ruff.toml into pyproject.toml and remove
obsolete Black, isort, and Pylint sections.
Consolidates all Python tooling config in a single file following
modern Python packaging standards.

Fixes #22099
2026-05-05 10:54:55 -04:00
Jeremy Stretch 93176be707
Prohibit AI-generated issues (#22101) 2026-05-05 15:29:57 +02:00
Jeremy Stretch d81c2cb739
Closes #21951: Add convenience scripts for database management (#22113) 2026-05-05 15:28:05 +02:00
Jeremy Stretch 00791344e6 Release v4.6.0 2026-05-05 08:55:05 -04:00
Jeremy Stretch 1e1548edd1
Merge pull request #22111 from netbox-community/feature
Merge `feature` into `main` ahead of v4.6.0 release
2026-05-05 08:22:18 -04:00
Jeremy Stretch 28a5c7d882 Merge branch 'main' into feature 2026-05-04 13:02:42 -04:00
Jeremy Stretch b78bd71329 Release v4.5.10 2026-05-04 12:48:34 -04:00
Martin Hauser 05dcf02dbe fix(dcim): Mark cable_end as nullable in CabledObject Serializer
Use DRF's ChoiceField for `cable_end` to preserve the existing raw
"A"/"B" API output while documenting the allowed values and nullability
in the generated schema.

Fixes #22084
2026-05-04 11:51:25 -04:00
Arthur Hanson 364953edc5
Closes #22034: Fix rack group migration from very old netbox installation (#22063)
* #22034 fix rack group migation from very old netbox installation

* #22034 fix rack group migation from very old netbox installation

* #22034 fix rack group migation from very old netbox installation

* fix after loading old database

* simplify

* fix index name
2026-05-01 14:38:59 -04:00
Jeremy Stretch 8830519da2
Closes #22062: Display API token ID & plaintext one time immediately upon creation (#22064) 2026-05-01 16:04:35 +02:00
Jeremy Stretch 92c5aff713
Closes #22048: Deprecate `expand_ipaddress_pattern()` (#22051) 2026-04-30 16:50:12 +02:00
Jeremy Stretch 1452d57f38
Closes #22047: Deprecate ExpandableIPAddressField (#22050) 2026-04-30 16:49:39 +02:00
Jeremy Stretch a1c529ddbf
Closes #22046: Deprecate OptionalLimitOffsetPagination (#22049) 2026-04-30 16:49:09 +02:00
github-actions fe80048374 Update source translation strings 2026-04-30 06:00:05 +00:00
Jeremy Stretch baa2ff3ade
Fixes #22029: Recast empty string values on unique nullable fields as null (#22035) 2026-04-29 15:36:25 -05:00
bctiemann 166b5f9c0c
Merge pull request #22037 from netbox-community/22031-add-prefix-to-vlan-field-id-expected-a-number-but-got-none
Fixes #22031: Fix error when adding a Prefix from a VLAN with no Tenant or Site
2026-04-29 13:42:57 -04:00
Jeremy Stretch 1b1989ea98
Clean up Claude workflows (#22038)
* Clean up Claude workflows

* Tweak triage prompt

* Fix permissions
2026-04-29 16:17:01 +02:00
Martin Hauser d01454c753
fix(ipam): Omit None values from AddObject URL parameters
Update AddObject.get_url() to skip parameters that resolve to None,
preventing invalid query strings.
Adjust VLAN-to-Prefix action to use scope_type/scope instead of site
field.

Fixes #22031
2026-04-29 15:03:52 +02:00
github-actions 385767c41f Update source translation strings 2026-04-29 05:58:57 +00:00
Martin Hauser 7eb66c185b
fix(dcim): Require complete cable paths for connected filter (#22022)
Update InterfaceFilterSet to check both is_active and is_complete when
filtering by connected=true. Incomplete pass-through paths (e.g. cabled
front ports without rear port connections) are now correctly excluded.

Fixes regression where active but incomplete cable paths were incorrectly
returned as connected.

Fixes #22005
2026-04-28 11:20:02 -07:00
bctiemann 6a675d7fa7
Merge pull request #22015 from netbox-community/21990-device
#21990 fix deletion of device from Virtual Machines
2026-04-28 13:02:56 -04:00
Jeremy Stretch b76f313ca4
Permit Claude triage workflow for users without write permission (#22026)
* Permit triage workflow for users without write permission

* Bump claude-code-action to v1.0.108
2026-04-28 18:08:03 +02:00
Jeremy Stretch da2d19c932 Release v4.6.0-beta2 2026-04-28 10:56:59 -04:00
Jeremy Stretch 3ccf4e2d14 Merge branch 'main' into feature 2026-04-28 10:19:36 -04:00
Jeremy Stretch 8fbb6f74d3
Release v4.5.9 (#22024) 2026-04-28 09:45:20 -04:00
Jeremy Stretch d6fdfec0e5 Remove id-token: write; add github_token 2026-04-28 07:53:45 -04:00
github-actions 1fd241995f Update source translation strings 2026-04-28 05:59:53 +00:00
Martin Hauser fa2d762f2b
Fixes #22002: Enable horizontal scrolling for Context Table Panels (#22009) 2026-04-27 16:40:50 -05:00
Arthur Hanson 55b48149c7
Fixes #21995: Don't copy unique fields when adding another Contact (#22017) 2026-04-27 22:28:03 +02:00
Jeremy Stretch ff5f64abf8 Restore id-token write permission 2026-04-27 14:10:44 -04:00
Arthur be86c50204 cleanup 2026-04-27 11:06:03 -07:00