This documentation describes the process of packaging and publishing a new NetBox release. There are three types of releases:
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.
For patch releases (e.g. upgrading from v4.2.2 to v4.2.3), begin at the patch releases heading below. For minor or major releases, complete the entire checklist.
Sometimes it becomes necessary to constrain dependencies to a particular version, e.g. to work around a bug in a newer release or to avoid a breaking change that we have yet to accommodate. (Another common example is to limit the upstream Django release.) For example:
# https://github.com/encode/django-rest-framework/issues/6053
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 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 on GitHub after ensuring there are no remaining open issues associated with it.
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.
If a new Django release is adopted or other major dependencies (Python, PostgreSQL, Redis) change:
docs/installation/index.md) with the new minimum versions.docs/installation/upgrading.md) for the current version.
netbox/templates/exceptions/programming_error.html).pyproject.toml)Start the documentation server and navigate to the current version of the installation docs:
mkdocs serve
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.
Upgrading from a previous version typically involves database migrations, which must work without errors. Test the following supported upgrade paths:
Prior to release, test all these supported paths by loading demo data from the source version and performing:
./manage.py migrate
feature BranchSubmit 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.
After the release of a new minor version, generate a new demo data snapshot compatible with the new release. See the netbox-demo-data repository for instructions.
Begin by creating a new branch (based on main) to effect the release. This will comprise the changes listed below.
git checkout main
git checkout -B release-vX.Y.Z
Notify the netbox-docker maintainers (in #netbox-docker) of any changes that may be relevant to their build process, including:
upgrade.shBefore each release, update each of NetBox's Python dependencies to its most recent stable version. These are defined in requirements.txt, which is updated from base_requirements.txt using pip. To do this:
pip install -U -r base_requirements.txt).requirements.txt as appropriate.In cases where upgrading a dependency to its most recent release is breaking, it should be constrained to its current minor version in base_requirements.txt with an explanatory comment and revisited for the next major NetBox release (see the Address Constrained Dependencies section above).
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 as necessary, then run yarn bundle to generate the necessary files for distribution:
$ yarn bundle
yarn run v1.22.19
$ node bundle.js
✅ Bundled source file 'styles/external.scss' to 'netbox-external.css'
✅ Bundled source file 'styles/netbox.scss' to 'netbox.css'
✅ Bundled source file 'styles/svg/rack_elevation.scss' to 'rack_elevation.css'
✅ Bundled source file 'styles/svg/cable_trace.scss' to 'cable_trace.css'
✅ Bundled source file 'index.ts' to 'netbox.js'
✅ Copied graphiql files
Done in 1.00s.
Updated language translations should be pulled from Transifex and re-compiled for each new release. First, retrieve any updated translation files using the Transifex CLI client:
tx pull --force
Then, compile these portable (.po) files for use in the application:
./manage.py compilemessages
!!! tip
Consult the translation documentation for more detail on [updating translated strings](./translations.md#updating-translated-strings) if you've not set up the Transifex client already.
netbox/release.yaml. Add or remove the designation (e.g. beta1) if applicable.release.yaml to pyproject.toml in the project root..github/ISSUE_TEMPLATES/.docs/release-notes/version-4.2.md) listing all relevant changes made in this release.!!! tip
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.
Run the following command to update the device type definition validation schema:
./manage.py buildschema --write
This will automatically update the schema file at contrib/generated_schema.json.
Update the static OpenAPI schema definition at contrib/openapi.json with the management command below. If the schema file is up-to-date, only the NetBox version will be changed.
./manage.py spectacular --format openapi-json > ../contrib/openapi.json
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.
Once CI has completed and a colleague has reviewed the PR, merge it. This effects a new release in the main branch.
!!! warning
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.
Create a new release on GitHub with the following parameters.
v4.2.1)mainv4.2.1 - 2025-01-17)### headers to ## onesOnce created, the release will become available for users to install.