Skip to content

Commit

Permalink
Merge pull request #77 from nautobot/develop
Browse files Browse the repository at this point in the history
Release 1.1.4
  • Loading branch information
smk4664 authored May 1, 2023
2 parents 0be74ed + b66742d commit eb9ac10
Show file tree
Hide file tree
Showing 97 changed files with 4,212 additions and 2,405 deletions.
1 change: 1 addition & 0 deletions .bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ skips: []
# No need to check for security issues in the test scripts!
exclude_dirs:
- "./tests/"
- "./.venv/"
26 changes: 26 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"cookiecutter": {
"codeowner_github_usernames": "@smith-ntc",
"full_name": "Network to Code, LLC",
"email": "[email protected]",
"github_org": "nautobot",
"plugin_name": "nautobot_welcome_wizard",
"verbose_name": "Nautobot's Welcome Wizard",
"plugin_slug": "nautobot-welcome-wizard",
"project_slug": "nautobot-plugin-welcome-wizard",
"repo_url": "https://github.com/nautobot/nautobot-plugin-welcome-wizard",
"base_url": "welcome-wizard",
"min_nautobot_version": "1.5.4",
"max_nautobot_version": "1.9999",
"nautobot_version": "stable",
"camel_name": "NautobotWelcomeWizard",
"project_short_description": "Nautobot's Welcome Wizard",
"version": "0.1.0",
"model_class_name": "None",
"open_source_license": "Apache-2.0",
"docs_base_url": "https://docs.nautobot.com",
"docs_app_url": "https://docs.nautobot.com/projects/welcome-wizard/en/latest",
"_template": "../networktocode-llc/cookiecutter-ntc/nautobot-plugin",
"_output_dir": "/opt/ntc/baked"
}
}
20 changes: 17 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@
development/Dockerfile
development/docker-compose*.yml
development/*.env
*.env
environments/

# Python
**/*.pyc
**/*.pyo
**/__pycache__/
**/.pytest_cache/
**/.venv/


# Other
docs/_build
FAQ.md
.gitignore
.git/
.github/
invoke.yml
.gitignore
.github
tasks.py
LICENSE
**/*.log
**/.vscode/
invoke*.yml
tasks.py
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
# E501: Line length is enforced by Black, so flake8 doesn't need to check it
# W503: Black disagrees with this rule, as does PEP 8; Black wins
ignore = E501, W503
exclude =
migrations,
__pycache__,
manage.py,
settings.py,
.venv
164 changes: 121 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
---
name: "CI"
on: # yamllint disable
- "push"
- "pull_request"
concurrency: # Cancel any existing runs of this workflow for this same PR
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on: # yamllint disable-line rule:truthy rule:comments
push:
branches:
- "main"
- "develop"
tags:
- "v*"
pull_request: ~

env:
PLUGIN_NAME: "nautobot-plugin-welcome-wizard"

