Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.0.10 #17297

Merged
merged 42 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
370c120
PRVB
jeremystretch Aug 14, 2024
e2dfa63
Update source translation strings
github-actions[bot] Aug 15, 2024
277b703
Closes #16245: Update frontend developer dependencies
jeremystretch Aug 14, 2024
c457f01
16640 fix JSON custom field save nul (#16713)
arthanson Aug 16, 2024
e656e2d
Update source translation strings
github-actions[bot] Aug 17, 2024
96802b4
Remove automatic triage assignment
jeremystretch Aug 19, 2024
38a26a7
Add "facility" field to LocationFilterForm
bctiemann Aug 21, 2024
8903e46
Fixes: #17072 - Make active links of phone and email in Contact Assig…
bctiemann Aug 22, 2024
85f8364
Set ImageAttachmentSerializer.image_width and image_height to read_only
bctiemann Aug 21, 2024
5bd4fc8
Add a Devices column with device_count hyperlink (via count_related) …
bctiemann Aug 21, 2024
d4dd86e
Update source translation strings
github-actions[bot] Aug 23, 2024
dab2769
Add styling to rendered-markdown class to clamp height and add scroll…
bctiemann Aug 23, 2024
1d2ea90
Fixes: #17108 - Update isotime and isodate filters to be timezone-awa…
bctiemann Aug 26, 2024
35e2cf9
17117 change caret to html entity to fix safari performacne issue (#1…
arthanson Aug 26, 2024
ee0af15
Update changelog
jeremystretch Aug 26, 2024
a7f83de
Fixes: #16973 - Resolve $user token to User.id for use in permissions…
bctiemann Aug 26, 2024
fd013d6
Update source translation strings
github-actions[bot] Aug 27, 2024
420613d
Fixes #16385: Restore support for white, gray, and black background c…
jeremystretch Aug 27, 2024
8bea914
Update related_objects.html
jsenecal Jul 5, 2024
515d041
Fixes #17230: Ensure consistent rendering for all dashboard widget co…
jeremystretch Aug 27, 2024
3fee28c
16946 return empty queryset if filterset is not valid (#17015)
arthanson Aug 27, 2024
0238aee
16959 Fix filter reset button (#17154)
arthanson Aug 27, 2024
263664a
Update changelog
jeremystretch Aug 27, 2024
4f225b4
16670 fix OpenAPI schema generation with nested serializers (#17078)
arthanson Aug 27, 2024
c2d67fa
Closes #17256: Fix translation support in VLAN group scope assignment…
jeremystretch Aug 27, 2024
d23b937
17219 fix custom validator display if function (#17247)
arthanson Aug 27, 2024
0157ac6
17186 change custom link button color from outline-dark to outline-se…
arthanson Aug 27, 2024
5ebdb7c
Closes #17007: Center SSO if display name is an empty string
mcmehrtens Aug 27, 2024
7bae448
16733 fix bulk edit/delete buttons with quick search (#17130)
arthanson Aug 27, 2024
c3276b7
Update changelog
jeremystretch Aug 27, 2024
cf62178
Update source translation strings
github-actions[bot] Aug 28, 2024
0464dac
Fixes: #16292 - Properly restrict GraphQL queries for querys with pk …
DanSheps Aug 28, 2024
cac9235
17286 fix add member to virtual chassis
arthanson Aug 28, 2024
50839fc
Fixes #16756: Fix table pagination for custom script results
jeremystretch Aug 28, 2024
e3e351d
Fixes #17278: Rebuild the tree after bulk editing MPTT-enabled object…
jeremystretch Aug 28, 2024
07b1362
Update source translation strings
github-actions[bot] Aug 29, 2024
8282a6d
Fixes #17279: Do not regenerate key when updating a token via REST API
jeremystretch Aug 28, 2024
a150e5d
Fixes: #16905 - Allow filtering on Device Status in InventoryItemTabl…
bctiemann Aug 29, 2024
e325a4b
Update change log
jeremystretch Aug 29, 2024
a9fd5bb
Fix broken intra-page links
jeremystretch Aug 29, 2024
3684e01
Updates for project NetBox (#17296)
transifex-integration[bot] Aug 29, 2024
97cd6b8
Release v4.0.10
jeremystretch Aug 29, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ body:
attributes:
label: NetBox Version
description: What version of NetBox are you currently running?
placeholder: v4.0.9
placeholder: v4.0.10
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v4.0.9
placeholder: v4.0.10
validations:
required: true
- type: dropdown
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/auto-assign-issue.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/configuration/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Default: False

This setting enables debugging. Debugging should be enabled only during development or troubleshooting. Note that only
clients which access NetBox from a recognized [internal IP address](#internal_ips) will see debugging tools in the user
clients which access NetBox from a recognized [internal IP address](./system.md#internal_ips) will see debugging tools in the user
interface.

!!! warning
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Default: `('127.0.0.1', '::1')`

A list of IP addresses recognized as internal to the system, used to control the display of debugging output. For
example, the debugging toolbar will be viewable only when a client is accessing NetBox from one of the listed IP
addresses (and [`DEBUG`](#debug) is true).
addresses (and [`DEBUG`](./development.md#debug) is true).

---

Expand All @@ -106,7 +106,7 @@ JINJA2_FILTERS = {

## LOGGING

By default, all messages of INFO severity or higher will be logged to the console. Additionally, if [`DEBUG`](#debug) is False and email access has been configured, ERROR and CRITICAL messages will be emailed to the users defined in [`ADMINS`](#admins).
By default, all messages of INFO severity or higher will be logged to the console. Additionally, if [`DEBUG`](./development.md#debug) is False and email access has been configured, ERROR and CRITICAL messages will be emailed to the users defined in [`ADMINS`](./miscellaneous.md#admins).

The Django framework on which NetBox runs allows for the customization of logging format and destination. Please consult the [Django logging documentation](https://docs.djangoproject.com/en/stable/topics/logging/) for more information on configuring this setting. Below is an example which will write all INFO and higher messages to a local file:

Expand Down
2 changes: 1 addition & 1 deletion docs/development/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Sometimes it becomes necessary to constrain dependencies to a particular version
djangorestframework==3.8.1
```

These version constraints are added to `base_requirements.txt` to ensure that newer packages are not installed when updating the pinned dependencies in `requirements.txt` (see the [Update Requirements](#update-requirements) section below). Before each new minor version of NetBox is released, all such constraints on dependent packages should be addressed if feasible. This guards against the collection of stale constraints over time.
These version constraints are added to `base_requirements.txt` to ensure that newer packages are not installed when updating the pinned dependencies in `requirements.txt` (see the [Update Requirements](#update-python-dependencies) section below). Before each new minor version of NetBox is released, all such constraints on dependent packages should be addressed if feasible. This guards against the collection of stale constraints over time.

### Close the Release Milestone

Expand Down
2 changes: 1 addition & 1 deletion docs/development/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Line breaks are permitted following binary operators.

### Enforcing Code Style

The [`pycodestyle`](https://pypi.org/project/pycodestyle/) utility (formerly `pep8`) is used by the CI process to enforce code style. A [pre-commit hook](./getting-started.md#2-enable-pre-commit-hooks) which runs this automatically is included with NetBox. To invoke `pycodestyle` manually, run:
The [`pycodestyle`](https://pypi.org/project/pycodestyle/) utility (formerly `pep8`) is used by the CI process to enforce code style. A [pre-commit hook](./getting-started.md#3-enable-pre-commit-hooks) which runs this automatically is included with NetBox. To invoke `pycodestyle` manually, run:

```
pycodestyle --ignore=W504,E501 netbox/
Expand Down
36 changes: 36 additions & 0 deletions docs/release-notes/version-4.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# NetBox v4.0

## v4.0.10 (2024-08-29)

### Enhancements

* [#16857](https://github.com/netbox-community/netbox/issues/16857) - Scroll long rendered Markdown content within tables
* [#16905](https://github.com/netbox-community/netbox/issues/16905) - Enable filtering of device components by device status
* [#16949](https://github.com/netbox-community/netbox/issues/16949) - Add device count column to sites table
* [#17072](https://github.com/netbox-community/netbox/issues/17072) - Linkify email addresses & phone numbers in contact assignments list
* [#17177](https://github.com/netbox-community/netbox/issues/17177) - Add facility field to locations filter form

### Bug Fixes

* [#16292](https://github.com/netbox-community/netbox/issues/16292) - Ensure consistent evaluation of queryset for both individual and list GraphQL API queries
* [#16385](https://github.com/netbox-community/netbox/issues/16385) - Restore support for white, gray, and black background colors
* [#16640](https://github.com/netbox-community/netbox/issues/16640) - Fix potential corruption of JSON values in custom fields that are not UI-editable
* [#16670](https://github.com/netbox-community/netbox/issues/16670) - Fix conflicts within OpenAPI schema definition regarding nested serializers
* [#16733](https://github.com/netbox-community/netbox/issues/16733) - Fix bulk edit/delete of objects when using "select all" widget
* [#16756](https://github.com/netbox-community/netbox/issues/16756) - Fix dynamic pagination of custom script results table
* [#16825](https://github.com/netbox-community/netbox/issues/16825) - Avoid `NoReverseMatch` exception when displaying count of related object type with no list view
* [#16946](https://github.com/netbox-community/netbox/issues/16946) - GraphQL API requests with an invalid filter should return an empty set
* [#16959](https://github.com/netbox-community/netbox/issues/16959) - Fix function of "reset" button on objects filter form
* [#16973](https://github.com/netbox-community/netbox/issues/16973) - Fix support for evaluating user token (`$user`) against custom field values in permission constraints
* [#17007](https://github.com/netbox-community/netbox/issues/17007) - Center SSO authentication icon when backend is unnamed
* [#17070](https://github.com/netbox-community/netbox/issues/17070) - Image height & width values should not be required when creating an image attachment via the REST API
* [#17108](https://github.com/netbox-community/netbox/issues/17108) - Ensure template date & time filters always return localtime-aware values
* [#17117](https://github.com/netbox-community/netbox/issues/17117) - Work around Safari rendering bug
* [#17186](https://github.com/netbox-community/netbox/issues/17186) - Fix display of custom links with default style under dark mode
* [#17219](https://github.com/netbox-community/netbox/issues/17219) - Fix system config view exception when custom validator classes are employed
* [#17230](https://github.com/netbox-community/netbox/issues/17230) - Ensure consistent rendering for all dashboard widget colors
* [#17256](https://github.com/netbox-community/netbox/issues/17256) - Fix VLAN group scope selection for non-English languages
* [#17278](https://github.com/netbox-community/netbox/issues/17278) - Ensure hierarchy is recalculated when bulk editing recursively nested object types (e.g. tenant groups)
* [#17279](https://github.com/netbox-community/netbox/issues/17279) - Do not regenerate key when updating a token via REST API
* [#17286](https://github.com/netbox-community/netbox/issues/17286) - Fix exception when adding member device to virtual chassis via web UI

---

## v4.0.9 (2024-08-14)

### Enhancements
Expand Down
27 changes: 7 additions & 20 deletions netbox/circuits/graphql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,25 @@
import strawberry
import strawberry_django

from circuits import models
from .types import *


@strawberry.type
@strawberry.type(name="Query")
class CircuitsQuery:
@strawberry.field
def circuit(self, id: int) -> CircuitType:
return models.Circuit.objects.get(pk=id)
circuit: CircuitType = strawberry_django.field()
circuit_list: List[CircuitType] = strawberry_django.field()

@strawberry.field
def circuit_termination(self, id: int) -> CircuitTerminationType:
return models.CircuitTermination.objects.get(pk=id)
circuit_termination: CircuitTerminationType = strawberry_django.field()
circuit_termination_list: List[CircuitTerminationType] = strawberry_django.field()

@strawberry.field
def circuit_type(self, id: int) -> CircuitTypeType:
return models.CircuitType.objects.get(pk=id)
circuit_type: CircuitTypeType = strawberry_django.field()
circuit_type_list: List[CircuitTypeType] = strawberry_django.field()

@strawberry.field
def provider(self, id: int) -> ProviderType:
return models.Provider.objects.get(pk=id)
provider: ProviderType = strawberry_django.field()
provider_list: List[ProviderType] = strawberry_django.field()

@strawberry.field
def provider_account(self, id: int) -> ProviderAccountType:
return models.ProviderAccount.objects.get(pk=id)
provider_account: ProviderAccountType = strawberry_django.field()
provider_account_list: List[ProviderAccountType] = strawberry_django.field()

@strawberry.field
def provider_network(self, id: int) -> ProviderNetworkType:
return models.ProviderNetwork.objects.get(pk=id)
provider_network: ProviderNetworkType = strawberry_django.field()
provider_network_list: List[ProviderNetworkType] = strawberry_django.field()
13 changes: 10 additions & 3 deletions netbox/core/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,18 @@ def get_response_serializers(self) -> typing.Any:

return response_serializers

def _get_serializer_name(self, serializer, direction, bypass_extensions=False) -> str:
name = super()._get_serializer_name(serializer, direction, bypass_extensions)

# If this serializer is nested, prepend its name with "Brief"
if getattr(serializer, 'nested', False):
name = f'Brief{name}'

return name

def get_serializer_ref_name(self, serializer):
# from drf-yasg.utils
"""Get serializer's ref_name (or None for ModelSerializer if it is named 'NestedSerializer')
"""Get serializer's ref_name
:param serializer: Serializer instance
:return: Serializer's ``ref_name`` or ``None`` for inline serializer
:rtype: str or None
Expand All @@ -137,8 +146,6 @@ def get_serializer_ref_name(self, serializer):
serializer_name = type(serializer).__name__
if hasattr(serializer_meta, 'ref_name'):
ref_name = serializer_meta.ref_name
elif serializer_name == 'NestedSerializer' and isinstance(serializer, serializers.ModelSerializer):
ref_name = None
else:
ref_name = serializer_name
if ref_name.endswith('Serializer'):
Expand Down
11 changes: 3 additions & 8 deletions netbox/core/graphql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
import strawberry
import strawberry_django

from core import models
from .types import *


@strawberry.type
@strawberry.type(name="Query")
class CoreQuery:
@strawberry.field
def data_file(self, id: int) -> DataFileType:
return models.DataFile.objects.get(pk=id)
data_file: DataFileType = strawberry_django.field()
data_file_list: List[DataFileType] = strawberry_django.field()

@strawberry.field
def data_source(self, id: int) -> DataSourceType:
return models.DataSource.objects.get(pk=id)
data_source: DataSourceType = strawberry_django.field()
data_source_list: List[DataSourceType] = strawberry_django.field()
8 changes: 7 additions & 1 deletion netbox/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
from rq.worker import Worker
from rq.worker_registration import clean_worker_registry

from extras.validators import CustomValidator
from netbox.config import get_config, PARAMS
from netbox.views import generic
from netbox.views.generic.base import BaseObjectView
from netbox.views.generic.mixins import TableMixin
from utilities.forms import ConfirmationForm
from utilities.htmx import htmx_partial
from utilities.json import ConfigJSONEncoder
from utilities.query import count_related
from utilities.views import ContentTypePermissionRequiredMixin, GetRelatedModelsMixin, register_model_view
from . import filtersets, forms, tables
Expand Down Expand Up @@ -572,13 +574,17 @@ def get(self, request):
k: getattr(config, k) for k in sorted(params)
},
}
response = HttpResponse(json.dumps(data, indent=4), content_type='text/json')
response = HttpResponse(json.dumps(data, cls=ConfigJSONEncoder, indent=4), content_type='text/json')
response['Content-Disposition'] = 'attachment; filename="netbox.json"'
return response

plugins_table = tables.PluginTable(plugins, orderable=False)
plugins_table.configure(request)

# Serialize any CustomValidator classes
if hasattr(config, 'CUSTOM_VALIDATORS') and config.CUSTOM_VALIDATORS:
config.CUSTOM_VALIDATORS = json.dumps(config.CUSTOM_VALIDATORS, cls=ConfigJSONEncoder, indent=4)

return render(request, 'core/system.html', {
'stats': stats,
'plugins_table': plugins_table,
Expand Down
4 changes: 4 additions & 0 deletions netbox/dcim/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,10 @@ class DeviceComponentFilterSet(django_filters.FilterSet):
to_field_name='name',
label=_('Virtual Chassis'),
)
device_status = django_filters.MultipleChoiceFilter(
choices=DeviceStatusChoices,
field_name='device__status',
)

def search(self, queryset, name, value):
if not value.strip():
Expand Down
Loading