Skip to content

Commit 483f45c

Browse files
authored
Merge pull request #698 from networktocode/release-1.15.0-to-develop
Release 1.15.0 to develop
2 parents 34dd7f4 + e4ede55 commit 483f45c

File tree

16 files changed

+347
-61
lines changed

16 files changed

+347
-61
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,19 @@ jobs:
5959
needs:
6060
- "ruff-format"
6161
- "ruff-lint"
62-
# Temporarily disabled due to issues with the docs build and needing best practices for NTC python builds.
63-
# check-docs-build:
64-
# runs-on: "ubuntu-24.04"
65-
# env:
66-
# INVOKE_NETUTILS_LOCAL: "True"
67-
# steps:
68-
# - name: "Check out repository code"
69-
# uses: "actions/checkout@v4"
70-
# - name: "Setup environment"
71-
# uses: "networktocode/gh-action-setup-poetry-environment@v6"
72-
# with:
73-
# poetry-version: "1.8.5"
74-
# - name: "Check Docs Build"
75-
# run: "poetry run invoke build-and-check-docs"
62+
check-docs-build:
63+
runs-on: "ubuntu-24.04"
64+
env:
65+
INVOKE_NETUTILS_LOCAL: "True"
66+
steps:
67+
- name: "Check out repository code"
68+
uses: "actions/checkout@v4"
69+
- name: "Setup environment"
70+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
71+
with:
72+
poetry-version: "1.8.5"
73+
- name: "Check Docs Build"
74+
run: "poetry run invoke build-and-check-docs"
7675
poetry:
7776
runs-on: "ubuntu-24.04"
7877
env:
@@ -120,6 +119,8 @@ jobs:
120119
uses: "actions/checkout@v4"
121120
- name: "Setup environment"
122121
uses: "networktocode/gh-action-setup-poetry-environment@v6"
122+
with:
123+
poetry-version: "1.8.5"
123124
- name: "Get image version"
124125
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
125126
- name: "Set up Docker Buildx"
@@ -157,6 +158,8 @@ jobs:
157158
uses: "actions/checkout@v4"
158159
- name: "Setup environment"
159160
uses: "networktocode/gh-action-setup-poetry-environment@v6"
161+
with:
162+
poetry-version: "1.8.5"
160163
- name: "Get image version"
161164
run: "echo INVOKE_NETUTILS_IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
162165
- name: "Set up Docker Buildx"
@@ -184,30 +187,29 @@ jobs:
184187
publish_gh:
185188
name: "Publish to GitHub"
186189
runs-on: "ubuntu-24.04"
187-
if: "startsWith(github.ref, 'refs/tags/v')"
190+
# yamllint disable-line rule:quoted-strings
191+
if: startsWith(github.ref, 'refs/tags/v')
188192
steps:
189193
- name: "Check out repository code"
190194
uses: "actions/checkout@v4"
191-
- name: "Set up Python"
192-
uses: "actions/setup-python@v2"
195+
- name: "Setup environment"
196+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
193197
with:
194-
python-version: "3.13"
195-
- name: "Install Python Packages"
196-
run: "pip install poetry"
198+
poetry-version: "1.8.5"
199+
python-version: "3.12"
200+
poetry-install-options: "--no-root"
197201
- name: "Set env"
198202
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
199203
- name: "Run Poetry Version"
200204
run: "poetry version $RELEASE_VERSION"
205+
- name: "Build Documentation"
206+
run: "poetry run invoke build-and-check-docs"
201207
- name: "Run Poetry Build"
202208
run: "poetry build"
203209
- name: "Upload binaries to release"
204-
uses: "svenstaro/upload-release-action@v2"
205-
with:
206-
repo_token: "${{ secrets.NTC_GITHUB_TOKEN }}"
207-
file: "dist/*"
208-
tag: "${{ github.ref }}"
209-
overwrite: true
210-
file_glob: true
210+
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
211+
env:
212+
GH_TOKEN: "${{ secrets.NTC_GITHUB_TOKEN }}"
211213
needs:
212214
- "pytest"
213215
publish_pypi:

