Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 2.0 into main #645

Merged
merged 6 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# No need to check for security issues in the test scripts!
exclude_dirs:
- "./nautobot_golden_config/tests/"

- "./.venv/"
skips:
- "B404"
33 changes: 33 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"cookiecutter": {
"codeowner_github_usernames": "@itdependsnetworks @jeffkala @nkallergis",
"full_name": "Network to Code, LLC",
"email": "[email protected]",
"github_org": "nautobot",
"plugin_name": "nautobot_golden_config",
"verbose_name": "Golden Config",
"plugin_slug": "nautobot-golden-config",
"project_slug": "nautobot-plugin-golden-config",
"repo_url": "https://github.com/nautobot/nautobot-plugin-golden-config",
"base_url": "golden-config",
"min_nautobot_version": "1.4.0",
"max_nautobot_version": "1.9999",
"nautobot_version": "latest",
"camel_name": "NautobotGoldenConfig",
"project_short_description": "A plugin for configuration on nautobot",
"version": "1.0.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/golden-config/en/latest",
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "develop",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": []
}
}
}
27 changes: 27 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Docker related
development/Dockerfile
development/docker-compose*.yml
development/*.env
*.env
environments/

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


# Other
docs/_build
FAQ.md
.git/
.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
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
* @itdependsnetworks @jeffkala @nkallergis
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ about: Report a reproducible bug in the current release of nautobot-golden-confi

### Environment
* Python version: <!-- Example: 3.7.7 -->
* Nautobot version: <!-- Example: 1.0.1 -->
* Nautobot version: <!-- Example: 1.4.0 -->
* nautobot-golden-config version: <!-- Example: 1.0.0 -->

<!-- What did you expect to happen? -->
### Expected Behavior


<!-- What happened instead? -->
### Observed Behavior

<!--
Describe in detail the exact steps that someone else can take to reproduce
this bug using the current release.
Expand All @@ -16,10 +23,3 @@ about: Report a reproducible bug in the current release of nautobot-golden-confi
1.
2.
3.

<!-- What did you expect to happen? -->
### Expected Behavior


<!-- What happened instead? -->
### Observed Behavior
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: ✨ Feature Request
about: Propose a new feature or enhancement

---

### Environment
* Python version: <!-- Example: 3.7.7 -->
* Nautobot version: <!-- Example: 1.0.1 -->
* Nautobot version: <!-- Example: 1.4.0 -->
* nautobot-golden-config version: <!-- Example: 1.0.0 -->

<!--
Expand Down
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## New Pull Request

Have you:
- [ ] Updated the README if necessary?
- [ ] Updated any configuration settings?
- [ ] Written a unit test?

## Change Notes

## Justification
38 changes: 21 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
name: "CI"
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:
Expand All @@ -10,7 +13,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
PLUGIN_NAME: "nautobot-golden-config"
PLUGIN_NAME: "nautobot-plugin-golden-config"

jobs:
black:
Expand All @@ -19,7 +22,7 @@ jobs:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: black"
Expand All @@ -30,7 +33,7 @@ jobs:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: bandit"
Expand All @@ -41,7 +44,7 @@ jobs:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: pydocstyle"
Expand All @@ -52,7 +55,7 @@ jobs:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: flake8"
Expand All @@ -63,7 +66,7 @@ jobs:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Linting: yamllint"
Expand All @@ -80,13 +83,13 @@ jobs:
fail-fast: true
matrix:
python-version: ["3.11"]
nautobot-version: ["1.6.1"]
nautobot-version: ["2.0.0"]
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Set up Docker Buildx"
Expand Down Expand Up @@ -125,11 +128,11 @@ jobs:
include:
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "1.6.1"
- python-version: "3.8"
db-backend: "mysql"
nautobot-version: "1.6.1"
nautobot-version: "2.0.0"
- python-version: "3.11"
db-backend: "mysql"
nautobot-version: "2.0.0"
- python-version: "3.8"
db-backend: "mysql"
nautobot-version: "latest"
runs-on: "ubuntu-20.04"
Expand All @@ -138,7 +141,7 @@ jobs:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "Set up Docker Buildx"
Expand Down Expand Up @@ -173,7 +176,7 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
Expand Down Expand Up @@ -202,7 +205,7 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
Expand All @@ -226,7 +229,7 @@ jobs:
- "publish_pypi"
runs-on: "ubuntu-20.04"
env:
SLACK_WEBHOOK_URL: "${{ '{{ secrets.SLACK_WEBHOOK_URL }}' }}"
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
SLACK_MESSAGE: >-
*NOTIFICATION: NEW-RELEASE-PUBLISHED*\n
Repository: <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>\n
Expand All @@ -236,11 +239,12 @@ jobs:
- 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 != '' }}"
if: "env.SLACK_WEBHOOK_URL != ''"
uses: "slackapi/[email protected]"
with:
payload: |
{
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/rebake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "Rebake Cookie"
on: # yamllint disable-line rule:truthy
schedule:
# Every Saturday at 5:00 am UTC
- cron: "0 5 * * 6"
workflow_dispatch:
inputs:
template-ref:
description: "The branch or tag to use for the template, using the value from .cookiecutter.json when empty"
default: ""
jobs:
rebake:
runs-on: "ubuntu-22.04"
permissions:
actions: "write"
contents: "write"
packages: "read"
pull-requests: "write"
container: "ghcr.io/nautobot/cookiecutter-nautobot-app-drift-manager/prod:latest"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- name: "Configure"
id: "config"
run: |
export REBAKE_ARGS='--push'
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
export REBAKE_ARGS="$REBAKE_ARGS --template-ref='${{ github.event.inputs.template-ref }}'"
fi
echo "rebake-args='$REBAKE_ARGS'" >> $GITHUB_OUTPUT
- name: "Rebake"
run: |
python -m ntc_cookie_drift_manager rebake ${{ steps.config.outputs.rebake-args }} '${{ github.repositoryUrl }}'
6 changes: 3 additions & 3 deletions .github/workflows/upstream_testing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Nautobot Upstream Testing"
name: "Nautobot Upstream Monitor"

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

Expand All @@ -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_GOLDEN_CONFIG"
plugin_name: "nautobot-golden-config"
plugin_name: "nautobot-plugin-golden-config"
26 changes: 15 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Specific ignores
nautobot_backup.dump
.creds.env
creds.env
nautobot_golden_config/transposer.py
docker-compose.override.yml
packages/
invoke.yml
golden-config/
nautobot.sql

# Ansible Retry Files
*.retry
Expand Down Expand Up @@ -201,9 +196,6 @@ $RECYCLE.BIN/
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# Jetbrains IDE configs
.idea/

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
Expand Down Expand Up @@ -305,4 +297,16 @@ fabric.properties

### vscode ###
.vscode/*
*.code-workspace
*.code-workspace

# Rando
creds.env
development/*.txt

# Invoke overrides
invoke.yml

# Docs
public
/compose.yaml
/dump.sql
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.10"
python: "3.11"

mkdocs:
configuration: "mkdocs.yml"
Expand Down
5 changes: 4 additions & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
extends: "default"
rules:
comments: "enable"
empty-values: "enable"
empty-values: "disable"
indentation:
indent-sequences: "consistent"
line-length: "disable"
quoted-strings:
quote-type: "double"
ignore: |
.venv/
compose.yaml
Loading
Loading