Skip to content

Commit fc0acb0

Browse files
committed
Merge main into feature
1 parent bb5057c commit fc0acb0

File tree

197 files changed

+62569
-52138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+62569
-52138
lines changed

.github/ISSUE_TEMPLATE/01-feature_request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body:
1515
attributes:
1616
label: NetBox version
1717
description: What version of NetBox are you currently running?
18-
placeholder: v4.2.3
18+
placeholder: v4.2.7
1919
validations:
2020
required: true
2121
- type: dropdown

.github/ISSUE_TEMPLATE/02-bug_report.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ body:
2727
attributes:
2828
label: NetBox Version
2929
description: What version of NetBox are you currently running?
30-
placeholder: v4.2.3
30+
placeholder: v4.2.7
3131
validations:
3232
required: true
3333
- type: dropdown

.github/workflows/close-incomplete-issues.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
jobs:
1414
stale:
15+
if: github.repository == 'netbox-community/netbox'
1516
runs-on: ubuntu-latest
1617
steps:
1718
- uses: actions/stale@v9

.github/workflows/close-stale-issues.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313

1414
jobs:
1515
stale:
16+
if: github.repository == 'netbox-community/netbox'
1617
runs-on: ubuntu-latest
1718
steps:
1819
- uses: actions/stale@v9

.github/workflows/lock-threads.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313

1414
jobs:
1515
lock:
16+
if: github.repository == 'netbox-community/netbox'
1617
runs-on: ubuntu-latest
1718
steps:
1819
- uses: dessant/lock-threads@v5

.github/workflows/update-translation-strings.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313

1414
jobs:
1515
makemessages:
16+
if: github.repository == 'netbox-community/netbox'
1617
runs-on: ubuntu-latest
1718
env:
1819
NETBOX_CONFIGURATION: netbox.configuration_testing

.tx/config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[main]
22
host = https://app.transifex.com
33

4-
[o:netbox-community:p:netbox:r:9cbf4fcf95b3d92e4ebbf1a5e5d1caee]
4+
[o:netbox-community:p:netbox:r:034999968a7366ba27a8bdf1ab63bf42]
55
file_filter = netbox/translations/<lang>/LC_MESSAGES/django.po
66
source_file = netbox/translations/en/LC_MESSAGES/django.po
77
type = PO

base_requirements.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ django-cors-headers
88

99
# Runtime UI tool for debugging Django
1010
# https://github.com/jazzband/django-debug-toolbar/blob/main/docs/changes.rst
11-
django-debug-toolbar
11+
# See: https://django-debug-toolbar.readthedocs.io/en/latest/changes.html#id1
12+
# "Wrap SHOW_TOOLBAR_CALLBACK function with sync_to_async or async_to_sync to allow sync/async
13+
# compatibility." breaks stawberry-graphql-django at version 0.52.0 (current)
14+
django-debug-toolbar==5.0.1
1215

1316
# Library for writing reusable URL query filters
1417
# https://github.com/carltongibson/django-filter/blob/main/CHANGES.rst
@@ -96,8 +99,7 @@ mkdocs-material
9699

97100
# Introspection for embedded code
98101
# https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md
99-
# See #18568
100-
mkdocstrings[python-legacy]==0.27.0
102+
mkdocstrings[python]
101103

102104
# Library for manipulating IP prefixes and addresses
103105
# https://github.com/netaddr/netaddr/blob/master/CHANGELOG.rst

contrib/generated_schema.json

+7
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@
427427
"e3",
428428
"xdsl",
429429
"docsis",
430+
"moca",
430431
"bpon",
431432
"epon",
432433
"10g-epon",
@@ -500,6 +501,9 @@
500501
"n",
501502
"mrj21",
502503
"fc",
504+
"fc-pc",
505+
"fc-upc",
506+
"fc-apc",
503507
"lc",
504508
"lc-pc",
505509
"lc-upc",
@@ -565,6 +569,9 @@
565569
"n",
566570
"mrj21",
567571
"fc",
572+
"fc-pc",
573+
"fc-upc",
574+
"fc-apc",
568575
"lc",
569576
"lc-pc",
570577
"lc-upc",

