Skip to content

Commit

Permalink
Merge pull request #151 from nautobot/drift-manager/pr
Browse files Browse the repository at this point in the history
Cookie updated by NetworkToCode Cookie Drift Manager Tool
  • Loading branch information
scetron authored Feb 13, 2024
2 parents 9cf194f + 0291743 commit 3f180ff
Show file tree
Hide file tree
Showing 27 changed files with 720 additions and 417 deletions.
4 changes: 2 additions & 2 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "develop",
"template_ref": "refs/tags/nautobot-app-v2.1.0",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": [
"black"
],
"draft": true,
"baked_commit_ref": "094719b3173bd24329c250c54c586b699be5f0c1"
"baked_commit_ref": "0af4c3b9796ef8fcd806cf023936daaf7e978e5d"
}
}
}
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Default owners for all files in this repository
# Default owner(s) of all files in this repository
* @mzbroch @scetron @glennmatthews @chadell
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Thank you for your interest in contributing to Nautobot! Please note
Thank you for your interest in contributing to Device Onboarding! Please note
that our contribution policy recommends that a feature request or bug
report be opened for approval prior to filing a pull request. This
helps avoid wasting time and effort on something that we might not
Expand Down
57 changes: 48 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
PLUGIN_NAME: "nautobot-plugin-device-onboarding"
APP_NAME: "nautobot-app-device-onboarding"

jobs:
black:
Expand All @@ -38,7 +38,7 @@ jobs:
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
pydocstyle:
ruff:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_DEVICE_ONBOARDING_LOCAL: "True"
Expand All @@ -47,8 +47,19 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
- name: "Linting: ruff"
run: "poetry run invoke ruff"
check-docs-build:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_DEVICE_ONBOARDING_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
flake8:
runs-on: "ubuntu-22.04"
env:
Expand Down Expand Up @@ -85,7 +96,7 @@ jobs:
pylint:
needs:
- "bandit"
- "pydocstyle"
- "ruff"
- "flake8"
- "poetry"
- "yamllint"
Expand Down Expand Up @@ -114,7 +125,7 @@ jobs:
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
Expand All @@ -128,7 +139,7 @@ jobs:
check-migrations:
needs:
- "bandit"
- "pydocstyle"
- "ruff"
- "flake8"
- "poetry"
- "yamllint"
Expand Down Expand Up @@ -157,7 +168,7 @@ jobs:
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
Expand Down Expand Up @@ -204,7 +215,7 @@ jobs:
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
tags: "${{ env.APP_NAME }}/nautobot:${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
cache-to: "type=gha,scope=${{ matrix.nautobot-version }}-py${{ matrix.python-version }}"
Expand All @@ -218,12 +229,30 @@ jobs:
if: "matrix.db-backend == 'mysql'"
- name: "Run Tests"
run: "poetry run invoke unittest"
changelog:
if: |
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
(github.head_ref != 'main')
runs-on: "ubuntu-22.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
with:
fetch-depth: "0"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Check for changelog entry"
run: |
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
poetry run towncrier check --compare-with origin/${{ github.base_ref }}
publish_gh:
needs:
- "unittest"
name: "Publish to GitHub"
runs-on: "ubuntu-22.04"
if: "startsWith(github.ref, 'refs/tags/v')"
env:
INVOKE_NAUTOBOT_DEVICE_ONBOARDING_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand All @@ -237,6 +266,10 @@ jobs:
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Install Dependencies (needed for mkdocs)"
run: "poetry install --no-root"
- name: "Build Documentation"
run: "poetry run invoke build-and-check-docs"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Upload binaries to release"
Expand All @@ -253,6 +286,8 @@ jobs:
name: "Push Package to PyPI"
runs-on: "ubuntu-22.04"
if: "startsWith(github.ref, 'refs/tags/v')"
env:
INVOKE_NAUTOBOT_DEVICE_ONBOARDING_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand All @@ -266,6 +301,10 @@ jobs:
run: "echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV"
- name: "Run Poetry Version"
run: "poetry version $RELEASE_VERSION"
- name: "Install Dependencies (needed for mkdocs)"
run: "poetry install --no-root"
- name: "Build Documentation"
run: "poetry run invoke build-and-check-docs"
- name: "Run Poetry Build"
run: "poetry build"
- name: "Push to PyPI"
Expand Down
118 changes: 0 additions & 118 deletions .github/workflows/rebake.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/upstream_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
uses: "nautobot/nautobot/.github/workflows/plugin_upstream_testing_base.yml@develop"
with: # Below could potentially be collapsed into a single argument if a concrete relationship between both is enforced
invoke_context_name: "NAUTOBOT_DEVICE_ONBOARDING"
plugin_name: "nautobot-plugin-device-onboarding"
plugin_name: "nautobot-app-device-onboarding"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache Software License 2.0

