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.3.1 #10154

Merged
merged 74 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
587a344
Documentation: distinguish release and git upgrade processes
candlerb Jul 15, 2022
3b4dd05
PRVB
jeremystretch Aug 17, 2022
5327857
Merge pull request #9744 from candlerb/candlerb/9743
jeremystretch Aug 17, 2022
c7d6fe2
Fixes #10053: Custom fields header should not be displayed when editi…
jeremystretch Aug 17, 2022
279253c
Fixes #10040: Fix exception when ordering prefixes by flat representa…
jeremystretch Aug 18, 2022
9059c09
Refresh development docs
jeremystretch Aug 18, 2022
804c064
Closes #10061: Replicate type when cloning L2VPN instances
jeremystretch Aug 18, 2022
eb3d3dc
#6454 add prerequisite alert
arthanson Aug 18, 2022
c811eb0
netbox-community#10055 - Add loop for NAT Outside
atownson Aug 18, 2022
a687aa1
netbox-community#10055 - Add loop for NAT Outside
atownson Aug 18, 2022
3f40e15
netbox-community#10055 - Add template for NAT Outside
atownson Aug 18, 2022
0bdee1d
netbox-community#10055 - Align NAT Outside with NAT Inside
atownson Aug 18, 2022
928dff6
#6454 add prerequisite alert
arthanson Aug 18, 2022
43ad8e8
netbox-community#10055: Added empty text
atownson Aug 18, 2022
38a8ddc
#6454 fix merge conflicts
arthanson Aug 18, 2022
c65a291
#6454 add L2VPN check
arthanson Aug 18, 2022
0a38c16
Fix for #10056
arthanson Aug 18, 2022
3a7ea62
fix for #10057
arthanson Aug 18, 2022
c14a597
Fixes #10089: linkify template filter should escape object representa…
jeremystretch Aug 22, 2022
2ef9e2d
Closes #10066: Use fixed column widths for custom field values in UI
jeremystretch Aug 22, 2022
9174397
fix for #10059 - add identifier to L2VPN table
arthanson Aug 22, 2022
ea1467a
fix for #10086 - change capitalization on wireless link table for Int…
arthanson Aug 22, 2022
e8f62eb
#10059 change ordering of identifier column
arthanson Aug 22, 2022
f5d81f5
Merge pull request #10093 from arthanson/art-10056
jeremystretch Aug 22, 2022
743106e
Merge pull request #10095 from arthanson/art-10057
jeremystretch Aug 22, 2022
646272f
Merge pull request #10097 from arthanson/art-10059
jeremystretch Aug 22, 2022
a972174
#6454 changes from PR review
arthanson Aug 22, 2022
25ec624
#6454 suggested review changes
arthanson Aug 22, 2022
f35ff10
Merge pull request #10096 from arthanson/art-6454
jeremystretch Aug 22, 2022
069c2d2
Changelog for #6454, #10057, #10059
jeremystretch Aug 22, 2022
71bf5f4
Updated exists evaluation
atownson Aug 22, 2022
2bb79e1
Updated exists evaluation
atownson Aug 22, 2022
6179686
Corrected IPv6 family
atownson Aug 22, 2022
0c7c61b
#10037 add Child Interface to context menu
arthanson Aug 22, 2022
9fddd19
#10094 fix Contact AddAnother
arthanson Aug 22, 2022
41499b1
#10094 fix Contact AddAnother
arthanson Aug 22, 2022
f48aaf1
#10094 fix Contact AddAnother
arthanson Aug 22, 2022
63e8fae
Changed nat_outside to ManyToManyColumn
atownson Aug 23, 2022
7b41892
Merge pull request #10065 from atownson/issue_10055
jeremystretch Aug 23, 2022
984d8b8
Fixes #10108: Linkify inside NAT IPs for primary device IPs in UI
jeremystretch Aug 23, 2022
f3906dd
Fixes #10111 - Wrap search QS to catch ValueError on identifier field
DanSheps Aug 23, 2022
7ba0b42
Fixes #10109: Fix available prefixes calculation for container prefix…
jeremystretch Aug 23, 2022
bf92e3a
Merge pull request #10114 from netbox-community/10109-available-prefixes
jeremystretch Aug 23, 2022
c11ca54
#10037 default type to virtual
arthanson Aug 23, 2022
8b1a462
#10094 changes from code review
arthanson Aug 23, 2022
374abe5
#10033 disable Add a Termination button if 2 terminations on L2VPN P2P
arthanson Aug 23, 2022
219f2ee
Merge pull request #10101 from arthanson/art-10037
jeremystretch Aug 23, 2022
439cf1a
#10033 changes from code review
arthanson Aug 23, 2022
1c46102
#10094 changes from code review
arthanson Aug 23, 2022
deee366
Merge pull request #10120 from arthanson/art-10086
jeremystretch Aug 24, 2022
3110765
Merge pull request #10103 from arthanson/art-10094
jeremystretch Aug 24, 2022
6a7c56d
Merge pull request #10115 from arthanson/art-10033
jeremystretch Aug 24, 2022
18d5576
Changelog for #10033, #10037, #10094
jeremystretch Aug 24, 2022
36729fb
Fixes #10134: Custom fields data serializer should return a 400 respo…
jeremystretch Aug 24, 2022
c2c8bd0
Closes #10133: Enable nullifying device location during bulk edit
jeremystretch Aug 24, 2022
2baf06e
Add unique slugs to L2VPNs in relevant tests
jeremystretch Aug 24, 2022
bfbf97a
Closes #10031: Enforce 'application/json' content type for REST API r…
jeremystretch Aug 24, 2022
eb2bf34
#9935 add new wireless choices for interfaces (#10116)
arthanson Aug 24, 2022
f70ef7a
Changelog and cleanup for #9935
jeremystretch Aug 24, 2022
4132027
fixes for #10070 make l2vpn slug unique (#10119)
arthanson Aug 24, 2022
6c686af
Changelog for #10070
jeremystretch Aug 24, 2022
ec2e8ad
#10139 update development documents for githooks and web-ui (#10141)
arthanson Aug 25, 2022
482b4b6
Fixes #10147: Permit the creation of 0U device types via REST API
jeremystretch Aug 25, 2022
9da9a20
Fixes #10087: Correct display of far end in console/power/interface c…
jeremystretch Aug 25, 2022
5f37699
Fixes #9663: Omit available IP annotations when filtering prefix chil…
jeremystretch Aug 25, 2022
bb37ebf
#10038 add assign FHRP group to device-interface context menu (#10151)
arthanson Aug 25, 2022
7697779
#10038 add L2VPN termination to interface list context menu (#10152)
arthanson Aug 25, 2022
32615be
#10038 & #10039: Changelog & replicate for VM interfaces
jeremystretch Aug 25, 2022
1379b9c
Tweak display of prerequisite model warning
jeremystretch Aug 25, 2022
a9ddd41
Fix SSO signon for SAML with idp (#10137)
arthanson Aug 25, 2022
7bdbdda
Changelog for #10135
jeremystretch Aug 25, 2022
61ba581
Add branch naming standard to developer docs
jeremystretch Aug 25, 2022
a416ff6
Fixes #10118: Fix display of connected LLDP neighbors for devices
jeremystretch Aug 25, 2022
ed4fe6b
Release v3.3.1
jeremystretch Aug 25, 2022
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 @@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v3.3.0
placeholder: v3.3.1
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.3.0
placeholder: v3.3.1
validations:
required: true
- type: dropdown
Expand Down
118 changes: 71 additions & 47 deletions docs/development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

Getting started with NetBox development is pretty straightforward, and should feel very familiar to anyone with Django development experience. There are a few things you'll need:

* A Linux system or environment
* A Linux system or compatible environment
* A PostgreSQL server, which can be installed locally [per the documentation](../installation/1-postgresql.md)
* A Redis server, which can also be [installed locally](../installation/2-redis.md)
* A supported version of Python
* Python 3.8 or later

### Fork the Repo
### 1. Fork the Repo

Assuming you'll be working on your own fork, your first step will be to fork the [official git repository](https://github.com/netbox-community/netbox). (If you're a maintainer who's going to be working directly with the official repo, skip this step.) Click the "fork" button at top right (be sure that you've logged into GitHub first).