changes/+fix-flatbot.housekeeping

Lines changed: 0 additions & 1 deletion
This file was deleted.

changes/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

changes/675.housekeeping

Lines changed: 0 additions & 3 deletions
This file was deleted.

changes/692.added

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# v1.15 Release Notes
3+
4+
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).
5+
6+
## Release Overview
7+
8+
- Add parser support for Rad ETX.
9+
- Update the library to the NTC 2025 development standards.
10+
11+
## [v1.15.0 (2025-09-05)](https://github.com/networktocode/netutils/releases/tag/v1.15.0)
12+
13+
### Added
14+
15+
- [#692](https://github.com/networktocode/netutils/issues/692) - Add Rad ETX config parser.
16+
17+
### Housekeeping
18+
19+
- [#675](https://github.com/networktocode/netutils/issues/675) - Replaced black, bandit, flake8 and pydocstyle with ruff.
20+
- [#675](https://github.com/networktocode/netutils/issues/675) - Updated tasks.py with newest task list.
21+
- [#675](https://github.com/networktocode/netutils/issues/675) - Updated to using pyinvoke for development environment definition.
22+
- Fix CI for Flatbot to install Ruff and remove black.

docs/dev/dev_environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To either stop or destroy the development environment use the following options.
4545

4646
## Poetry
4747

48-
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).
48+
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).
4949

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

docs/dev/release_checklist.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Release Checklist
2+
3+
This document is intended for library maintainers and outlines the steps to perform when releasing a new version of the library.
4+
5+
!!! important
6+
Before starting, make sure your **local** `develop`, `main` are all up to date with upstream!
7+
8+
```
9+
git fetch
10+
git switch develop && git pull
11+
```
12+
13+
Choose your own adventure:
14+
15+
- Patch release from `develop`? Jump [here](#all-releases-from-develop).
16+
- Minor release? Continue with [Minor Version Bumps](#minor-version-bumps) and then [All Releases from `develop`](#all-releases-from-develop).
17+
18+
## Minor Version Bumps
19+
20+
### Update Requirements
21+
22+
Every minor version release should refresh `poetry.lock`, so that it lists the most recent stable release of each package. To do this:
23+
24+
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`).
25+
1. Review each requirement's release notes for any breaking or otherwise noteworthy changes.
26+
2. Run `poetry update <package>` to update the package versions in `poetry.lock` as appropriate.
27+
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`.
28+
4. Run `poetry install` to install the refreshed versions of all required packages.
29+
5. Run all tests (`poetry run invoke tests`) and check that the UI and API function as expected.
30+
31+
### Update Documentation
32+
33+
If there are any changes to the compatibility matrix (such as a bump in the minimum supported Nautobot version), update it accordingly.
34+
35+
Commit any resulting changes from the following sections to the documentation before proceeding with the release.
36+
37+
!!! tip
38+
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.
39+
40+
### Verify the Installation and Upgrade Steps
41+
42+
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.
43+
44+
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.
45+
46+
---
47+
48+
## All Releases from `develop`
49+
50+
### Verify CI Build Status
51+
52+
Ensure that continuous integration testing on the `develop` branch is completing successfully.
53+
54+
### Bump the Version
55+
56+
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.
57+
58+
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.
59+
60+
Display the current version with no arguments:
61+
62+
```no-highlight
63+
> poetry version
64+
netutils 1.0.0-beta.2
65+
```
66+
67+
Bump pre-release versions using `prerelease`:
68+
69+
```no-highlight
70+
> poetry version prerelease
71+
Bumping version from 1.0.0-beta.2 to 1.0.0-beta.3
72+
```
73+
74+
For major versions, use `major`:
75+
76+
```no-highlight
77+
> poetry version major
78+
Bumping version from 1.0.0-beta.2 to 1.0.0
79+
```
80+
81+
For patch versions, use `minor`:
82+
83+
```no-highlight
84+
> poetry version minor
85+
Bumping version from 1.0.0 to 1.1.0
86+
```
87+
88+
And lastly, for patch versions, you guessed it, use `patch`:
89+
90+
```no-highlight
91+
> poetry version patch
92+
Bumping version from 1.1.0 to 1.1.1
93+
```
94+
95+
Please see the [official Poetry documentation on `version`](https://python-poetry.org/docs/cli/#version) for more information.
96+
97+
### Update the Changelog
98+
99+
!!! important
100+
The changelog must adhere to the [Keep a Changelog](https://keepachangelog.com/) style guide.
101+
102+
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 :)
103+
104+
First, create a release branch off of `develop` (`git switch -c release-1.4.2 develop`).
105+
106+
> 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.
107+
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.
108+
109+
There are two possibilities:
110+
111+
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`.
112+
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.
113+
114+
Stage all the changes (`git add`) and check the diffs to verify all of the changes are correct (`git diff --cached`).
115+
116+
Commit `git commit -m "Release v1.4.2"` and `git push` the staged changes.
117+
118+
### Submit Release Pull Request
119+
120+
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.
121+
122+
!!! important
123+
Do not squash merge this branch into `main`. Make sure to select `Create a merge commit` when merging in GitHub.
124+
125+
Once CI has completed on the PR, merge it.
126+
127+
### Create a New Release in GitHub
128+
129+
Draft a [new release](https://github.com/networktocode/netutils/releases/new) with the following parameters.
130+
131+
* **Tag:** Input current version (e.g. `v1.4.2`) and select `Create new tag: v1.4.2 on publish`
132+
* **Target:** `main`
133+
* **Title:** Version and date (e.g. `v1.4.2 - 2024-04-02`)
134+
135+
Click "Generate Release Notes" and edit the auto-generated content as follows:
136+
137+
- 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`.
138+
- This should give you the list for the new `Contributors` section.
139+
- Make sure there are no duplicated entries.
140+
- Replace the content of the `What's Changed` section with the description of changes from the release PR (what towncrier generated).
141+
- If it exists, leave the `New Contributors` list as it is.
142+
143+
The release notes should look as follows:
144+
145+
```markdown
146+
## What's Changed
147+
148+
**Towncrier generated Changed/Fixed/Housekeeping etc. sections here**
149+
150+
## Contributors
151+
152+
* @alice
153+
* @bob
154+
155+
## New Contributors
156+
157+
* @bob
158+
159+
**Full Changelog**: https://github.com/networktocode/netutils/compare/v1.4.1...v1.4.2
160+
```
161+
162+
Publish the release!
163+
164+
### Create a PR from `main` back to `develop`
165+
166+
First, sync your `main` branch with upstream changes: `git switch main && git pull`.
167+
168+
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.
169+
170+
For example, if you just released `v1.4.2`:
171+
172+
```no-highlight
173+
> git switch -c release-1.4.2-to-develop main
174+
Switched to a new branch 'release-1.4.2-to-develop'
175+
> poetry version prepatch
176+
Bumping version from 1.4.2 to 1.4.3a1
177+
> git add pyproject.toml && git commit -m "Bump version"
178+
> git push
179+
```
180+
181+
!!! important
182+
Do not squash merge this branch into `develop`. Make sure to select `Create a merge commit` when merging in GitHub.
183+
184+
Open a new PR from `release-1.4.2-to-develop` against `develop`, wait for CI to pass, and merge it.
185+
186+
### Final checks
187+
188+
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.
189+
190+
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.
191+
192+
All done!

docs/user/faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Which OS Config types have Parsers?
44

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

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

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

11-
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.
11+
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.
1212

1313
## Optional Dependencies
1414
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.

docs/user/lib_use_cases_acl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Here you can see how the Python classes work together. There is a lot going on,
1515
!!! info
1616
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".
1717

18-
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/).
18+
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).
1919

2020
!!! info
2121
In the future the intention is to add features such as better de-duplication, partial match, and path analysis.

0 commit comments

Comments
 (0)