Skip to content

Commit

Permalink
Merge pull request #804 from nautobot/develop
Browse files Browse the repository at this point in the history
Release 2.1.2
  • Loading branch information
itdependsnetworks authored Sep 3, 2024
2 parents a37c60b + feac7f2 commit 2c28e1d
Show file tree
Hide file tree
Showing 81 changed files with 2,521 additions and 2,495 deletions.
7 changes: 0 additions & 7 deletions .bandit.yml

This file was deleted.

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": "refs/tags/nautobot-app-v2.2.1",
"template_ref": "refs/tags/nautobot-app-v2.3.0",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": [
"black"
],
"draft": true,
"baked_commit_ref": "78686cacfb51540281444ff112705b91304f797c"
"baked_commit_ref": "4eb0e2da920ce7f21715b4dd11549ac433eba529"
}
}
}
Expand Down
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ FAQ.md
.git/
.gitignore
.github
tasks.py
LICENSE
**/*.log
**/.vscode/
Expand Down
36 changes: 6 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
APP_NAME: "nautobot-app-golden-config"

jobs:
black:
ruff-format:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
Expand All @@ -26,20 +26,9 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
ruff:
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
ruff-lint:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
Expand All @@ -61,17 +50,6 @@ jobs:
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
flake8:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
poetry:
runs-on: "ubuntu-22.04"
env:
Expand All @@ -96,12 +74,10 @@ jobs:
run: "poetry run invoke yamllint"
check-in-docker:
needs:
- "bandit"
- "ruff"
- "flake8"
- "ruff-format"
- "ruff-lint"
- "poetry"
- "yamllint"
- "black"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: true
Expand Down
11 changes: 0 additions & 11 deletions .pydocstyle.ini

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://pypi.org/project/nautobot-golden-config/"><img src="https://img.shields.io/pypi/v/nautobot-golden-config"></a>
<a href="https://pypi.org/project/nautobot-golden-config/"><img src="https://img.shields.io/pypi/dm/nautobot-golden-config"></a>
<br>
An App for <a href="https://github.com/nautobot/nautobot">Nautobot</a>.
An <a href="https://networktocode.com/nautobot-apps/">App</a> for <a href="https://nautobot.com/">Nautobot</a>.
</p>

## Overview
Expand Down
1 change: 1 addition & 0 deletions development/app_config_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""App Config Schema Generator and Validator."""

import json
from importlib import import_module
from os import getenv
Expand Down
1 change: 0 additions & 1 deletion development/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ x-nautobot-base: &nautobot-base
- "creds.env"
tty: true

version: "3.8"
services:
nautobot:
depends_on:
Expand Down
1 change: 0 additions & 1 deletion development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# any override will need to include these volumes to use them.
# see: https://github.com/docker/compose/issues/3729
---
version: "3.8"
services:
nautobot:
command: "nautobot-server runserver 0.0.0.0:8080"
Expand Down
4 changes: 2 additions & 2 deletions development/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
version: "3.8"

services:
nautobot:
environment:
Expand All @@ -18,6 +16,8 @@ services:
- "development_mysql.env"
db:
image: "mysql:8"
command:
- "--max_connections=1000"
env_file:
- "development.env"
- "creds.env"
Expand Down
2 changes: 0 additions & 2 deletions development/docker-compose.postgres.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
version: "3.8"

services:
nautobot:
environment:
Expand Down
1 change: 0 additions & 1 deletion development/docker-compose.redis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
version: "3.8"
services:
redis:
image: "redis:6-alpine"
Expand Down
12 changes: 7 additions & 5 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nautobot development configuration file."""

import os
import sys

Expand All @@ -9,7 +10,7 @@
# Debug
#

DEBUG = is_truthy(os.getenv("NAUTOBOT_DEBUG", False))
DEBUG = is_truthy(os.getenv("NAUTOBOT_DEBUG", "false"))
_TESTING = len(sys.argv) > 1 and sys.argv[1] == "test"