Expand All @@ -21,7 +21,7 @@ Copy the URL provided in the dialog box.

You can then clone your GitHub fork locally for development:

```no-highlight
```no-highlight hl_lines="1 9"
$ git clone https://github.com/$username/netbox.git
Cloning into 'netbox'...
remote: Enumerating objects: 85949, done.
Expand All @@ -35,93 +35,114 @@ base_requirements.txt contrib docs mkdocs.yml NOTICE requ
CHANGELOG.md CONTRIBUTING.md LICENSE.txt netbox README.md scripts
```

### 2. Create a New Branch

The NetBox project utilizes three persistent git branches to track work:

* `master` - Serves as a snapshot of the current stable release
* `develop` - All development on the upcoming stable release occurs here
* `feature` - Tracks work on an upcoming major release
* `develop` - All development on the upcoming stable (patch) release occurs here
* `feature` - Tracks work on an upcoming minor release

Typically, you'll base pull requests off of the `develop` branch, or off of `feature` if you're working on a new major release. For example, assume that the current NetBox release is v3.3.5. Work applied to the `develop` branch will appear in v3.3.6, and work done under the `feature` branch will be included in the next minor release (v3.4.0).

!!! warning
**Never** merge pull requests into the `master` branch: This branch only ever merges pull requests from the `develop` branch, to effect a new release.

To create a new branch, first ensure that you've checked out the desired base branch, then run:

```no-highlight
git checkout -B $branchname
```

When naming a new git branch, contributors are strongly encouraged to use the relevant issue number followed by a very brief description of the work:

Typically, you'll base pull requests off of the `develop` branch, or off of `feature` if you're working on a new major release. **Never** merge pull requests into the `master` branch: This branch only ever merges pull requests from the `develop` branch, to effect a new release.
```no-highlight
$issue-$description
```

For example, assume that the current NetBox release is v3.1.1. Work applied to the `develop` branch will appear in v3.1.2, and work done under the `feature` branch will be included in the next minor release (v3.2.0).
The description should be just two or three words to imply the focus of the work being performed. For example, bug #1234 to fix a TypeError exception when creating a device might be named `1234-device-typerror`. This ensures that branches are always follow some logical ordering (e.g. when running `git branch -a`) and helps other developers quickly identify the purpose of each.

### Enable Pre-Commit Hooks
### 3. Enable Pre-Commit Hooks

NetBox ships with a [git pre-commit hook](https://githooks.com/) script that automatically checks for style compliance and missing database migrations prior to committing changes. This helps avoid erroneous commits that result in CI test failures. You are encouraged to enable it by creating a link to `scripts/git-hooks/pre-commit`:

```no-highlight
$ cd .git/hooks/
$ ln -s ../../scripts/git-hooks/pre-commit
cd .git/hooks/
ln -s ../../scripts/git-hooks/pre-commit
```
For the pre-commit hooks to work, you will also need to install the pycodestyle package:

```no-highlight
python -m pip install pycodestyle
```
...and set up the yarn packages as shown in the [Web UI Development Guide](web-ui.md)

### Create a Python Virtual Environment
### 4. Create a Python Virtual Environment

A [virtual environment](https://docs.python.org/3/tutorial/venv.html) (or "venv" for short) is like a container for a set of Python packages. These allow you to build environments suited to specific projects without interfering with system packages or other projects. When installed per the documentation, NetBox uses a virtual environment in production.

Create a virtual environment using the `venv` Python module:

```no-highlight
$ mkdir ~/.venv
$ python3 -m venv ~/.venv/netbox
mkdir ~/.venv
python3 -m venv ~/.venv/netbox
```

This will create a directory named `.venv/netbox/` in your home directory, which houses a virtual copy of the Python executable and its related libraries and tooling. When running NetBox for development, it will be run using the Python binary at `~/.venv/netbox/bin/python`.

!!! info "Where to Create Your Virtual Environments"
Keeping virtual environments in `~/.venv/` is a common convention but entirely optional: Virtual environments can be created almost wherever you please. Also consider using [`virtualenvwrapper`](https://virtualenvwrapper.readthedocs.io/en/stable/) to simplify the management of multiple venvs.
!!! tip "Virtual Environments"
Keeping virtual environments in `~/.venv/` is a common convention but entirely optional: Virtual environments can be created almost wherever you please. Also consider using [`virtualenvwrapper`](https://virtualenvwrapper.readthedocs.io/en/stable/) to simplify the management of multiple environments.

Once created, activate the virtual environment:

```no-highlight
$ source ~/.venv/netbox/bin/activate
(netbox) $
source ~/.venv/netbox/bin/activate
```

Notice that the console prompt changes to indicate the active environment. This updates the necessary system environment variables to ensure that any Python scripts are run within the virtual environment.

### Install Dependencies
### 5. Install Required Packages

With the virtual environment activated, install the project's required Python packages using the `pip` module:
With the virtual environment activated, install the project's required Python packages using the `pip` module. Required packages are defined in `requirements.txt`. Each line in this file specifies the name and specific version of a required package.

```no-highlight
(netbox) $ python -m pip install -r requirements.txt
Collecting Django==3.1 (from -r requirements.txt (line 1))
Cache entry deserialization failed, entry ignored
Using cached https://files.pythonhosted.org/packages/2b/5a/4bd5624546912082a1bd2709d0edc0685f5c7827a278d806a20cf6adea28/Django-3.1-py3-none-any.whl
...
python -m pip install -r requirements.txt
```

### Configure NetBox
### 6. Configure NetBox

Within the `netbox/netbox/` directory, copy `configuration_example.py` to `configuration.py` and update the following parameters:

* `ALLOWED_HOSTS`: This can be set to `['*']` for development purposes
* `DATABASE`: PostgreSQL database connection parameters
* `REDIS`: Redis configuration, if different from the defaults
* `REDIS`: Redis configuration (if different from the defaults)
* `SECRET_KEY`: Set to a random string (use `generate_secret_key.py` in the parent directory to generate a suitable key)
* `DEBUG`: Set to `True`
* `DEVELOPER`: Set to `True` (this enables the creation of new database migrations)

### Start the Development Server
### 7. Start the Development Server

Django provides a lightweight, auto-updating HTTP/WSGI server for development use. It is started with the `runserver` management command:
Django provides a lightweight, auto-updating [HTTP/WSGI server](https://docs.djangoproject.com/en/stable/ref/django-admin/#runserver) for development use. It is started with the `runserver` management command:

```no-highlight
```no-highlight hl_lines="1"
$ ./manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
February 18, 2022 - 20:29:57
Django version 4.0.2, using settings 'netbox.settings'
August 18, 2022 - 15:17:52
Django version 4.0.7, using settings 'netbox.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
```

