Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 29 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,19 @@ jobs:
needs:
- "ruff-format"
- "ruff-lint"
# Temporarily disabled due to issues with the docs build and needing best practices for NTC python builds.
# check-docs-build:
# runs-on: "ubuntu-24.04"
# env:
# INVOKE_NETUTILS_LOCAL: "True"
# steps:
# - name: "Check out repository code"
# uses: "actions/checkout@v4"
# - name: "Setup environment"
# uses: "networktocode/gh-action-setup-poetry-environment@v6"
# with:
# poetry-version: "1.8.5"
# - name: "Check Docs Build"
# run: "poetry run invoke build-and-check-docs"
check-docs-build:
runs-on: "ubuntu-24.04"
env:
INVOKE_NETUTILS_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
poetry:
runs-on: "ubuntu-24.04"
env:
Expand Down Expand Up @@ -120,6 +119,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Get image version"
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
Expand Down Expand Up @@ -157,6 +158,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Get image version"
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
Expand Down Expand Up @@ -184,30 +187,29 @@ jobs:
publish_gh:
name: "Publish to GitHub"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
# yamllint disable-line rule:quoted-strings
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
python-version: "3.13"
- name: "Install Python Packages"
run: "pip install poetry"
poetry-version: "1.8.5"
python-version: "3.12"
poetry-install-options: "--no-root"
- name: "Set env"
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Build Documentation"
run: "poetry run invoke build-and-check-docs"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Upload binaries to release"
uses: "svenstaro/upload-release-action@v2"
with:
repo_token: "${{ secrets.NTC_GITHUB_TOKEN }}"
file: "dist/*"
tag: "${{ github.ref }}"
overwrite: true
file_glob: true
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
env:
GH_TOKEN: "${{ secrets.NTC_GITHUB_TOKEN }}"
needs:
- "pytest"
publish_pypi:
Expand Down
1 change: 0 additions & 1 deletion changes/+fix-flatbot.housekeeping

This file was deleted.

1 change: 1 addition & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
3 changes: 0 additions & 3 deletions changes/675.housekeeping

This file was deleted.

1 change: 0 additions & 1 deletion changes/692.added

This file was deleted.

22 changes: 22 additions & 0 deletions docs/admin/release_notes/version_1.15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# v1.15 Release Notes

This document describes all new features and changes in the release. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Release Overview

- Add parser support for Rad ETX.
- Update the library to the NTC 2025 development standards.

## [v1.15.0 (2025-09-05)](https://github.com/networktocode/netutils/releases/tag/v1.15.0)

### Added

