Skip to content

Commit 7ee840d

Browse files
authored
Merge pull request #261 from nautobot/release/2.3.2
Release v2.3.2
2 parents 52de214 + 4c22171 commit 7ee840d

26 files changed

+945
-397
lines changed

.cookiecutter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
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.4.2",
24+
"template_ref": "refs/tags/nautobot-app-v2.5.0",
2525
"cookie_dir": "",
2626
"branch_prefix": "drift-manager",
2727
"pull_request_strategy": "create",
@@ -30,7 +30,7 @@
3030
"poetry"
3131
],
3232
"draft": false,
33-
"baked_commit_ref": "923cacda33c195d91faabfac3d8e119960a3b236"
33+
"baked_commit_ref": "d124229bea55d5d5cccbd59828f197561606ef5b"
3434
}
3535
}
3636
}

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Please feel free to update todos to keep track of your own notes for WIP PRs.
2828
-->
2929
- [ ] Explanation of Change(s)
30-
- [ ] Added change log fragment(s) (for more information see [the documentation](https://docs.nautobot.com/projects/core/en/stable/development/#creating-changelog-fragments))
30+
- [ ] Added change log fragment(s) (for more information see [the documentation](https://docs.nautobot.com/projects/core/en/stable/development/core/#creating-changelog-fragments))
3131
- [ ] Attached Screenshots, Payload Example
3232
- [ ] Unit, Integration Tests
3333
- [ ] Documentation Updates (when adding/changing features)

.github/workflows/ci.yml

Lines changed: 109 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,26 @@ jobs:
8181
poetry-version: "1.8.5"
8282
- name: "Linting: yamllint"
8383
run: "poetry run invoke yamllint"
84+
markdownlint:
85+
runs-on: "ubuntu-22.04"
86+
env:
87+
INVOKE_NAUTOBOT_BGP_MODELS_LOCAL: "True"
88+
steps:
89+
- name: "Check out repository code"
90+
uses: "actions/checkout@v4"
91+
- name: "Setup environment"
92+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
93+
with:
94+
poetry-version: "1.8.5"
95+
- name: "Linting: markdownlint"
96+
run: "poetry run invoke markdownlint"
8497
check-in-docker:
8598
needs:
8699
- "ruff-format"
87100
- "ruff-lint"
88101
- "poetry"
89102
- "yamllint"
103+
- "markdownlint"
90104
runs-on: "ubuntu-22.04"
91105
strategy:
92106
fail-fast: true
@@ -109,9 +123,9 @@ jobs:
109123
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
110124
- name: "Set up Docker Buildx"
111125
id: "buildx"
112-
uses: "docker/setup-buildx-action@v3"
126+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
113127
- name: "Build"
114-
uses: "docker/build-push-action@v5"
128+
uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0
115129
with:
116130
builder: "${{ steps.buildx.outputs.name }}"
117131
context: "./"
@@ -125,8 +139,6 @@ jobs:
125139
NAUTOBOT_VER=${{ matrix.nautobot-version }}
126140
PYTHON_VER=${{ matrix.python-version }}
127141
CI=true
128-
- name: "Copy credentials"
129-
run: "cp development/creds.example.env development/creds.env"
130142
- name: "Linting: pylint"
131143
run: "poetry run invoke pylint"
132144
- name: "Checking: App Config"
@@ -139,7 +151,7 @@ jobs:
139151
strategy:
140152
fail-fast: true
141153
matrix:
142-
python-version: ["3.8", "3.12"]
154+
python-version: ["3.8"] # 3.12 stable is tested in unittest_report stage.
143155
db-backend: ["postgresql"]
144156
nautobot-version: ["stable"]
145157
include:
@@ -166,9 +178,60 @@ jobs:
166178
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
167179
- name: "Set up Docker Buildx"
168180
id: "buildx"
169-
uses: "docker/setup-buildx-action@v3"
181+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
182+
- name: "Build"
183+
uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0
184+
with:
185+
builder: "${{ steps.buildx.outputs.name }}"
186+
context: "./"
187+
push: false
188+
load: true
189+
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
190+
file: "./development/Dockerfile"
191+
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
192+
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
193+
build-args: |
194+
NAUTOBOT_VER=${{ matrix.nautobot-version }}
195+
PYTHON_VER=${{ matrix.python-version }}
196+
CI=true
197+
- name: "Use Mysql invoke settings when needed"
198+
run: "cp invoke.mysql.yml invoke.yml"
199+
if: "matrix.db-backend == 'mysql'"
200+
- name: "Run Tests"
201+
run: "poetry run invoke unittest"
202+
203+
unittest_report:
204+
needs:
205+
- "check-in-docker"
206+
strategy:
207+
fail-fast: true
208+
matrix:
209+
python-version: ["3.12"]
210+
db-backend: ["postgresql"]
211+
nautobot-version: ["stable"]
212+
runs-on: "ubuntu-22.04"
213+
permissions:
214+
pull-requests: "write"
215+
contents: "write"
216+
env:
217+
INVOKE_NAUTOBOT_BGP_MODELS_PYTHON_VER: "${{ matrix.python-version }}"
218+
INVOKE_NAUTOBOT_BGP_MODELS_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
219+
steps:
220+
- name: "Check out repository code"
221+
uses: "actions/checkout@v4"
222+
- name: "Setup environment"
223+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
224+
with:
225+
poetry-version: "1.8.5"
226+
- name: "Constrain Nautobot version and regenerate lock file"
227+
env:
228+
INVOKE_NAUTOBOT_BGP_MODELS_LOCAL: "true"
229+
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
230+
- name: "Set up Docker Buildx"
231+
id: "buildx"
232+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
170233
- name: "Build"
171-
uses: "docker/build-push-action@v5"
234+
uses: "docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" # v5.4.0
172235
with:
173236
builder: "${{ steps.buildx.outputs.name }}"
174237
context: "./"
@@ -188,7 +251,28 @@ jobs:
188251
run: "cp invoke.mysql.yml invoke.yml"
189252
if: "matrix.db-backend == 'mysql'"
190253
- name: "Run Tests"
191-
run: "poetry run invoke unittest"
254+
run: "poetry run invoke unittest --coverage"
255+
- name: "Generate Coverage Comment"
256+
if: >
257+
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
258+
(github.head_ref != 'main') && (!startsWith(github.head_ref, 'release'))
259+
id: "coverage_comment"
260+
uses: "py-cov-action/python-coverage-comment-action@d1ff8fbb5ff80feedb3faa0f6d7b424f417ad0e1" # v3.30
261+
with:
262+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
263+
MINIMUM_GREEN: 90
264+
MINIMUM_ORANGE: 80
265+
ANNOTATE_MISSING_LINES: true
266+
ANNOTATION_TYPE: "warning"
267+
- name: "Store Pull Request comment to be posted"
268+
if: >
269+
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
270+
(github.head_ref != 'main') && (!startsWith(github.head_ref, 'release'))
271+
uses: "actions/upload-artifact@v4"
272+
with:
273+
name: "python-coverage-comment-action"
274+
path: "python-coverage-comment-action.txt"
275+
192276
changelog:
193277
if: >
194278
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
@@ -210,41 +294,39 @@ jobs:
210294
publish_gh:
211295
needs:
212296
- "unittest"
297+
- "unittest_report"
213298
name: "Publish to GitHub"
214299
runs-on: "ubuntu-22.04"
215300
if: "startsWith(github.ref, 'refs/tags/v')"
216301
env:
217302
INVOKE_NAUTOBOT_BGP_MODELS_LOCAL: "True"
303+
permissions:
304+
contents: "write"
218305
steps:
219306
- name: "Check out repository code"
220307
uses: "actions/checkout@v4"
221-
- name: "Set up Python"
222-
uses: "actions/setup-python@v5"
308+
- name: "Setup environment"
309+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
223310
with:
311+
poetry-version: "1.8.5"
224312
python-version: "3.12"
225-
- name: "Install Python Packages"
226-
run: "pip install poetry"
313+
poetry-install-options: "--no-root"
227314
- name: "Set env"
228315
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
229316
- name: "Run Poetry Version"
230317
run: "poetry version $RELEASE_VERSION"
231-
- name: "Install Dependencies (needed for mkdocs)"
232-
run: "poetry install --no-root"
233318
- name: "Build Documentation"
234319
run: "poetry run invoke build-and-check-docs"
235320
- name: "Run Poetry Build"
236321
run: "poetry build"
237322
- name: "Upload binaries to release"
238-
uses: "svenstaro/upload-release-action@v2"
239-
with:
240-
repo_token: "${{ secrets.GH_NAUTOBOT_BOT_TOKEN }}"
241-
file: "dist/*"
242-
tag: "${{ github.ref }}"
243-
overwrite: true
244-
file_glob: true
323+
run: "gh release upload ${{ github.ref_name }} dist/*.{tar.gz,whl}"
324+
env:
325+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
245326
publish_pypi:
246327
needs:
247328
- "unittest"
329+
- "unittest_report"
248330
name: "Push Package to PyPI"
249331
runs-on: "ubuntu-22.04"
250332
if: "startsWith(github.ref, 'refs/tags/v')"
@@ -253,24 +335,22 @@ jobs:
253335
steps:
254336
- name: "Check out repository code"
255337
uses: "actions/checkout@v4"
256-
- name: "Set up Python"
257-
uses: "actions/setup-python@v5"
338+
- name: "Setup environment"
339+
uses: "networktocode/gh-action-setup-poetry-environment@v6"
258340
with:
341+
poetry-version: "1.8.5"
259342
python-version: "3.12"
260-
- name: "Install Python Packages"
261-
run: "pip install poetry"
343+
poetry-install-options: "--no-root"
262344
- name: "Set env"
263345
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
264346
- name: "Run Poetry Version"
265347
run: "poetry version $RELEASE_VERSION"
266-
- name: "Install Dependencies (needed for mkdocs)"
267-
run: "poetry install --no-root"
268348
- name: "Build Documentation"
269349
run: "poetry run invoke build-and-check-docs"
270350
- name: "Run Poetry Build"
271351
run: "poetry build"
272352
- name: "Push to PyPI"
273-
uses: "pypa/gh-action-pypi-publish@release/v1"
353+
uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4
274354
with:
275355
user: "__token__"
276356
password: "${{ secrets.PYPI_API_TOKEN }}"
@@ -291,7 +371,7 @@ jobs:
291371
# ENVs cannot be used directly in job.if. This is a workaround to check
292372
# if SLACK_WEBHOOK_URL is present.
293373
if: "env.SLACK_WEBHOOK_URL != ''"
294-
uses: "slackapi/slack-github-action@v1"
374+
uses: "slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3" # v1.27.1
295375
with:
296376
payload: |
297377
{

.github/workflows/coverage.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: "Post coverage comment"
3+
4+
on: # yamllint disable-line rule:truthy rule:comments
5+
workflow_run:
6+
workflows: ["CI"]
7+
types:
8+
- "completed"
9+
10+
jobs:
11+
test:
12+
name: "Post coverage comment to PR"
13+
runs-on: "ubuntu-latest"
14+
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' # yamllint disable-line rule:quoted-strings rule:comments
15+
permissions:
16+
# Gives the action the necessary permissions for publishing new
17+
# comments in pull requests.
18+
pull-requests: "write"
19+
# Gives the action the necessary permissions for editing existing
20+
# comments (to avoid publishing multiple comments in the same PR)
21+
contents: "write" # yamllint disable-line rule:indentation rule:comments
22+
# Gives the action the necessary permissions for looking up the
23+
# workflow that launched this workflow, and download the related
24+
# artifact that contains the comment to be published
25+
actions: "read"
26+
steps:
27+
# DO NOT run actions/checkout here, for security reasons
28+
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
29+
- name: "Post comment"
30+
uses: "py-cov-action/python-coverage-comment-action@d1ff8fbb5ff80feedb3faa0f6d7b424f417ad0e13" # v3.30
31+
with:
32+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
33+
GITHUB_PR_RUN_ID: "${{ github.event.workflow_run.id }}"
34+
# Update those if you changed the default values:
35+
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action
36+
# COMMENT_FILENAME: python-coverage-comment-action.txt

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ coverage.xml
5656
*.py,cover
5757
.hypothesis/
5858
.pytest_cache/
59+
lcov.info
5960

6061
# Translations
6162
*.mo

development/development.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ POSTGRES_DB=${NAUTOBOT_DB_NAME}
3737
MYSQL_USER=${NAUTOBOT_DB_USER}
3838
MYSQL_DATABASE=${NAUTOBOT_DB_NAME}
3939
MYSQL_ROOT_HOST=%
40+
41+
# Use a less verbose log level for Celery Beat
42+
NAUTOBOT_BEAT_LOG_LEVEL=INFO

development/docker-compose.base.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ services:
4141
beat:
4242
entrypoint:
4343
- "sh"
44-
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
45-
- "nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
44+
- "-c" # this is to evaluate the $NAUTOBOT_BEAT_LOG_LEVEL from the env
45+
- "nautobot-server celery beat -l $$NAUTOBOT_BEAT_LOG_LEVEL" ## $$ because of docker-compose
4646
depends_on:
4747
nautobot:
4848
condition: "service_healthy"

development/docker-compose.dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ services:
4040
beat:
4141
entrypoint:
4242
- "sh"
43-
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
44-
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
43+
- "-c" # this is to evaluate the $NAUTOBOT_BEAT_LOG_LEVEL from the env
44+
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery beat -l $$NAUTOBOT_BEAT_LOG_LEVEL" ## $$ because of docker-compose
4545
volumes:
4646
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
4747
- "../:/source"

development/docker-compose.mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
- "creds.env"
2323
- "development_mysql.env"
2424
db:
25-
image: "mysql:8"
25+
image: "mysql:lts"
2626
command:
2727
- "--max_connections=1000"
2828
env_file:

development/docker-compose.postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
environment:
55
- "NAUTOBOT_DB_ENGINE=django.db.backends.postgresql"
66
db:
7-
image: "postgres:13-alpine"
7+
image: "postgres:17-alpine"
88
command:
99
- "-c"
1010
- "max_connections=200"

0 commit comments

Comments
 (0)