docs/administration/authentication/overview.md

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Icons](https://github.com/google/material-design-icons) icon's name; or be
5454
`None` for no icon.
5555

5656
For instance, the OIDC backend may be customized with
57+
5758
```python
5859
SOCIAL_AUTH_BACKEND_ATTRS = {
5960
'oidc': ("My awesome SSO", "login"),

docs/configuration/miscellaneous.md

+12
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,15 @@ This parameter controls how frequently a failed job is retried, up to the maximu
233233
Default: `0` (retries disabled)
234234

235235
The maximum number of times a background task will be retried before being marked as failed.
236+
237+
## DISK_BASE_UNIT
238+
239+
Default: `1000`
240+
241+
The base unit for disk sizes. Set this to `1024` to use binary prefixes (MiB, GiB, etc.) instead of decimal prefixes (MB, GB, etc.).
242+
243+
## RAM_BASE_UNIT
244+
245+
Default: `1000`
246+
247+
The base unit for RAM sizes. Set this to `1024` to use binary prefixes (MiB, GiB, etc.) instead of decimal prefixes (MB, GB, etc.).

docs/customization/custom-scripts.md

+1
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ A particular object within NetBox. Each ObjectVar must specify a particular mode
310310
* `query_params` - A dictionary of query parameters to use when retrieving available options (optional)
311311
* `context` - A custom dictionary mapping template context variables to fields, used when rendering `<option>` elements within the dropdown menu (optional; see below)
312312
* `null_option` - A label representing a "null" or empty choice (optional)
313+
* `selector` - A boolean that, when True, includes an advanced object selection widget to assist the user in identifying the desired object (optional; False by default)
313314

314315
To limit the selections available within the list, additional query parameters can be passed as the `query_params` dictionary. For example, to show only devices with an "active" status:
315316

docs/customization/export-templates.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Height: {{ rack.u_height }}U
2525
To access custom fields of an object within a template, use the `cf` attribute. For example, `{{ obj.cf.color }}` will return the value (if any) for a custom field named `color` on `obj`.
2626

2727
If you need to use the config context data in an export template, you'll should use the function `get_config_context` to get all the config context data. For example:
28+
2829
```
2930
{% for server in queryset %}
3031
{% set data = server.get_config_context() %}

docs/development/release-checklist.md

+63-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Release Checklist
22

3-
This documentation describes the process of packaging and publishing a new NetBox release. There are three types of release:
3+
This documentation describes the process of packaging and publishing a new NetBox release. There are three types of releases:
44

55
* Major release (e.g. v3.7.8 to v4.0.0)
66
* Minor release (e.g. v4.0.10 to v4.1.0)
77
* Patch release (e.g. v4.1.0 to v4.1.1)
88

9-
While major releases generally introduce some very substantial change to the application, they are typically treated the same as minor version increments for the purpose of release packaging.
9+
While major releases generally introduce some very substantial changes to the application, they are typically treated the same as minor version increments for the purpose of release packaging.
10+
11+
For patch releases (e.g. upgrading from v4.2.2 to v4.2.3), begin at the [patch releases](#patch-releases) heading below. For minor or major releases, complete the entire checklist.
1012

1113
## Minor Version Releases
1214

@@ -29,6 +31,29 @@ Close the [release milestone](https://github.com/netbox-community/netbox/milesto
2931

3032
Check that a link to the release notes for the new version is present in the navigation menu (defined in `mkdocs.yml`), and that a summary of all major new features has been added to `docs/index.md`.
3133

34+
### Update the Dependency Requirements Matrix
35+
36+
For every minor release, update the dependency requirements matrix in `docs/installation/upgrading.md` ("All versions") to reflect the supported versions of Python, PostgreSQL, and Redis:
37+
38+
1. Add a new row with the supported dependency versions.
39+
2. Include a documentation link using the release tag format: `https://github.com/netbox-community/netbox/blob/v4.2.0/docs/installation/index.md`
40+
3. Bold any version changes for clarity.
41+
42+
**Example Update:**
43+
44+
```markdown
45+
| NetBox Version | Python min | Python max | PostgreSQL min | Redis min | Documentation |
46+
|:--------------:|:----------:|:----------:|:--------------:|:---------:|:-------------------------------------------------------------------------------------------------:|
47+
| 4.2 | 3.10 | 3.12 | **13** | 4.0 | [Link](https://github.com/netbox-community/netbox/blob/v4.2.0/docs/installation/index.md) |
48+
```
49+
50+
### Update System Requirements
51+
52+
If a new Django release is adopted or other major dependencies (Python, PostgreSQL, Redis) change:
53+
54+
* Update the installation guide (`docs/installation/index.md`) with the new minimum versions.
55+
* Update the upgrade guide (`docs/installation/upgrading.md`) for the current version accordingly.
56+
3257
### Manually Perform a New Install
3358

3459
Start the documentation server and navigate to the current version of the installation docs:
@@ -37,15 +62,25 @@ Start the documentation server and navigate to the current version of the instal
3762
mkdocs serve
3863
```
3964

40-
Follow these instructions to perform a new installation of NetBox in a temporary environment. This process must not be automated: The goal of this step is to catch any errors or omissions in the documentation, and ensure that it is kept up-to-date for each release. Make any necessary changes to the documentation before proceeding with the release.
65+
Follow these instructions to perform a new installation of NetBox in a temporary environment. This process must not be automated: The goal of this step is to catch any errors or omissions in the documentation and ensure that it is kept up to date for each release. Make any necessary changes to the documentation before proceeding with the release.
4166

4267
### Test Upgrade Paths
4368

44-
Upgrading from a previous version typically involves database migrations, which must work without errors. Supported upgrade paths include from one minor version to another within the same major version (i.e. 4.0 to 4.1), as well as from the latest patch version of the previous minor version (i.e. 3.7 to 4.0 or to 4.1). Prior to release, test all these supported paths by loading demo data from the source version and performing a `./manage.py migrate`.
69+
Upgrading from a previous version typically involves database migrations, which must work without errors.
70+
Test the following supported upgrade paths:
71+
72+
- From one minor version to another within the same major version (e.g. 4.0 to 4.1).
73+
- From the latest patch version of the previous minor version (e.g. 3.7 to 4.0 or 4.1).
74+
75+
Prior to release, test all these supported paths by loading demo data from the source version and performing:
76+
77+
```no-highlight
78+
./manage.py migrate
79+
```
4580

4681
### Merge the `feature` Branch
4782

48-
Submit a pull request to merge the `feature` branch into the `main` branch in preparation for its release. Once it has been merged, continue with the section for patch releases below.
83+
Submit a pull request to merge the `feature` branch into the `main` branch in preparation for its release. Once it has been merged, continue with the section for the patch releases below.
4984

5085
### Rebuild Demo Data (After Release)
5186

@@ -57,7 +92,7 @@ After the release of a new minor version, generate a new demo data snapshot comp
5792

5893
### Create a Release Branch
5994

60-
Begin by creating a new branch (based off of `main`) to effect the release. This will comprise the changes listed below.
95+
Begin by creating a new branch (based on `main`) to effect the release. This will comprise the changes listed below.
6196

6297
```
6398
git checkout main
@@ -85,7 +120,20 @@ In cases where upgrading a dependency to its most recent release is breaking, it
85120

86121
### Update UI Dependencies
87122

88-
Check whether any UI dependencies (JavaScript packages, fonts, etc.) need to be updated by running `yarn outdated` from within the `project-static/` directory. [Upgrade these dependencies](./web-ui.md#updating-dependencies) as necessary, then run `yarn bundle` to generate the necessary files for distribution.
123+
Check whether any UI dependencies (JavaScript packages, fonts, etc.) need to be updated by running `yarn outdated` from within the `project-static/` directory. [Upgrade these dependencies](./web-ui.md#updating-dependencies) as necessary, then run `yarn bundle` to generate the necessary files for distribution:
124+
125+
```
126+
$ yarn bundle
127+
yarn run v1.22.19
128+
$ node bundle.js
129+
✅ Bundled source file 'styles/external.scss' to 'netbox-external.css'
130+
✅ Bundled source file 'styles/netbox.scss' to 'netbox.css'
131+
✅ Bundled source file 'styles/svg/rack_elevation.scss' to 'rack_elevation.css'
132+
✅ Bundled source file 'styles/svg/cable_trace.scss' to 'cable_trace.css'
133+
✅ Bundled source file 'index.ts' to 'netbox.js'
134+
✅ Copied graphiql files
135+
Done in 1.00s.
136+
```
89137

90138
### Rebuild the Device Type Definition Schema
91139

@@ -116,16 +164,22 @@ Then, compile these portable (`.po`) files for use in the application:
116164

117165
### Update Version and Changelog
118166

119-
* Update the version and published date in `release.yaml` with the current version & date. Add a designation (e.g.g `beta1`) if applicable.
167+
* Update the version number and date in `netbox/release.yaml`. Add or remove the designation (e.g. `beta1`) if applicable.
120168
* Update the example version numbers in the feature request and bug report templates under `.github/ISSUE_TEMPLATES/`.
121-
* Replace the "FUTURE" placeholder in the release notes with the current date.
169+
* Add a section for this release at the top of the changelog page for the minor version (e.g. `docs/release-notes/version-4.2.md`) listing all relevant changes made in this release.
170+
171+
!!! tip
172+
Put yourself in the shoes of the user when recording change notes. Focus on the effect that each change has for the end user, rather than the specific bits of code that were modified in a PR. Ensure that each message conveys meaning absent context of the initial feature request or bug report. Remember to include keywords or phrases (such as exception names) that can be easily searched.
122173

123174
### Submit a Pull Request
124175

125176
Commit the above changes and submit a pull request titled **"Release vX.Y.Z"** to merge the current release branch (e.g. `release-vX.Y.Z`) into `main`. Copy the documented release notes into the pull request's body.
126177

127178
Once CI has completed and a colleague has reviewed the PR, merge it. This effects a new release in the `main` branch.
128179

180+
!!! warning
181+
To ensure a streamlined review process, the pull request for a release **must** be limited to the changes outlined in this document. A release PR must never include functional changes to the application: Any unrelated "cleanup" needs to be captured in a separate PR prior to the release being shipped.
182+
129183
### Create a New Release
130184

131185
Create a [new release](https://github.com/netbox-community/netbox/releases/new) on GitHub with the following parameters.

docs/development/style-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ NetBox generally follows the [Django style guide](https://docs.djangoproject.com
2222

2323
### Linting
2424

25-
The [ruff](https://docs.astral.sh/ruff/) linter is used 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 `ruff` manually, run:
25+
The [ruff](https://docs.astral.sh/ruff/) linter is used to enforce code style, and is run automatically by [pre-commit](./getting-started.md#5-install-pre-commit). To invoke `ruff` manually, run:
2626

2727
```
2828
ruff check netbox/

docs/development/translations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To download translated strings automatically, you'll need to:
3030
1. Install the [Transifex CLI client](https://github.com/transifex/cli)
3131
2. Generate a [Transifex API token](https://app.transifex.com/user/settings/api/)
3232

33-
Once you have the client set up, run the following command:
33+
Once you have the client set up, run the following command from the project root (e.g. `/opt/netbox/`):
3434

3535
```no-highlight
3636
TX_TOKEN=$TOKEN tx pull
@@ -46,6 +46,9 @@ Once retrieved, the updated strings need to be compiled into new `.mo` files so
4646

4747
Once any new `.mo` files have been generated, they need to be committed and pushed back up to GitHub. (Again, this is typically done as part of publishing a new NetBox release.)
4848

49+
!!! tip
50+
Run `git status` to check that both `*.mo` & `*.po` files have been updated as expected.
51+
4952
## Proposing New Languages
5053

5154
If you'd like to add support for a new language to NetBox, the first step is to [submit a GitHub issue](https://github.com/netbox-community/netbox/issues/new?assignees=&labels=type%3A+translation&projects=&template=translation.yaml) to capture the proposal. While we'd like to add as many languages as possible, we do need to limit the rate at which new languages are added. New languages will be selected according to community interest and the number of volunteers who sign up as translators.

0 commit comments

Comments
 (0)