- [#692](https://github.com/networktocode/netutils/issues/692) - Add Rad ETX config parser.

### Housekeeping

- [#675](https://github.com/networktocode/netutils/issues/675) - Replaced black, bandit, flake8 and pydocstyle with ruff.
- [#675](https://github.com/networktocode/netutils/issues/675) - Updated tasks.py with newest task list.
- [#675](https://github.com/networktocode/netutils/issues/675) - Updated to using pyinvoke for development environment definition.
- Fix CI for Flatbot to install Ruff and remove black.
2 changes: 1 addition & 1 deletion docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To either stop or destroy the development environment use the following options.

## Poetry

Poetry is used in lieu of the "virtualenv" commands and is leveraged in both environments. The virtual environment will provide all of the Python packages required to manage the development environment such as **Invoke**. See the [Local Development Environment](#local-poetry-development-environment) section to see how to install Netutils if you're going to be developing locally (i.e. not using the Docker container).
Poetry is used in lieu of the "virtualenv" commands and is leveraged in both environments. The virtual environment will provide all of the Python packages required to manage the development environment such as **Invoke**. See the [Local Development Environment](#full-docker-development-environment) section to see how to install Netutils if you're going to be developing locally (i.e. not using the Docker container).

The `pyproject.toml` file outlines all of the relevant dependencies for the project:

Expand Down
192 changes: 192 additions & 0 deletions docs/dev/release_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Release Checklist

This document is intended for library maintainers and outlines the steps to perform when releasing a new version of the library.

!!! important
Before starting, make sure your **local** `develop`, `main` are all up to date with upstream!

```
git fetch
git switch develop && git pull
```

Choose your own adventure:

- Patch release from `develop`? Jump [here](#all-releases-from-develop).
- Minor release? Continue with [Minor Version Bumps](#minor-version-bumps) and then [All Releases from `develop`](#all-releases-from-develop).

## Minor Version Bumps

### Update Requirements

Every minor version release should refresh `poetry.lock`, so that it lists the most recent stable release of each package. To do this:

0. Run `poetry update --dry-run` to have Poetry automatically tell you what package updates are available and the versions it would upgrade to. This requires an existing environment created from the lock file (i.e. via `poetry install`).
1. Review each requirement's release notes for any breaking or otherwise noteworthy changes.
2. Run `poetry update <package>` to update the package versions in `poetry.lock` as appropriate.
3. If a required package requires updating to a new release not covered in the version constraints for a package as defined in `pyproject.toml`, (e.g. `Django ~3.1.7` would never install `Django >=4.0.0`), update it manually in `pyproject.toml`.
4. Run `poetry install` to install the refreshed versions of all required packages.
5. Run all tests (`poetry run invoke tests`) and check that the UI and API function as expected.

### Update Documentation

If there are any changes to the compatibility matrix (such as a bump in the minimum supported Nautobot version), update it accordingly.

Commit any resulting changes from the following sections to the documentation before proceeding with the release.

!!! tip
Fire up the documentation server in your development environment with `poetry run mkdocs serve`! This allows you to view the documentation site locally (the link is in the output of the command) and automatically rebuilds it as you make changes.

### Verify the Installation and Upgrade Steps

Follow the [installation instructions](../admin/install.md) to perform a new production installation of the library. If possible, also test the [upgrade process](../admin/upgrade.md) from the previous released version.

The goal of this step is to walk through the entire install process *as documented* to make sure nothing there needs to be changed or updated, to catch any errors or omissions in the documentation, and to ensure that it is current with each release.

---

## All Releases from `develop`

### Verify CI Build Status

Ensure that continuous integration testing on the `develop` branch is completing successfully.

### Bump the Version

Update the package version using `poetry version` if necessary. This command shows the current version of the project or bumps the version of the project and writes the new version back to `pyproject.toml` if a valid bump rule is provided.

The new version must be a valid semver string or a valid bump rule: `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`, `prerelease`. Always try to use a bump rule when you can.

Display the current version with no arguments:

```no-highlight
> poetry version
netutils 1.0.0-beta.2
```

Bump pre-release versions using `prerelease`:

```no-highlight
> poetry version prerelease
Bumping version from 1.0.0-beta.2 to 1.0.0-beta.3
```

For major versions, use `major`:

```no-highlight
> poetry version major
Bumping version from 1.0.0-beta.2 to 1.0.0
```

For patch versions, use `minor`:

```no-highlight
> poetry version minor
Bumping version from 1.0.0 to 1.1.0
```

And lastly, for patch versions, you guessed it, use `patch`:

```no-highlight
> poetry version patch
Bumping version from 1.1.0 to 1.1.1
```

Please see the [official Poetry documentation on `version`](https://python-poetry.org/docs/cli/#version) for more information.

### Update the Changelog

!!! important
The changelog must adhere to the [Keep a Changelog](https://keepachangelog.com/) style guide.

This guide uses `1.4.2` as the new version in its examples, so change it to match the version you bumped to in the previous step! Every. single. time. you. copy/paste commands :)

First, create a release branch off of `develop` (`git switch -c release-1.4.2 develop`).

> You will need to have the project's poetry environment built at this stage, as the towncrier command runs **locally only**. If you don't have it, run `poetry install` first.
Generate release notes with `invoke generate-release-notes --version 1.4.2` and answer `yes` to the prompt `Is it okay if I remove those files? [Y/n]:`. This will update the release notes in `docs/admin/release_notes/version_X.Y.md`, stage that file in git, and `git rm` all the fragments that have now been incorporated into the release notes.

There are two possibilities:

1. If you're releasing a new major or minor version, rename the `version_X.Y.md` file accordingly (e.g. rename to `docs/admin/release_notes/version_1.4.md`). Update the `Release Overview` and add this new page to the table of contents within `mkdocs.yml`.
2. If you're releasing a patch version, copy your version's section from the `version_X.Y.md` file into the already existing `docs/admin/release_notes/version_1.4.md` file. Delete the `version_X.Y.md` file.

Stage all the changes (`git add`) and check the diffs to verify all of the changes are correct (`git diff --cached`).

Commit `git commit -m "Release v1.4.2"` and `git push` the staged changes.

### Submit Release Pull Request

Submit a pull request titled `Release v1.4.2` to merge your release branch into `main`. Copy the documented release notes into the pull request's body.

!!! important
Do not squash merge this branch into `main`. Make sure to select `Create a merge commit` when merging in GitHub.

Once CI has completed on the PR, merge it.

### Create a New Release in GitHub

Draft a [new release](https://github.com/networktocode/netutils/releases/new) with the following parameters.

* **Tag:** Input current version (e.g. `v1.4.2`) and select `Create new tag: v1.4.2 on publish`
* **Target:** `main`
* **Title:** Version and date (e.g. `v1.4.2 - 2024-04-02`)

Click "Generate Release Notes" and edit the auto-generated content as follows:

- Change the entries generated by GitHub to only the usernames of the contributors. e.g. `* Updated dockerfile by @ntc_user in https://github.com/networktocode/netutils/pull/123` -> `* @ntc_user`.
- This should give you the list for the new `Contributors` section.
- Make sure there are no duplicated entries.
- Replace the content of the `What's Changed` section with the description of changes from the release PR (what towncrier generated).
- If it exists, leave the `New Contributors` list as it is.

The release notes should look as follows:

```markdown
## What's Changed

**Towncrier generated Changed/Fixed/Housekeeping etc. sections here**

## Contributors

* @alice
* @bob

## New Contributors

* @bob

**Full Changelog**: https://github.com/networktocode/netutils/compare/v1.4.1...v1.4.2
```

Publish the release!

### Create a PR from `main` back to `develop`

First, sync your `main` branch with upstream changes: `git switch main && git pull`.

Create a new branch from `main` called `release-1.4.2-to-develop` and use `poetry version prepatch` to bump the development version to the next release.

For example, if you just released `v1.4.2`:

```no-highlight
> git switch -c release-1.4.2-to-develop main
Switched to a new branch 'release-1.4.2-to-develop'
> poetry version prepatch
Bumping version from 1.4.2 to 1.4.3a1
> git add pyproject.toml && git commit -m "Bump version"
> git push
```

!!! important
Do not squash merge this branch into `develop`. Make sure to select `Create a merge commit` when merging in GitHub.

Open a new PR from `release-1.4.2-to-develop` against `develop`, wait for CI to pass, and merge it.

### Final checks

At this stage, the CI should be running or finished for the `v1.4.2` tag and a package successfully published to PyPI and added into the GitHub Release. Double check that's the case.

Documentation should also have been built for the tag on ReadTheDocs and if you're reading this page online, refresh it and look for the new version in the little version fly-out menu down at the bottom right of the page.

All done!
6 changes: 3 additions & 3 deletions docs/user/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Which OS Config types have Parsers?

The documentation is provided in the [development docs](../../dev/dev_config/#current-included-parsers).
The documentation is provided in the [development docs](../dev/dev_config.md#current-included-parsers)

For creating new Parsers, see the [new parsers](../../dev/dev_config/#new-parsers) docs.
For creating new Parsers, see the [new parsers](../dev/dev_config.md#new-parsers) docs.

## Can you provide an example of how to use the functions?

The documentation is always provided in the function for [code docs](../../dev/code_reference/) for each function. There is additional documentation in [Use Cases](../lib_use_cases/) and subsequent sections.
The documentation is always provided in the function for [code docs](../dev/code_reference/index.md) for each function. There is additional documentation in [Use Cases](../user/lib_use_cases.md) and subsequent sections.

## Optional Dependencies
One of the requirements of this library is to avoid having dependencies; however, including a few optional dependencies in an opt in fashion allows `netutils` to remain lean while offering some powerful addons.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/lib_use_cases_acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Here you can see how the Python classes work together. There is a lot going on,
!!! info
It may be helpful to open the diagram in a new tab to view the full size, as an example, in Chrome you can right-click on the image and select "Open Image on New Tab".

The intention of this page is not to cover every attribute and it's behavior, but a more human (although highly technical) understanding of what is going on. For more detailed information, please see the [test](https://github.com/networktocode/netutils/blob/develop/tests/unit/test_acl.py) and [code docs](../../dev/code_reference/acl/).
The intention of this page is not to cover every attribute and it's behavior, but a more human (although highly technical) understanding of what is going on. For more detailed information, please see the [test](https://github.com/networktocode/netutils/blob/develop/tests/unit/test_acl.py) and [code docs](../dev/code_reference/acl.md).

!!! info
In the future the intention is to add features such as better de-duplication, partial match, and path analysis.
Expand Down
10 changes: 10 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ nav:
- Jinja Filters: "user/lib_use_cases_jinja_filters.md"
- Library Mapper: "user/lib_use_cases_lib_mapper.md"
- Protocol Mapper: "user/lib_use_cases_protocol_mappers.md"
- Config Parsers: "dev/include_parser_list.md"
- NIST Utility: "user/lib_use_cases_nist.md"
- OS Software Version Utility: "user/lib_use_cases_os_version.md"
- ACL: "user/lib_use_cases_acl.md"
- Upgrade Paths: "user/lib_upgrade_paths.md"
- Getting Started: "user/lib_getting_started.md"
Expand All @@ -118,6 +121,8 @@ nav:
- Uninstall: "admin/uninstall.md"
- Release Notes:
- "admin/release_notes/index.md"
- v1.15: "admin/release_notes/version_1.15.md"
- v1.14: "admin/release_notes/version_1.14.md"
- v1.13: "admin/release_notes/version_1.13.md"
- v1.12: "admin/release_notes/version_1.12.md"
- v1.11: "admin/release_notes/version_1.11.md"
Expand All @@ -138,6 +143,7 @@ nav:
- Extending the Library: "dev/extending.md"
- Contributing to the Library: "dev/contributing.md"
- Development Environment: "dev/dev_environment.md"
- Release Checklist: "dev/release_checklist.md"
- Config Parser Development: "dev/dev_config.md"
- Arch Decision Records: "dev/dev_adr.md"
- Code Attribution to the Library: "dev/attribution.md"
Expand Down Expand Up @@ -167,3 +173,7 @@ nav:
- VLAN: "dev/code_reference/vlan.md"
- Classy Docs:
- Parser: "dev/classy/parser.md"

not_in_nav: |
- "user/include_jinja_list.md"
- "user/lib_mapper/*.md"
Loading