Skip to content

Commit a3cdc57

Browse files
Merge pull request #188 from nautobot/release-v3.2.0
Release v3.2.0
2 parents 7e16ddf + 2fe6b2d commit a3cdc57

File tree

82 files changed

+2426
-1957
lines changed

Some content is hidden

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

82 files changed

+2426
-1957
lines changed

.bandit.yml

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

.cookiecutter.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,28 @@
99
"app_slug": "nautobot-data-validation-engine",
1010
"project_slug": "nautobot-app-data-validation-engine",
1111
"repo_url": "https://github.com/nautobot/nautobot-app-data-validation-engine",
12-
"base_url": "data-validation-engine",
13-
"min_nautobot_version": "2.0.0",
12+
"base_url": "nautobot-data-validation-engine",
13+
"min_nautobot_version": "2.1.9",
1414
"max_nautobot_version": "2.9999",
1515
"camel_name": "NautobotDataValidationEngine",
1616
"project_short_description": "Provides UI to build custom data validation rules for data in Nautobot",
17-
"model_class_name": "None",
17+
"model_class_name": "ValidationRule",
1818
"open_source_license": "Apache-2.0",
1919
"docs_base_url": "https://docs.nautobot.com",
2020
"docs_app_url": "https://docs.nautobot.com/projects/data-validation/en/latest",
2121
"_drift_manager": {
2222
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
2323
"template_dir": "nautobot-app",
24-
"template_ref": "refs/tags/nautobot-app-v2.2.1",
24+
"template_ref": "refs/tags/nautobot-app-v2.4.0",
2525
"cookie_dir": "",
2626
"branch_prefix": "drift-manager",
2727
"pull_request_strategy": "create",
2828
"post_actions": [
29-
"black"
29+
"ruff",
30+
"poetry"
3031
],
31-
"draft": true,
32-
"baked_commit_ref": "d67dcbd797e8f2bb2aa773d42a3b8c1f068674a1"
32+
"draft": false,
33+
"baked_commit_ref": "2f3dc2daccdd49ef5157ecdd2bd54f8de2ff24be"
3334
}
3435
}
3536
}

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ FAQ.md
1919
.git/
2020
.gitignore
2121
.github
22-
tasks.py
2322
LICENSE
2423
**/*.log
2524
**/.vscode/

.flake8

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

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ about: Report a reproducible bug in the current release of nautobot-data-validat
55

66
### Environment
77
* Python version: <!-- Example: 3.11.4 -->
8-
* Nautobot version: <!-- Example: 2.0.0 -->
8+
* Nautobot version: <!-- Example: 2.1.9 -->
99
* nautobot-data-validation-engine version: <!-- Example: 1.0.0 -->
1010

1111
<!-- What did you expect to happen? -->

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ about: Propose a new feature or enhancement
55
---
66

77
### Environment
8-
* Nautobot version: <!-- Example: 2.0.0 -->
8+
* Nautobot version: <!-- Example: 2.1.9 -->
99
* nautobot-data-validation-engine version: <!-- Example: 1.0.0 -->
1010

1111
<!--

.github/workflows/ci.yml

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ on: # yamllint disable-line rule:truthy rule:comments
1313
pull_request: ~
1414

1515
env:
16-
APP_NAME: "nautobot-app-data-validation-engine"
16+
APP_NAME: "nautobot-data-validation-engine"
1717

