Commit Graph

15609 Commits

Author SHA1 Message Date
Jeremy Stretch d76340f55e
Fixes #22882: Fix support for DISTINCT on nested GraphQL lists (#22892) 2026-08-10 09:52:01 -05:00
Jason Novinger f355a3de05 Fixes #22812: Address review — DB alias, batch size, MRO note
- batch_delete_jobs now writes through the same DB alias it reads from. In JobsMixin.delete
  the read queryset is bound to the instance's DB while Job.objects would use the router
  default; if those diverged on a multi-DB setup the deleted rows never left the read side
  and the batch loop never terminated.
- JobsMixin.delete and ScriptModule.delete honor a caller-supplied `using`, matching
  DeleteMixin.delete, instead of always recomputing it.
- Raise JOB_DELETE_BATCH_SIZE from 100 to 1000 and correct its rationale. With only('pk')
  the per-batch payload is gone, so the size now bounds per-cycle work rather than memory;
  1000 matches EXPORT_CHUNK_SIZE and was the fastest of 100/1000/5000 when benchmarked
  against a 200k-job deletion.
- Document that JobsMixin must precede DeleteMixin in the MRO or the batching is bypassed,
  and scope the ScriptModule.delete comment so it doesn't imply the on-disk file removal is
  transactional.
- Add a module-path rollback test alongside the existing script-path one.
2026-08-10 09:39:43 -05:00
Martin Hauser 53efbe0a00
Fixes #22805: Prevent repeated execution of LDAP configuration (#22809) 2026-08-10 09:04:16 -05:00
Martin Hauser 4660fbb0ab fix(ui): Improve dark mode form control contrast
Fixes form check input border contrast in dark mode by using solid grey
instead of translucent border. Updates checked checkbox glyph color to
rich black for better visibility against teal primary background.

Fixes #22879
2026-08-07 15:21:29 -04:00
Sri Chandraja Reddy Allala f7768e95dd
Fixes #22694: Clear stale Rack assignment when changing a Device's Site (#22764)
Prevent out-of-order dynamic select responses from restoring options for an
earlier dependency state.

Track the latest load request, preserve valid selections across superseding
loads, and properly finalize stale requests and their loading state. Clear any
pending restored value when a request cannot be made or fails.
2026-08-07 13:40:57 +02:00
github-actions a6451297a2 Update source translation strings 2026-08-07 05:30:32 +00:00
Martin Hauser d61528e464
Fixes #22821: Prevent Tenant Group deletion from creating duplicate ungrouped Tenant names or slugs (#22830) 2026-08-06 15:08:41 -05:00
Jeremy Stretch 80231a9706
Closes #22835: Improve performance when provisioning new custom fields (#22866) 2026-08-06 14:56:22 -05:00
Jeremy Stretch b1ee8297d2 Closes #22877: Improve caching logic when retrieving custom fields via get_for_model() 2026-08-06 13:28:18 -04:00
github-actions e160359e6e Update source translation strings 2026-08-06 05:57:19 +00:00
bctiemann 1f5a30dcd2
Merge pull request #22859 from netbox-community/22825-circuit-term-fielddoesnotexist
Fixes #22825: Handle CircuitTermination origins in cable path tracing
2026-08-05 16:10:54 -04:00
Jason Novinger 6bd50ef07d Fixes #22812: Note ConfirmCollector is intentionally Job-specific 2026-08-05 14:27:22 -05:00
Jason Novinger 7d46c995f7 Fixes #22812: Defer large Job payload fields during batched deletion
The batched job delete can't fast-delete (a global pre_delete receiver forces
per-instance signals), so each batch still instantiates its Job rows. Load only the PK
via only('pk') so those instances don't pull the large data/log_entries payloads,
cutting the resident set per batch. Also drop a dead `no-toggle` CSS class from the
delete-confirmation template (it is defined nowhere and, under Tabler, has no effect)
and use JobStatusChoices.STATUS_COMPLETED in the tests instead of a string literal.
2026-08-05 14:04:19 -05:00
Jason Novinger be69c55a99 Fixes #22812: Don't show a spurious "0 jobs" row for jobless objects
Django's Collector calls into the jobs GenericRelation branch unconditionally, so
ConfirmCollector recorded a zero count for objects with no jobs. _get_dependent_objects
then added a CountOnly(0), and the delete-confirmation page rendered "The following
objects will be deleted as a result of this action." plus a "0 jobs" row for every
jobless JobsMixin object. Only record a count when there are actually jobs.
2026-08-05 13:59:02 -05:00
Jason Novinger f2923f4ce4 Fixes #22812: Batch child-script job deletion when deleting a ScriptModule
Deleting a Script via the UI is only possible by deleting its parent ScriptModule
(no Script delete view exists). That cascades to the child Script rows, and the
collector materialized every one of those Scripts' jobs — the memory blowup, which
scales with jobs-per-script. JobsMixin.delete() only batched the deleted object's own
jobs, and a ScriptModule has none; the jobs live on its child Scripts.