This ensures that your development environment is now complete and operational. Any changes you make to the code base will be automatically adapted by the development server.
This ensures that your development environment is now complete and operational. The development server will monitor the development environment and automatically reload in response to any changes made.

!!! tip "IDE Integration"
Some IDEs, such as the highly-recommended [PyCharm](https://www.jetbrains.com/pycharm/), will integrate with Django's development server and allow you to run it directly within the IDE. This is strongly encouraged as it makes for a much more convenient development environment.

!!! info "IDE Integration"
Some IDEs, such as PyCharm, will integrate with Django's development server and allow you to run it directly within the IDE. This is strongly encouraged as it makes for a much more convenient development environment.
## UI Development

For UI development you will need to review the [Web UI Development Guide](web-ui.md)

## Populating Demo Data

Expand All @@ -131,48 +152,51 @@ The demo data is provided in JSON format and loaded into an empty database using

## Running Tests

Prior to committing any substantial changes to the code base, be sure to run NetBox's test suite to catch any potential errors. Tests are run using the `test` management command, which employs Python's [`unittest`](https://docs.python.org/3/library/unittest.html#module-unittest) library. Remember to ensure the Python virtual environment is active before running this command. Also keep in mind that these commands are executed in the `netbox/` directory, not the root directory of the repository.
Prior to committing any substantial changes to the code base, be sure to run NetBox's test suite to catch potential errors. Tests are run using the `test` management command, which employs Python's [`unittest`](https://docs.python.org/3/library/unittest.html#module-unittest) library. Remember to ensure that the Python virtual environment is active before running this command. Also keep in mind that these commands are executed in the `netbox/` directory, not the root directory of the repository.

To avoid potential issues with your local configuration file, set the `NETBOX_CONFIGURATION` to point to the packaged test configuration at `netbox/configuration_testing.py`. This will handle things like ensuring that the dummy plugin is enabled for comprehensive testing.

```no-highlight
$ export NETBOX_CONFIGURATION=netbox.configuration_testing
$ cd netbox/
$ python manage.py test
export NETBOX_CONFIGURATION=netbox.configuration_testing
cd netbox/
python manage.py test
```

In cases where you haven't made any changes to the database schema (which is typical), you can append the `--keepdb` argument to this command to reuse the test database between runs. This cuts down on the time it takes to run the test suite since the database doesn't have to be rebuilt each time. (Note that this argument will cause errors if you've modified any model fields since the previous test run.)

```no-highlight
$ python manage.py test --keepdb
python manage.py test --keepdb
```

You can also reduce testing time by enabling parallel test execution with the `--parallel` flag. (By default, this will run as many parallel tests as you have processors. To avoid sluggishness, it's a good idea to specify a lower number of parallel tests.) This flag can be combined with `--keepdb`, although if you encounter any strange errors, try running the test suite again with parallelization disabled.

```no-highlight
$ python manage.py test --parallel <n>
python manage.py test --parallel <n>
```

Finally, it's possible to limit the run to a specific set of tests, specified by their Python path. For example, to run only IPAM and DCIM view tests:

```no-highlight
$ python manage.py test dcim.tests.test_views ipam.tests.test_views
python manage.py test dcim.tests.test_views ipam.tests.test_views
```

This is handy for instances where just a few tests are failing and you want to re-run them individually.

!!! info
NetBox uses [django-rich](https://github.com/adamchainz/django-rich) to enhance Django's default `test` management command.

## Submitting Pull Requests

Once you're happy with your work and have verified that all tests pass, commit your changes and push it upstream to your fork. Always provide descriptive (but not excessively verbose) commit messages. When working on a specific issue, be sure to prefix your commit message with the word "Fixes" or "Closes" and the issue number (with a hash mark). This tells GitHub to automatically close the referenced issue once the commit has been merged.
Once you're happy with your work and have verified that all tests pass, commit your changes and push it upstream to your fork. Always provide descriptive (but not excessively verbose) commit messages. Be sure to prefix your commit message with the word "Fixes" or "Closes" and the relevant issue number (with a hash mark). This tells GitHub to automatically close the referenced issue once the commit has been merged.

```no-highlight
$ git commit -m "Closes #1234: Add IPv5 support"
$ git push origin
git commit -m "Closes #1234: Add IPv5 support"
git push origin
```

Once your fork has the new commit, submit a [pull request](https://github.com/netbox-community/netbox/compare) to the NetBox repo to propose the changes. Be sure to provide a detailed accounting of the changes being made and the reasons for doing so.

Once submitted, a maintainer will review your pull request and either merge it or request changes. If changes are needed, you can make them via new commits to your fork: The pull request will update automatically.

!!! note "Remember to Open an Issue First"
!!! warning
Remember, pull requests are permitted only for **accepted** issues. If an issue you want to work on hasn't been approved by a maintainer yet, it's best to avoid risking your time and effort on a change that might not be accepted. (The one exception to this is trivial changes to the documentation or other non-critical resources.)
Loading