if DEBUG and not _TESTING:
Expand Down Expand Up @@ -47,9 +48,10 @@
"PASSWORD": os.getenv("NAUTOBOT_DB_PASSWORD", ""), # Database password
"HOST": os.getenv("NAUTOBOT_DB_HOST", "localhost"), # Database server
"PORT": os.getenv(
"NAUTOBOT_DB_PORT", default_db_settings[nautobot_db_engine]["NAUTOBOT_DB_PORT"]
"NAUTOBOT_DB_PORT",
default_db_settings[nautobot_db_engine]["NAUTOBOT_DB_PORT"],
), # Database port, default to postgres
"CONN_MAX_AGE": int(os.getenv("NAUTOBOT_DB_TIMEOUT", 300)), # Database timeout
"CONN_MAX_AGE": int(os.getenv("NAUTOBOT_DB_TIMEOUT", "300")), # Database timeout
"ENGINE": nautobot_db_engine,
}
}
Expand Down Expand Up @@ -158,8 +160,8 @@
"postprocessing_subscribed": os.environ.get("POSTPROCESSING_SUBSCRIBED", []),
"jinja_env": {
"undefined": "jinja2.StrictUndefined",
"trim_blocks": is_truthy(os.getenv("NAUTOBOT_JINJA_ENV_TRIM_BLOCKS", True)),
"lstrip_blocks": is_truthy(os.getenv("NAUTOBOT_JINJA_ENV_LSTRIP_BLOCKS", False)),
"trim_blocks": is_truthy(os.getenv("NAUTOBOT_JINJA_ENV_TRIM_BLOCKS", "true")),
"lstrip_blocks": is_truthy(os.getenv("NAUTOBOT_JINJA_ENV_LSTRIP_BLOCKS", "false")),
},
# "get_custom_compliance": "my.custom_compliance.func",
# "default_deploy_status": "Not Approved",
Expand Down
28 changes: 23 additions & 5 deletions docs/admin/release_notes/version_2.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
- Hide Compliance tab if no compliance result exists.


### Added