1818
jobs:
19-
black:
19+
ruff-format:
2020
runs-on: "ubuntu-22.04"
2121
env:
2222
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_LOCAL: "True"
@@ -25,20 +25,9 @@ jobs:
2525
uses: "actions/checkout@v4"
2626
- name: "Setup environment"
2727
uses: "networktocode/gh-action-setup-poetry-environment@v6"
28-
- name: "Linting: black"
29-
run: "poetry run invoke black"
30-
bandit:
31-
runs-on: "ubuntu-22.04"
32-
env:
33-
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_LOCAL: "True"
34-
steps:
35-
- name: "Check out repository code"
36-
uses: "actions/checkout@v4"
37-
- name: "Setup environment"
38-
uses: "networktocode/gh-action-setup-poetry-environment@v6"
39-
- name: "Linting: bandit"
40-
run: "poetry run invoke bandit"
41-
ruff:
28+
- name: "Linting: ruff format"
29+
run: "poetry run invoke ruff --action format"
30+
ruff-lint:
4231
runs-on: "ubuntu-22.04"
4332
env:
4433
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_LOCAL: "True"
@@ -48,7 +37,7 @@ jobs:
4837
- name: "Setup environment"
4938
uses: "networktocode/gh-action-setup-poetry-environment@v6"
5039
- name: "Linting: ruff"
51-
run: "poetry run invoke ruff"
40+
run: "poetry run invoke ruff --action lint"
5241
check-docs-build:
5342
runs-on: "ubuntu-22.04"
5443
env:
@@ -60,17 +49,6 @@ jobs:
6049
uses: "networktocode/gh-action-setup-poetry-environment@v6"
6150
- name: "Check Docs Build"
6251
run: "poetry run invoke build-and-check-docs"
63-
flake8:
64-
runs-on: "ubuntu-22.04"
65-
env:
66-
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_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-
- name: "Linting: flake8"
73-
run: "poetry run invoke flake8"
7452
poetry:
7553
runs-on: "ubuntu-22.04"
7654
env:
@@ -95,18 +73,16 @@ jobs:
9573
run: "poetry run invoke yamllint"
9674
check-in-docker:
9775
needs:
98-
- "bandit"
99-
- "ruff"
100-
- "flake8"
76+
- "ruff-format"
77+
- "ruff-lint"
10178
- "poetry"
10279
- "yamllint"
103-
- "black"
10480
runs-on: "ubuntu-22.04"
10581
strategy:
10682
fail-fast: true
10783
matrix:
10884
python-version: ["3.11"]
109-
nautobot-version: ["2.0.0"]
85+
nautobot-version: ["2.1.9"]
11086
env:
11187
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_PYTHON_VER: "${{ matrix.python-version }}"
11288
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
@@ -115,6 +91,10 @@ jobs:
11591
uses: "actions/checkout@v4"
11692
- name: "Setup environment"
11793
uses: "networktocode/gh-action-setup-poetry-environment@v6"
94+
- name: "Constrain Nautobot version and regenerate lock file"
95+
env:
96+
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_LOCAL: "true"
97+
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
11898
- name: "Set up Docker Buildx"
11999
id: "buildx"
120100
uses: "docker/setup-buildx-action@v3"
@@ -132,6 +112,7 @@ jobs:
132112
build-args: |
133113
NAUTOBOT_VER=${{ matrix.nautobot-version }}
134114
PYTHON_VER=${{ matrix.python-version }}
115+
CI=true
135116
- name: "Copy credentials"
136117
run: "cp development/creds.example.env development/creds.env"
137118
- name: "Linting: pylint"
@@ -146,14 +127,14 @@ jobs:
146127
strategy:
147128
fail-fast: true
148129
matrix:
149-
python-version: ["3.8", "3.11"]
130+
python-version: ["3.8", "3.12"]
150131
db-backend: ["postgresql"]
151132
nautobot-version: ["stable"]
152133
include:
153134
- python-version: "3.11"
154135
db-backend: "postgresql"
155-
nautobot-version: "2.0.0"
156-
- python-version: "3.11"
136+
nautobot-version: "2.1.9"
137+
- python-version: "3.12"
157138
db-backend: "mysql"
158139
nautobot-version: "stable"
159140
runs-on: "ubuntu-22.04"
@@ -165,6 +146,10 @@ jobs:
165146
uses: "actions/checkout@v4"
166147
- name: "Setup environment"
167148
uses: "networktocode/gh-action-setup-poetry-environment@v6"
149+
- name: "Constrain Nautobot version and regenerate lock file"
150+
env:
151+
INVOKE_NAUTOBOT_DATA_VALIDATION_ENGINE_LOCAL: "true"
152+
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
168153
- name: "Set up Docker Buildx"
169154
id: "buildx"
170155
uses: "docker/setup-buildx-action@v3"
@@ -182,6 +167,7 @@ jobs:
182167
build-args: |
183168
NAUTOBOT_VER=${{ matrix.nautobot-version }}
184169
PYTHON_VER=${{ matrix.python-version }}
170+
CI=true
185171
- name: "Copy credentials"
186172
run: "cp development/creds.example.env development/creds.env"
187173
- name: "Use Mysql invoke settings when needed"
@@ -190,9 +176,9 @@ jobs:
190176
- name: "Run Tests"
191177
run: "poetry run invoke unittest"
192178
changelog:
193-
if: |
179+
if: >
194180
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
195-
(github.head_ref != 'main')
181+
(github.head_ref != 'main') && (!startsWith(github.head_ref, 'release'))
196182
runs-on: "ubuntu-22.04"
197183
steps:
198184
- name: "Check out repository code"
@@ -219,7 +205,7 @@ jobs:
219205
- name: "Set up Python"
220206
uses: "actions/setup-python@v5"
221207
with:
222-
python-version: "3.11"
208+
python-version: "3.12"
223209
- name: "Install Python Packages"
224210
run: "pip install poetry"
225211
- name: "Set env"
@@ -254,7 +240,7 @@ jobs:
254240
- name: "Set up Python"
255241
uses: "actions/setup-python@v5"
256242
with:
257-
python-version: "3.11"
243+
python-version: "3.12"
258244
- name: "Install Python Packages"
259245
run: "pip install poetry"
260246
- name: "Set env"