Copyright (c) 2023, Network to Code, LLC
Copyright (c) 2024, Network to Code, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://raw.githubusercontent.com/nautobot/nautobot-app-device-onboarding/develop/docs/images/icon-DeviceOnboarding.png" class="logo" height="200px">
<br>
<a href="https://github.com/nautobot/nautobot-app-device-onboarding/actions"><img src="https://github.com/nautobot/nautobot-app-device-onboarding/actions/workflows/ci.yml/badge.svg?branch=develop"></a>
<a href="https://docs.nautobot.com/projects/device-onboarding/"><img src="https://readthedocs.org/projects/nautobot-plugin-device-onboarding/badge/"></a>
<a href="https://docs.nautobot.com/projects/device-onboarding/en/latest/"><img src="https://readthedocs.org/projects/nautobot-plugin-device-onboarding/badge/"></a>
<a href="https://pypi.org/project/nautobot-device-onboarding/"><img src="https://img.shields.io/pypi/v/nautobot-device-onboarding"></a>
<a href="https://pypi.org/project/nautobot-device-onboarding/"><img src="https://img.shields.io/pypi/dm/nautobot-device-onboarding"></a>
<br>
Expand Down Expand Up @@ -41,7 +41,7 @@ Full web-based HTML documentation for this app can be found over on the [Nautobo

### Contributing to the Docs

You can find all the Markdown source for the App documentation under the [docs](https://github.com/nautobot/nautobot-app-device-onboarding/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient - clone the repository and edit away.
You can find all the Markdown source for the App documentation under the [`docs`](https://github.com/nautobot/nautobot-app-device-onboarding/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.

If you need to view the fully generated documentation site, you can build it with [mkdocs](https://www.mkdocs.org/). A container hosting the docs will be started using the invoke commands (details in the [Development Environment Guide](https://docs.nautobot.com/projects/device-onboarding/en/latest/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). As your changes are saved, the live docs will be automatically reloaded.

Expand Down
1 change: 1 addition & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
1 change: 1 addition & 0 deletions changes/151.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replaced pydocstyle with ruff.
4 changes: 2 additions & 2 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ RUN pip show nautobot | grep "^Version: " | sed -e 's/Version: /nautobot==/' > c
#
# We can't use the entire freeze as it takes forever to resolve with rigidly fixed non-direct dependencies,
# especially those that are only direct to Nautobot but the container included versions slightly mismatch
RUN poetry export -f requirements.txt --without-hashes --output poetry_freeze_base.txt
RUN poetry export -f requirements.txt --with dev --without-hashes --output poetry_freeze_all.txt
RUN poetry export -f requirements.txt --without-hashes --extras all --output poetry_freeze_base.txt
RUN poetry export -f requirements.txt --without-hashes --extras all --with dev --output poetry_freeze_all.txt
RUN sort poetry_freeze_base.txt poetry_freeze_all.txt | uniq -u > poetry_freeze_dev.txt

# Install all local project as editable, constrained on Nautobot version, to get any additional
Expand Down
6 changes: 4 additions & 2 deletions development/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ services:
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events" ## $$ because of docker-compose
depends_on:
- "nautobot"
nautobot:
condition: "service_healthy"
healthcheck:
interval: "30s"
timeout: "10s"
Expand All @@ -44,7 +45,8 @@ services:
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
depends_on:
- "nautobot"
nautobot:
condition: "service_healthy"
healthcheck:
disable: true
<<: *nautobot-base
12 changes: 12 additions & 0 deletions development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ services:
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
- "../:/source"
healthcheck:
interval: "30s"
timeout: "10s"
start_period: "60s"
retries: 3
test: ["CMD", "true"] # Due to layering, disable: true won't work. Instead, change the test
docs:
entrypoint: "mkdocs serve -v -a 0.0.0.0:8080"
Expand All @@ -34,6 +38,14 @@ services:
- "../:/source"
healthcheck:
test: ["CMD", "true"] # Due to layering, disable: true won't work. Instead, change the test
beat:
entrypoint:
- "sh"
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL" ## $$ because of docker-compose
volumes:
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
- "../:/source"
# To expose postgres or redis to the host uncomment the following
# postgres:
# ports:
Expand Down
3 changes: 0 additions & 3 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@
}
}

# Redis Cacheops
CACHEOPS_REDIS = parse_redis_connection(redis_database=1)

#
# Celery settings are not defined here because they can be overloaded with
# environment variables. By default they use `CACHES["default"]["LOCATION"]`.
Expand Down
Loading

0 comments on commit 3f180ff

Please sign in to comment.