Extract the chunked job-deletion loop from JobsMixin.delete() into a shared
batch_delete_jobs() helper, and add a ScriptModule.delete() override that batch-deletes
its child Scripts' jobs (in a single queryset keyed on the script PKs, no per-script
loop) before delegating to the cascade. This bounds peak memory to one batch regardless
of how many jobs the module's scripts hold.
2026-08-05 13:56:01 -05:00
Martin Hauser 75ceb55754
fix(extras): Honor Script defaults when triggered by Event Rules
Scripts triggered by Event Rules now respect notifications_default and
job_timeout from script Meta class. Updates documentation to clarify
this behavior and adds regression test coverage.

Fixes #22852
2026-08-05 18:01:38 +02:00
github-actions 280e32fcc9 Update source translation strings 2026-08-05 05:54:34 +00:00
Jason Novinger 0701a42a94 Fixes #22812: Avoid loading all jobs into memory when deleting a JobsMixin object
Deleting a Script (or any JobsMixin object) with thousands of associated jobs could
consume several GB of memory and exhaust the host, because Django's deletion collector
loads every related Job into memory. Jobs can never be fast-deleted (a global pre_delete
receiver forces per-instance signal dispatch), and each Job carries potentially large
data and log_entries payloads.

Two paths loaded the full job set independently, so both are addressed:

- The delete cascade: JobsMixin.delete() now deletes the object's jobs in batches before
  delegating to super().delete(), wrapped in a transaction so a failure in the parent
  delete rolls the job deletions back. After the loop the cascade collector finds no jobs
  to materialize.

- The delete-confirmation page: _get_dependent_objects() uses a ConfirmCollector that
  counts the jobs relation rather than descending into it, so the page never instantiates
  the jobs. Counted relations render as a non-expandable row (via a CountOnly stand-in)
  alongside the itemized dependents.
2026-08-04 16:39:35 -05:00
Elliott Balsley 3d3bebcb78
Closes #22787: Improve GraphQL query efficiency when resolving assigned objects (#22792) 2026-08-04 15:28:20 -04:00
bctiemann 8b203e55a8
Merge pull request #22850 from netbox-community/22844-CustomFieldChoiceSetSerializer-base_choices
Fixes #22844: Allow null value for CustomFieldChoiceSet `base_choices` in REST API
2026-08-04 13:54:25 -04:00
Jeremy Stretch 852f73b081 Release v4.6.8-rc2 2026-08-04 13:24:01 -04:00
Jason Satein c36e72876f
Closes #22567: Warn that a custom script file name must not shadow an installed Python module (#22804) 2026-08-04 08:36:11 -07:00
github-actions bb29246033 Update source translation strings 2026-08-04 05:56:44 +00:00
Jason Novinger a158ed3794 Fixes #22825: Handle CircuitTermination origins in cable path tracing
CablePath.save() and delete() wrote the _path back-reference onto the path's
origin object, and PathTraceView built the trace SVG URL from the origin's REST
API action. Both assume the origin is a PathEndpoint, but a CircuitTermination
is a valid cable-path origin (per from_origin) without the _path field or a
-trace API action, so those paths raised FieldDoesNotExist and NoReverseMatch
respectively. Guard the _path writes and the SVG URL on PathEndpoint membership,
and skip the SVG block in the template when no URL is available.
2026-08-03 16:10:32 -05:00
Jeremy Stretch be72e841f5 Closes #22837: Omit implicit pagination on GraphQL to-one prefetches 2026-08-03 14:57:42 -04:00
Jeremy Stretch 4afdb31b89
Fixes #22848: Ensure deterministic ordering for duplicate IP addresses (#22849) 2026-08-03 11:58:24 -05:00
Jeremy Stretch 6047ce1a37
Fixes #22854: Set `USE_SHADOW_DOM=False` to fix GraphiQL queries w/debug enabled (#22855) 2026-08-03 11:13:40 -05:00
bctiemann 071c78d172
Closes #22828: Validate Webhook.payload_url as a URL or Jinja2 template (#22832) 2026-08-03 10:46:24 -05:00
Jeremy Stretch 492cb83cc3 Fixes #22844: Allow null value for CustomFieldChoiceSet base_choices in REST API 2026-08-03 09:00:07 -04:00
Jeremy Stretch 4877d1167f Correct release date for v4.6.7 2026-07-31 16:48:04 -04:00
github-actions 42cb0326fb Update source translation strings 2026-07-31 06:00:45 +00:00
Jeremy Stretch a1fc744556 Release v4.6.7 2026-07-30 16:36:25 -04:00
Jason Novinger 1f3aac25db
Closes #22810: Skip cached scope rebuild when scope fields are unchanged (#22811) 2026-07-30 15:22:11 -05:00
Jeremy Stretch aefe938c63 Closes #22823: Avoid extraneous DB queries when fetching IP/prefix family via GraphQL API 2026-07-30 13:38:47 -04:00
bctiemann b5c6619108
Merge pull request #22806 from netbox-community/22800-circuitgroupassignmentspanel-not-filtered-by-circuit-type
Fixes #22800: Fix filtering of Circuit Group Assignments by member type
2026-07-30 13:03:53 -04:00
bctiemann 6f9c6080e5
Merge pull request #22827 from netbox-community/22822-graphql-rack-units
Closes #22822: Avoid extra DB query when fetching rack reservation units via GraphQL API
2026-07-30 12:25:44 -04:00
Jeremy Stretch d3735f2db5 Closes #22822: Avoid extra DB query when fetching rack reservation units via GraphQL API 2026-07-30 11:50:18 -04:00
Jeremy Stretch a1df1b99b0 Fixes #22813: Fix extraneous database queries when fetching custom field data via GraphQL API 2026-07-30 11:30:29 -04:00
github-actions 6a1b4afc43 Update source translation strings 2026-07-30 05:53:04 +00:00
Martin Hauser 052506fe9c
Fixes #22738: Correct IPAM availability under constrained object permissions (#22785) 2026-07-29 17:27:09 -04:00
Martin Hauser 29860aaf76
fix(circuits): Add member_type_id filter to CircuitGroupAssignment
Adds `member_type_id` filter field to support filtering by
ContentType ID alongside existing `member_type` filter. Includes
test coverage verifying correct filtering when member IDs overlap across
different Content Types.