.github/workflows/upstream_testing.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ name: "Nautobot Upstream Monitor"
44
on: # yamllint disable-line rule:truthy rule:comments
55
schedule:
66
- cron: "0 4 */2 * *" # every other day at midnight
7+
workflow_dispatch:
78

89
jobs:
910
upstream-test:
1011
uses: "nautobot/nautobot/.github/workflows/plugin_upstream_testing_base.yml@develop"
1112
with: # Below could potentially be collapsed into a single argument if a concrete relationship between both is enforced
1213
invoke_context_name: "NAUTOBOT_DATA_VALIDATION_ENGINE"
13-
plugin_name: "nautobot-app-data-validation-engine"
14+
plugin_name: "nautobot-data-validation-engine"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<a href="https://pypi.org/project/nautobot-data-validation-engine/"><img src="https://img.shields.io/pypi/v/nautobot-data-validation-engine"></a>
99
<a href="https://pypi.org/project/nautobot-data-validation-engine/"><img src="https://img.shields.io/pypi/dm/nautobot-data-validation-engine"></a>
1010
<br>
11-
An App for <a href="https://github.com/nautobot/nautobot">Nautobot</a>.
11+
An <a href="https://networktocode.com/nautobot-apps/">App</a> for <a href="https://nautobot.com/">Nautobot</a>.
1212
</p>
1313

1414
## Overview

development/Dockerfile

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# -------------------------------------------------------------------------------------
77
# !!! USE CAUTION WHEN MODIFYING LINES BELOW
88

9-
# Accepts a desired Nautobot version as build argument, default to 2.0.0
10-
ARG NAUTOBOT_VER="2.0.0"
9+
# Accepts a desired Nautobot version as build argument, default to 2.1.9
10+
ARG NAUTOBOT_VER="2.1.9"
1111

1212
# Accepts a desired Python version as build argument, default to 3.11
1313
ARG PYTHON_VER="3.11"
@@ -53,29 +53,20 @@ RUN which poetry || curl -sSL https://install.python-poetry.org | python3 - && \
5353
WORKDIR /source
5454
COPY . /source
5555

56-
# Get container's installed Nautobot version as a forced constraint
57-
# NAUTOBOT_VER may be a branch name and not a published release therefor we need to get the installed version
58-
# so pip can use it to recognize local constraints.
59-
RUN pip show nautobot | grep "^Version: " | sed -e 's/Version: /nautobot==/' > constraints.txt
56+
# Build args must be declared in each stage
57+
ARG NAUTOBOT_VER
58+
ARG PYTHON_VER
6059