- [#1501](https://github.com/nautobot/nautobot-app-golden-config/issues/1501) - Add Support for XML Compliance
## v2.1.2 2024-08

### Fixed

- [#723](https://github.com/nautobot/nautobot-app-golden-config/issues/723) - Hide compliance tab in device view if no compliance results exist.
- [#792](https://github.com/nautobot/nautobot-app-golden-config/issues/792) - Fixed issue with dynamic groups not being called in 2.3.0.
- [#800](https://github.com/nautobot/nautobot-app-golden-config/issues/800) - Fixed issue where compliance amongst other fields were not being updated when Django 4.2 was installed.

### Changed

- [#792](https://github.com/nautobot/nautobot-app-golden-config/issues/792) - Added an experimental `_manual_dynamic_group_mgmt` config to collect feedback on appropriate methodology, use at your own risk!!.

## v2.1.1
### Housekeeping

- [#786](https://github.com/nautobot/nautobot-app-golden-config/issues/786) - Fixed incorrect test data setup for `test_tags_filter()` test for `ConfigPlanFilterTestCase`.
- [#788](https://github.com/nautobot/nautobot-app-golden-config/issues/788) - Rebaked from the cookie `nautobot-app-v2.3.0`.

## v2.1.1 - 2024-07

### Fixed

Expand All @@ -33,3 +40,14 @@
### Housekeeping

- [#769](https://github.com/nautobot/nautobot-app-golden-config/issues/769) - Added view tests for ConfigComplianceUIViewSet.


## v2.1.0 - 2024-05

### Added

- [#708](https://github.com/nautobot/nautobot-app-golden-config/issues/708) - Add Support for XML Compliance

### Fixed

- [#723](https://github.com/nautobot/nautobot-app-golden-config/issues/723) - Hide compliance tab in device view if no compliance results exist.
2 changes: 1 addition & 1 deletion docs/assets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ a.autorefs-external:hover::after {
}


/* Customization for mkdocs-version-annotations */
/* Customization for markdown-version-annotations */
:root {
/* Icon for "version-added" admonition: Material Design Icons "plus-box-outline" */
--md-admonition-icon--version-added: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 19V5H5v14h14m0-16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-8 4h2v4h4v2h-4v4h-2v-4H7v-2h4V7Z"/></svg>');
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The project is packaged with a light [development environment](dev_environment.m

The project is following Network to Code software development guidelines and is leveraging the following:

- Python linting and formatting: `black`, `pylint`, `bandit`, `flake8`, and `ruff`.
- Python linting and formatting: `pylint` and `ruff`.
- YAML linting is done with `yamllint`.
- Django unit test to ensure the app is working properly.

Expand Down
10 changes: 2 additions & 8 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ Each command can be executed with `invoke <command>`. All commands support the a
#### Testing

```
bandit Run bandit to validate basic static code security analysis.
black Run black to check that Python files adhere to its style standards.
flake8 Run flake8 to check that Python files adhere to its style standards.
ruff Run ruff to validate docstring formatting adheres to NTC defined standards.
ruff Run ruff to perform code formatting and/or linting.
pylint Run pylint code analysis.
tests Run all tests for this app.
unittest Run Django unit tests for the app.
Expand Down Expand Up @@ -454,7 +451,7 @@ This is the same as running:

### Tests

To run tests against your code, you can run all of the tests that TravisCI runs against any new PR with:
To run tests against your code, you can run all of the tests that the CI runs against any new PR with:

```bash
➜ invoke tests
Expand All @@ -464,9 +461,6 @@ To run an individual test, you can run any or all of the following:

```bash
➜ invoke unittest
➜ invoke bandit
➜ invoke black
➜ invoke flake8
➜ invoke ruff
➜ invoke pylint
```
Expand Down
11 changes: 6 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mkdocs==1.5.2
mkdocs-material==9.2.4
mkdocs-version-annotations==1.0.0
mkdocstrings-python==1.5.2
mkdocstrings==0.22.0
mkdocs==1.6.0
mkdocs-material==9.5.32
markdown-version-annotations==1.0.1
griffe==1.1.1
mkdocstrings-python==1.10.8
mkdocstrings==0.25.2
4 changes: 2 additions & 2 deletions docs/user/app_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Using the previous example, everything will use the napalm dispatcher, this is i
}
```

Using the previous example, everything will use the napalm dispatcher **except** forinet, which would use netmiko.
Using the previous example, everything will use the napalm dispatcher **except** fortinet, which would use netmiko.

```json
# DEFAULT_FRAMEWORK
Expand All @@ -321,7 +321,7 @@ Using the previous example, everything will use the napalm dispatcher **except**
}
```

Using the previous example, everything will use the napalm dispatcher **except** forinet **and** when using the `get_config` method for `arista_eos` and `cisco_nxos`, use netmiko.
Using the previous example, everything will use the napalm dispatcher **except** fortinet **and** when using the `get_config` method for `arista_eos` and `cisco_nxos`, use netmiko.

As you can see, you now have the flexibility to control which network_driver will use which framework for every method, as each constance setting is sanely named to match the method name (e.g. `GET_CONFIG_FRAMEWORK` maps the `get_config` method). Additionally, if the current `network_driver` and associated `network_driver_mappings` is not sufficient as is, you can extend the [NETWORK DRIVER](https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/configuration/optional-settings/#network_drivers) settings as well.

Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ extra:
link: "https://twitter.com/networktocode"
name: "Network to Code Twitter"
markdown_extensions:
- "markdown_version_annotations":
admonition_tag: "???"
- "admonition"
- "toc":
permalink: true
Expand All @@ -89,7 +91,6 @@ markdown_extensions:
- "footnotes"
plugins:
- "search"
- "mkdocs-version-annotations"
- "mkdocstrings":
default_handler: "python"
handlers:
Expand Down
6 changes: 5 additions & 1 deletion nautobot_golden_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""App declaration for nautobot_golden_config."""

# Metadata is inherited from Nautobot. If not including Nautobot in the environment, this should be added
from importlib import metadata

Expand Down Expand Up @@ -35,6 +36,9 @@ class GoldenConfig(NautobotAppConfig):
"per_feature_width": 13,
"per_feature_height": 4,
"get_custom_compliance": None,
# This is an experimental and undocumented setting that will change in the future!!
# Use at your own risk!!!!!
"_manual_dynamic_group_mgmt": False,
"jinja_env": {
"undefined": "jinja2.StrictUndefined",
"trim_blocks": True,
Expand Down Expand Up @@ -71,8 +75,8 @@ def ready(self):
# pylint: disable=import-outside-toplevel
from .signals import (
config_compliance_platform_cleanup,
post_migrate_create_statuses,
post_migrate_create_job_button,
post_migrate_create_statuses,
)

nautobot_database_ready.connect(post_migrate_create_statuses, sender=self)
Expand Down
Loading

0 comments on commit 2c28e1d

Please sign in to comment.