Fixes #22800
2026-07-29 15:07:42 +02:00
github-actions 10ac9ffe8d Update source translation strings 2026-07-29 05:58:26 +00:00
Jeremy Stretch 567524b7b8
Update claude-code-action; change model to Opus 5 (#22788) 2026-07-28 16:25:52 -05:00
Jeremy Stretch fb8c455ba6 Release v4.6.6 2026-07-28 13:25:44 -04:00
Arthur Hanson 7472c5d067
22752 - Restore rear port fields on front port bulk import (#22776) 2026-07-28 10:02:41 -04:00
studioussagar eaa2816964
Closes #22522: Render colored badges for Custom Field Choices in tables (#22663)
Render select and multiselect custom field values as colored badges in
table views when their associated choices define colors.

For multiselect fields, render all selected values as badges when any
selected choice has a color, using the secondary badge color for
uncolored choices. Preserve comma-separated text when none of the
selected choices has a color.

Add test coverage for colored, uncolored, empty, mixed, and
HTML-sensitive choice values.

Co-authored-by: Martin Hauser <mhauser@netboxlabs.com>
2026-07-28 15:35:30 +02:00
Abhirupmandal 749e1b6579
Fixes #22690: Restore the left border on the quick search field 2026-07-28 09:32:57 -04:00
Martin Hauser 1e48c81666 docs(permissions): Add note about JSON escaping in constraint definitions
Clarifies that backslashes in constraint values must be escaped in JSON.
Includes example showing regex pattern escaping and adds table entry
demonstrating regex constraint usage.

Fixes #22498
2026-07-28 09:30:59 -04:00
Jason Novinger b3c27b951d
Closes #22790: Enforce SavedFilter visibility when applied via filter/filter_id (#22791)
BaseFilterSet resolved referenced SavedFilters without a visibility check, so
a private (shared=False) filter owned by one user could have its parameters
applied to another user's request. Restrict resolution to shared or owned
filters via restrict_to_shared(), matching the visibility enforced on the UI,
REST, and GraphQL SavedFilter surfaces.
2026-07-28 10:51:14 +02:00
bctiemann 8aa7b3b2c8
Merge pull request #22780 from netbox-community/22768-cable-removal-stores-an-empty-string-instead-of-null-in
Fixes #22768: Store null values for cable_end when removing Cables
2026-07-27 15:02:52 -04:00