61-
# Use Poetry to grab dev dependencies from the lock file
62-
# Can be improved in Poetry 1.2 which allows `poetry install --only dev`
63-
#
64-
# We can't use the entire freeze as it takes forever to resolve with rigidly fixed non-direct dependencies,
65-
# especially those that are only direct to Nautobot but the container included versions slightly mismatch
66-
RUN poetry export -f requirements.txt --without-hashes --extras all --output poetry_freeze_base.txt
67-
RUN poetry export -f requirements.txt --without-hashes --extras all --with dev --output poetry_freeze_all.txt
68-
RUN sort poetry_freeze_base.txt poetry_freeze_all.txt | uniq -u > poetry_freeze_dev.txt
69-
70-
# Install all local project as editable, constrained on Nautobot version, to get any additional
71-
# direct dependencies of the app
72-
RUN --mount=type=cache,target="/root/.cache/pip",sharing=locked \
73-
pip install -c constraints.txt -e .[all]
60+
# Constrain the Nautobot version to NAUTOBOT_VER, fall back to installing from git branch if not available on PyPi
61+
# In CI, this should be done outside of the Dockerfile to prevent cross-compile build failures
62+
ARG CI
63+
RUN if [ -z "${CI+x}" ]; then \
64+
INSTALLED_NAUTOBOT_VER=$(pip show nautobot | grep "^Version" | sed "s/Version: //"); \
65+
poetry add --lock nautobot@${INSTALLED_NAUTOBOT_VER} --python ${PYTHON_VER} || \
66+
poetry add --lock git+https://github.com/nautobot/nautobot.git#${NAUTOBOT_VER} --python ${PYTHON_VER}; fi
7467

75-
# Install any dev dependencies frozen from Poetry
76-
# Can be improved in Poetry 1.2 which allows `poetry install --only dev`
77-
RUN --mount=type=cache,target="/root/.cache/pip",sharing=locked \
78-
pip install -c constraints.txt -r poetry_freeze_dev.txt
68+
# Install the app
69+
RUN poetry install --extras all --with dev
7970

8071
COPY development/nautobot_config.py ${NAUTOBOT_ROOT}/nautobot_config.py
8172
# !!! USE CAUTION WHEN MODIFYING LINES ABOVE

development/development.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ NAUTOBOT_BANNER_TOP="Local"
77
NAUTOBOT_CHANGELOG_RETENTION=0
88

99
NAUTOBOT_DEBUG=True
10+
NAUTOBOT_LOG_DEPRECATION_WARNINGS=True
1011
NAUTOBOT_LOG_LEVEL=DEBUG
1112
NAUTOBOT_METRICS_ENABLED=True
1213
NAUTOBOT_NAPALM_TIMEOUT=5

development/docker-compose.base.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ x-nautobot-base: &nautobot-base
1313
- "creds.env"
1414
tty: true
1515

16-
version: "3.8"
1716
services:
1817
nautobot:
1918
depends_on:

development/docker-compose.dev.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# any override will need to include these volumes to use them.
44
# see: https://github.com/docker/compose/issues/3729
55
---
6-
version: "3.8"
76
services:
87
nautobot:
98
command: "nautobot-server runserver 0.0.0.0:8080"

development/docker-compose.mysql.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
2-
version: "3.8"
3-
42
services:
53
nautobot:
64
environment:
@@ -19,7 +17,6 @@ services:
1917
db:
2018
image: "mysql:8"
2119
command:
22-
- "--default-authentication-plugin=mysql_native_password"
2320
- "--max_connections=1000"
2421
env_file:
2522
- "development.env"

development/docker-compose.postgres.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
2-
version: "3.8"
3-
42
services:
53
nautobot:
64
environment:

development/docker-compose.redis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
version: "3.8"
32
services:
43
redis:
54
image: "redis:6-alpine"

0 commit comments

Comments
 (0)