jobs:
black:
Expand All @@ -13,7 +24,7 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
Expand All @@ -24,11 +35,9 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
needs:
- "black"
pydocstyle:
runs-on: "ubuntu-20.04"
env:
Expand All @@ -37,11 +46,9 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
needs:
- "black"
flake8:
runs-on: "ubuntu-20.04"
env:
Expand All @@ -50,11 +57,9 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
needs:
- "black"
yamllint:
runs-on: "ubuntu-20.04"
env:
Expand All @@ -63,48 +68,70 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
needs:
- "black"
build:
runs-on: "ubuntu-20.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
- name: "Copy credentials"
run: "cp development/creds.example.env development/creds.env"
- name: "Build Container"
run: "poetry run invoke build"
pylint:
needs:
- "bandit"
- "pydocstyle"
- "flake8"
- "yamllint"
pylint:
- "black"
runs-on: "ubuntu-20.04"
strategy:
fail-fast: true
matrix:
python-version: ["3.8"]
nautobot-version: ["1.5.0"]
env:
INVOKE_WELCOME_WIZARD_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_WELCOME_WIZARD_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
- name: "Build"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_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 }}"
build-args: |
NAUTOBOT_VER=${{ matrix.nautobot-version }}
PYTHON_VER=${{ matrix.python-version }}
- name: "Copy credentials"
run: "cp development/creds.example.env development/creds.env"
- name: "Build Container"
run: "poetry run invoke build"
- name: "Linting: Pylint"
- name: "Linting: pylint"
run: "poetry run invoke pylint"
needs:
- "build"
unittest:
needs:
- "pylint"
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9"]
nautobot-version: ["1.2.11","1.3.7"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
db-backend: ["postgresql"]
nautobot-version: ["stable"]
include:
- python-version: "3.10"
db-backend: "postgresql"
nautobot-version: "1.5.0"
- python-version: "3.7"
db-backend: "mysql"
nautobot-version: "1.5.0"
- python-version: "3.10"
db-backend: "mysql"
nautobot-version: "stable"
runs-on: "ubuntu-20.04"
env:
INVOKE_WELCOME_WIZARD_PYTHON_VER: "${{ matrix.python-version }}"
Expand All @@ -113,16 +140,34 @@ jobs:
- name: "Check out repository code"
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v1"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
- name: "Build"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "./"
push: false
load: true
tags: "${{ env.PLUGIN_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 }}"
build-args: |
NAUTOBOT_VER=${{ matrix.nautobot-version }}
PYTHON_VER=${{ matrix.python-version }}
- name: "Copy credentials"
run: "cp development/creds.example.env development/creds.env"
- name: "Build Container"
run: "poetry run invoke build"
- name: "Use Mysql invoke settings when needed"
run: "cp invoke.mysql.yml invoke.yml"
if: "matrix.db-backend == 'mysql'"
- name: "Run Tests"
run: "poetry run invoke unittest"
needs:
- "pylint"
publish_gh:
needs:
- "unittest"
name: "Publish to GitHub"
runs-on: "ubuntu-20.04"
if: "startsWith(github.ref, 'refs/tags/v')"
Expand Down Expand Up @@ -153,9 +198,9 @@ jobs:
tag: "${{ github.ref }}"
overwrite: true
file_glob: true
publish_pypi:
needs:
- "unittest"
publish_pypi:
name: "Push Package to PyPI"
runs-on: "ubuntu-20.04"
if: "startsWith(github.ref, 'refs/tags/v')"
Expand Down Expand Up @@ -183,5 +228,38 @@ jobs:
with:
user: "__token__"
password: "${{ secrets.PYPI_API_TOKEN }}"
slack-notify:
needs:
- "unittest"
- "publish_gh"
- "publish_pypi"
runs-on: "ubuntu-20.04"
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
SLACK_MESSAGE: >-
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
Release: <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}>\n
Published by: <${{ github.server_url }}/${{ github.actor }}|${{ github.actor }}>
steps:
- name: "Send a notification to Slack"
# ENVs cannot be used directly in job.if. This is a workaround to check
# if SLACK_WEBHOOK_URL is present.
if: "env.SLACK_WEBHOOK_URL != ''"
uses: "slackapi/[email protected]"
with:
payload: |
{
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK"
13 changes: 13 additions & 0 deletions .github/workflows/upstream_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Nautobot Upstream Monitor"

on: # yamllint disable-line rule:truthy rule:comments
schedule:
- cron: "0 4 */2 * *" # every other day at midnight

jobs:
upstream-test:
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: "WELCOME_WIZARD"
plugin_name: "nautobot-plugin-welcome-wizard"
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
welcome_wizard/static/welcome_wizard/docs

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -298,6 +297,14 @@ fabric.properties

# Rando
creds.env
development/*.txt

# Invoke overrides
invoke.yml

# Docs
docs/README.md
docs/CHANGELOG.md
public

welcome_wizard/static
11 changes: 0 additions & 11 deletions .pydocstyle.ini

This file was deleted.

6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ version: 2

# Set the version of Python in the build environment.
build:
os: "ubuntu-20.04"
os: "ubuntu-22.04"
tools:
python: "3.9"
python: "3.10"

# MKDocs configuration file
mkdocs:
configuration: "mkdocs.yml"
fail_on_warning: true

# Use our docs/requirements.txt during installation.
python:
Expand Down
Loading

0 comments on commit eb9ac10

Please sign in to comment.