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 v3.7.0 #14636

Merged
merged 85 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3f40ee5
Closes #14036: Move extras.plugins to netbox.plugins (#14086)
jeremystretch Oct 20, 2023
450790a
Closes #13550: Refactor view action mappings (#14062)
jeremystretch Oct 20, 2023
ae447bd
12216 Add color to circuit-type and add to SVG rendering (#14098)
arthanson Oct 24, 2023
7274e75
13230 Allow Devices to be excluded from Rack utilization (#14099)
arthanson Oct 24, 2023
30ce9ed
Closes #13381: Enable plugins to register custom data backends (#14095)
jeremystretch Oct 24, 2023
c4e765c
Closes #14141: translation cleanup (#14143)
jeremystretch Oct 30, 2023
edc4a35
Initial work on #10244: Protection rules (#14097)
jeremystretch Oct 30, 2023
7323668
Closes #13334: Record error message on failed jobs (#14106)
jeremystretch Oct 31, 2023
77208bf
Fix migrations
jeremystretch Oct 31, 2023
c2d1988
Closes #14035: Order global search results of equivalent weight by va…
jeremystretch Nov 1, 2023
944008d
Closes #12135: Prevent the deletion of interfaces with children (#14091)
jeremystretch Nov 1, 2023
f6338ab
Closes #13690: List all objects to be deleted (#14089)
ITJamie Nov 1, 2023
8dcbd66
Closes #13427: Public model registration (#14152)
jeremystretch Nov 3, 2023
ac91d4e
Merge branch 'develop' into feature
jeremystretch Nov 9, 2023
2562c87
Closes #14156: Add custom field support for contact assignments
jeremystretch Nov 6, 2023
3d20276
Closes #14134: Display additional object attributes in global search …
jeremystretch Nov 9, 2023
840b7d8
Closes #13645: Make Sentry integration optional (#14197)
jeremystretch Nov 9, 2023
69a4c31
Closes #13794: Dynamically populate related objects list under tenant…
jeremystretch Nov 16, 2023
e15647a
Closes #14153: Filter ContentTypes by supported feature (#14191)
jeremystretch Nov 16, 2023
e767fec
Closes #14173: Enable plugins to register columns on core tables (#14…
jeremystretch Nov 16, 2023
e13bf48
Add /api/virtualization/virtual-machines/{id}/render-config/ endpoint…
pkorovin Nov 17, 2023
549b0ea
Closes #8356: Add virtual disk to Virtual Machines (#14087)
arthanson Nov 17, 2023
a73ba00
Closes #13299: Improve options for controlling custom field visibilit…
jeremystretch Nov 20, 2023
18422e1
Closes #14326: Move form mixins (#14327)
jeremystretch Nov 22, 2023
975a647
Closes #14312: Move ConfigRevision to core (#14328)
jeremystretch Nov 27, 2023
6678880
Closes #9816: VPN tunnel support (#14276)
jeremystretch Nov 27, 2023
e498930
Draft v3.7 release notes
jeremystretch Nov 28, 2023
8e7146c
v3.7 documentation updates
jeremystretch Nov 28, 2023
d2fea4e
Closes #14311: Move L2VPN models from `ipam` to `vpn` (#14358)
jeremystretch Nov 28, 2023
b83fcc6
Merge branch 'develop' into feature
jeremystretch Nov 30, 2023
a38a382
14132 Add EventRule - change webhook and add in script processing to …
arthanson Nov 30, 2023
b812a50
Closes #14361: Add a description field to Webhook (#14380)
jeremystretch Nov 30, 2023
4fc0a99
Closes #14365: Introduce job_start and job_end signals (#14393)
jeremystretch Dec 1, 2023
85ab7ad
Closes #14395: Move & rename process_webhook()
jeremystretch Dec 1, 2023
dea5f94
Finish draft release notes
jeremystretch Dec 1, 2023
2ed261e
Update developer model docs
jeremystretch Dec 1, 2023
e4824db
Improve rendering of JSON data
jeremystretch Dec 1, 2023
7cec4e9
#12135: Elegantly handle ProtectedError/RestrictedError exceptions
jeremystretch Dec 1, 2023
dcd3f09
#13230: Tweak field description
jeremystretch Dec 1, 2023
7a63e11
#13299: Fix display of empty string values
jeremystretch Dec 1, 2023
0340a5e
#13299: Clean up custom field form field help text
jeremystretch Dec 1, 2023
0c9919a
#13334: Capture exception class when recording job error
jeremystretch Dec 1, 2023
e893ffc
#13550: Clean up bulk view docstrings
jeremystretch Dec 1, 2023
bf18215
#13794: Fix alphabetical ordering of related models
jeremystretch Dec 1, 2023
42ab8ee
#14153: Import proxy ContentType for nbshell
jeremystretch Dec 1, 2023
3faf485
#9816: Misc cleanup
jeremystretch Dec 4, 2023
5b0b366
#9816: Promote IKE & IPSec proposals and policies to primary models
jeremystretch Dec 4, 2023
c0512e2
#14311: Update model documentation
jeremystretch Dec 4, 2023
625825d
Fixes #14402: Avoid nullifying disk value when editing a VM with disk…
jeremystretch Dec 4, 2023
cfc20f9
#14132: Fix migration
jeremystretch Dec 4, 2023
5d57e98
#14132: Simplify form logic for script EventRules
jeremystretch Dec 4, 2023
deadde8
#14132: Extend EventRule template
jeremystretch Dec 4, 2023
115111d
#14132: Fix documentation link
jeremystretch Dec 4, 2023
2b7cc1e
Upgrade Markdown to v3.5.1
jeremystretch Dec 4, 2023
9f1283f
Upgrade django-taggit to v5.0.1
jeremystretch Dec 4, 2023
8db1093
#9816: Add TunnelGroup
jeremystretch Dec 4, 2023
1afac47
Documentation cleanup
jeremystretch Dec 5, 2023
f58d806
Release v3.7-beta1
jeremystretch Dec 5, 2023
5d2f499
Fixes #14432: Fix hyperlinks for global search result attributes
jeremystretch Dec 7, 2023
2d1f882
Closes #14458: Remove the clearcache management command
jeremystretch Dec 7, 2023
b532435
Closes #14436: Add indexes for all GenericForeignKey fields (#14463)
jeremystretch Dec 7, 2023
d428dd1
Fixes #14472: Fix display of hidden custom fields in object edit forms
jeremystretch Dec 8, 2023
965f2de
14424 Remove ChangeLoggedModel from StagedChange (#14476)
arthanson Dec 11, 2023
224d640
14147 Prevent logging to Change Log when no changes are made (#14477)
arthanson Dec 15, 2023
3068f2a
Changelog for #14147, #14424, #14436, #14458
jeremystretch Dec 15, 2023
25e67eb
Merge branch 'develop' into feature
jeremystretch Dec 15, 2023
96878cf
Closes #14551: Show assigned tunnel (if any) under interface view
jeremystretch Dec 19, 2023
b794bd6
Fixes #14499: Relax requirements for encryption/auth algorithms on IK…
jeremystretch Dec 19, 2023
a233dc9
Closes #14536: Enable ENFORCE_GLOBAL_UNIQUE by default
jeremystretch Dec 19, 2023
3cd2432
Rebuild source messages
jeremystretch Dec 21, 2023
3905ddf
Add initial message maps for es, fr, pt, and ru
jeremystretch Dec 21, 2023
326b54b
Closes #14579: Add user language preference
jeremystretch Dec 21, 2023
58f925c
Closes #14503: Include additional display attributes for search indexers
jeremystretch Dec 21, 2023
00807d1
Fixes #14550: Fix changing event rule action type from webhook to scr…
jeremystretch Dec 22, 2023
4eadc8c
Closes #14240: Increase min/max validation values for custom fields
jeremystretch Dec 27, 2023
1f2f086
Merge branch 'develop' into feature
jeremystretch Dec 27, 2023
11bc460
Update release notes
jeremystretch Dec 27, 2023
d5c1cb0
Merge branch 'develop' into feature
jeremystretch Dec 28, 2023
d930c4e
Apply filterset & test changes for #14631 & #14629
jeremystretch Dec 28, 2023
d9c1ba8
Add translations to changelog
jeremystretch Dec 28, 2023
224484e
Closes #14434: Add termination object filters for cables (#14617)
jeremystretch Dec 28, 2023
33af942
Closes #14624: Add action object column to EventRuleTable
jeremystretch Dec 28, 2023
c1ff748
#14036: Update import paths in example plugin code
jeremystretch Dec 29, 2023
7c4b939
Revise v3.7 release notes
jeremystretch Dec 29, 2023
d99e651
Release v3.7.0
jeremystretch Dec 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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 @@ -23,7 +23,7 @@ body:
attributes:
label: NetBox Version
description: What version of NetBox are you currently running?
placeholder: v3.6.9
placeholder: v3.7.0
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: v3.6.9
placeholder: v3.7.0
validations:
required: true
- type: dropdown
Expand Down
12 changes: 3 additions & 9 deletions base_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ django-tables2

# User-defined tags for objects
# https://github.com/jazzband/django-taggit/blob/master/CHANGELOG.rst
# TODO: Upgrade to v5.0 for NetBox v3.7 beta
django-taggit<5.0
django-taggit

# A Django field for representing time zones
# https://github.com/mfogel/django-timezone-field/
Expand Down Expand Up @@ -90,9 +89,8 @@ gunicorn
Jinja2

# Simple markup language for rendering HTML
# https://python-markdown.github.io/change_log/
# mkdocs currently requires Markdown v3.3
Markdown<3.4
# https://python-markdown.github.io/changelog/
Markdown

# File inclusion plugin for Python-Markdown
# https://github.com/cmacmackin/markdown-include
Expand Down Expand Up @@ -126,10 +124,6 @@ PyYAML
# https://github.com/psf/requests/blob/main/HISTORY.md
requests

# Sentry SDK
# https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md
sentry-sdk

# Social authentication framework
# https://github.com/python-social-auth/social-core/blob/master/CHANGELOG.md
social-auth-core
Expand Down
18 changes: 3 additions & 15 deletions docs/administration/error-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,15 @@

### Enabling Error Reporting

NetBox supports native integration with [Sentry](https://sentry.io/) for automatic error reporting. To enable this functionality, simply set `SENTRY_ENABLED` to True in `configuration.py`. Errors will be sent to a Sentry ingestor maintained by the NetBox team for analysis.

```python
SENTRY_ENABLED = True
```

### Using a Custom DSN

If you prefer instead to use your own Sentry ingestor, you'll need to first create a new project under your Sentry account to represent your NetBox deployment and obtain its corresponding data source name (DSN). This looks like a URL similar to the example below:

```
https://[email protected]/0
```

Once you have obtained a DSN, configure Sentry in NetBox's `configuration.py` file with the following parameters:
NetBox supports native integration with [Sentry](https://sentry.io/) for automatic error reporting. To enable this functionality, set `SENTRY_ENABLED` to True and define your unique [data source name (DSN)](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/) in `configuration.py`.

```python
SENTRY_ENABLED = True
SENTRY_DSN = "https://[email protected]/0"
```

Setting `SENTRY_ENABLED` to False will disable the Sentry integration.

### Assigning Tags

You can optionally attach one or more arbitrary tags to the outgoing error reports if desired by setting the `SENTRY_TAGS` parameter:
Expand Down
21 changes: 21 additions & 0 deletions docs/configuration/data-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,24 @@ The following colors are supported:
* `gray`
* `black`
* `white`

---

## PROTECTION_RULES

!!! tip "Dynamic Configuration Parameter"

This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below:

```python
PROTECTION_RULES = {
"dcim.site": [
{
"status": {
"eq": "decommissioning"
}
},
"my_plugin.validators.Validator1",
]
}
```
3 changes: 3 additions & 0 deletions docs/configuration/error-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Default: False

Set to True to enable automatic error reporting via [Sentry](https://sentry.io/).

!!! note
The `sentry-sdk` Python package is required to enable Sentry integration.

---

## SENTRY_SAMPLE_RATE
Expand Down
18 changes: 16 additions & 2 deletions docs/configuration/miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ changes in the database indefinitely.

---

## CHANGELOG_SKIP_EMPTY_CHANGES

Default: True

If enabled, a change log record will not be created when an object is updated without any changes to its existing field values.

!!! note
The object's `last_updated` field will always reflect the time of the most recent update, regardless of this parameter.

---

## DATA_UPLOAD_MAX_MEMORY_SIZE

Default: `2621440` (2.5 MB)
Expand All @@ -92,9 +103,12 @@ The maximum size (in bytes) of an incoming HTTP request (i.e. `GET` or `POST` da

!!! tip "Dynamic Configuration Parameter"

Default: False
Default: True

By default, NetBox will prevent the creation of duplicate prefixes and IP addresses in the global table (that is, those which are not assigned to any VRF). This validation can be disabled by setting `ENFORCE_GLOBAL_UNIQUE` to False.

By default, NetBox will permit users to create duplicate prefixes and IP addresses in the global table (that is, those which are not assigned to any VRF). This behavior can be disabled by setting `ENFORCE_GLOBAL_UNIQUE` to True.
!!! info "Changed in v3.7"
The default value for this parameter was changed from False to True in NetBox v3.7.

---

Expand Down
9 changes: 3 additions & 6 deletions docs/configuration/required-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ DATABASE = {

## REDIS

[Redis](https://redis.io/) is an in-memory data store similar to memcached. While Redis has been an optional component of
NetBox since the introduction of webhooks in version 2.4, it is required starting in 2.6 to support NetBox's caching
functionality (as well as other planned features). In 2.7, the connection settings were broken down into two sections for
task queuing and caching, allowing the user to connect to different Redis instances/databases per feature.
[Redis](https://redis.io/) is a lightweight in-memory data store similar to memcached. NetBox employs Redis for background task queuing and other features.

Redis is configured using a configuration setting similar to `DATABASE` and these settings are the same for both of the `tasks` and `caching` subsections:

Expand All @@ -81,15 +78,15 @@ REDIS = {
'tasks': {
'HOST': 'redis.example.com',
'PORT': 1234,
'USERNAME': 'netbox'
'USERNAME': 'netbox',
'PASSWORD': 'foobar',
'DATABASE': 0,
'SSL': False,
},
'caching': {
'HOST': 'localhost',
'PORT': 6379,
'USERNAME': ''
'USERNAME': '',
'PASSWORD': '',
'DATABASE': 1,
'SSL': False,
Expand Down
16 changes: 12 additions & 4 deletions docs/customization/custom-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,22 @@ Related custom fields can be grouped together within the UI by assigning each th

This parameter has no effect on the API representation of custom field data.

### Visibility
### Visibility & Editing

When creating a custom field, there are three options for UI visibility. These control how and whether the custom field is displayed within the NetBox UI.
!!! info "This feature was improved in NetBox v3.7."

* **Read/write** (default): The custom field is included when viewing and editing objects.
* **Read-only**: The custom field is displayed when viewing an object, but it cannot be edited via the UI. (It will appear in the form as a read-only field.)
When creating a custom field, users can control the conditions under which it may be displayed and edited within the NetBox user interface. The following choices are available for controlling the display of a custom field on an object:

* **Always** (default): The custom field is included when viewing an object.
* **If Set**: The custom field is included only if a value has been defined for the object.
* **Hidden**: The custom field will never be displayed within the UI. This option is recommended for fields which are not intended for use by human users.

Additionally, the following options are available for controlling whether custom field values can be altered within the NetBox UI:

* **Yes** (default): The custom field's value may be modified when editing an object.
* **No**: The custom field is displayed for reference when editing an object, but its value may not be modified.
* **Hidden**: The custom field is not displayed when editing an object.

Note that this setting has no impact on the REST or GraphQL APIs: Custom field data will always be available via either API.

### Validation
Expand Down
2 changes: 2 additions & 0 deletions docs/customization/custom-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The `CustomValidator` class supports several validation types:
* `regex`: Application of a [regular expression](https://en.wikipedia.org/wiki/Regular_expression)
* `required`: A value must be specified
* `prohibited`: A value must _not_ be specified
* `eq`: A value must be equal to the specified value
* `neq`: A value must _not_ be equal to the specified value

The `min` and `max` types should be defined for numeric values, whereas `min_length`, `max_length`, and `regex` are suitable for character strings (text values). The `required` and `prohibited` validators may be used for any field, and should be passed a value of `True`.

Expand Down
10 changes: 9 additions & 1 deletion docs/development/application-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A dictionary of particular features (e.g. custom fields) mapped to the NetBox mo
'dcim': ['site', 'rack', 'devicetype', ...],
...
},
'webhooks': {
'event_rules': {
'extras': ['configcontext', 'tag', ...],
'dcim': ['site', 'rack', 'devicetype', ...],
},
Expand All @@ -41,6 +41,10 @@ A dictionary of particular features (e.g. custom fields) mapped to the NetBox mo

Supported model features are listed in the [features matrix](./models.md#features-matrix).

### `models`

This key lists all models which have been registered in NetBox which are not designated for private use. (Setting `_netbox_private` to True on a model excludes it from this list.) As with individual features under `model_features`, models are organized by app label.

### `plugins`

This store maintains all registered items for plugins, such as navigation menus, template extensions, etc.
Expand All @@ -49,6 +53,10 @@ This store maintains all registered items for plugins, such as navigation menus,

A dictionary mapping each model (identified by its app and label) to its search index class, if one has been registered for it.

### `tables`

A dictionary mapping table classes to lists of extra columns that have been registered by plugins using the `register_table_column()` utility function. Each column is defined as a tuple of name and column instance.

### `views`

A hierarchical mapping of registered views for each model. Mappings are added using the `register_model_view()` decorator, and URLs paths can be generated from these using `get_model_urls()`.
39 changes: 26 additions & 13 deletions docs/development/extending-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@

Below is a list of tasks to consider when adding a new field to a core model.

## 1. Generate and run database migrations
## 1. Add the field to the model class

Add the field to the model, taking care to address any of the following conditions.

* When adding a GenericForeignKey field, also add an index under `Meta` for its two concrete fields. For example:

```python
class Meta:
indexes = (
models.Index(fields=('object_type', 'object_id')),
)
```

## 2. Generate and run database migrations

[Django migrations](https://docs.djangoproject.com/en/stable/topics/migrations/) are used to express changes to the database schema. In most cases, Django can generate these automatically, however very complex changes may require manual intervention. Always remember to specify a short but descriptive name when generating a new migration.

```
./manage.py makemigrations <app> -n <name>
./manage.py makemigrations <app> -n <name> --no-header
./manage.py migrate
```

Expand All @@ -16,7 +29,7 @@ Where possible, try to merge related changes into a single migration. For exampl
!!! warning "Do not alter existing migrations"
Migrations can only be merged within a release. Once a new release has been published, its migrations cannot be altered (other than for the purpose of correcting a bug).

## 2. Add validation logic to `clean()`
## 3. Add validation logic to `clean()`

If the new field introduces additional validation requirements (beyond what's included with the field itself), implement them in the model's `clean()` method. Remember to call the model's original method using `super()` before or after your custom validation as appropriate:

Expand All @@ -31,15 +44,15 @@ class Foo(models.Model):
raise ValidationError()
```

## 3. Update relevant querysets
## 4. Update relevant querysets

If you're adding a relational field (e.g. `ForeignKey`) and intend to include the data when retrieving a list of objects, be sure to include the field using `prefetch_related()` as appropriate. This will optimize the view and avoid extraneous database queries.

## 4. Update API serializer
## 5. Update API serializer

Extend the model's API serializer in `<app>.api.serializers` to include the new field. In most cases, it will not be necessary to also extend the nested serializer, which produces a minimal representation of the model.

## 5. Add fields to forms
## 6. Add fields to forms

Extend any forms to include the new field(s) as appropriate. These are found under the `forms/` directory within each app. Common forms include:

Expand All @@ -48,23 +61,23 @@ Extend any forms to include the new field(s) as appropriate. These are found und
* **CSV import** - The form used when bulk importing objects in CSV format
* **Filter** - Displays the options available for filtering a list of objects (both UI and API)

## 6. Extend object filter set
## 7. Extend object filter set

If the new field should be filterable, add it to the `FilterSet` for the model. If the field should be searchable, remember to query it in the FilterSet's `search()` method.

## 7. Add column to object table
## 8. Add column to object table

If the new field will be included in the object list view, add a column to the model's table. For simple fields, adding the field name to `Meta.fields` will be sufficient. More complex fields may require declaring a custom column. Also add the field name to `default_columns` if the column should be present in the table by default.

## 8. Update the SearchIndex
## 9. Update the SearchIndex

Where applicable, add the new field to the model's SearchIndex for inclusion in global search.

## 9. Update the UI templates
## 10. Update the UI templates

Edit the object's view template to display the new field. There may also be a custom add/edit form template that needs to be updated.

## 10. Create/extend test cases
## 11. Create/extend test cases

Create or extend the relevant test cases to verify that the new field and any accompanying validation logic perform as expected. This is especially important for relational fields. NetBox incorporates various test suites, including:

Expand All @@ -74,8 +87,8 @@ Create or extend the relevant test cases to verify that the new field and any ac
* Model tests
* View tests

Be diligent to ensure all of the relevant test suites are adapted or extended as necessary to test any new functionality.
Be diligent to ensure all the relevant test suites are adapted or extended as necessary to test any new functionality.

## 11. Update the model's documentation
## 12. Update the model's documentation

Each model has a dedicated page in the documentation, at `models/<app>/<model>.md`. Update this file to include any relevant information about the new field.
Loading