Skip to content

Commit

Permalink
Prep v 1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
itdependsnetworks committed Aug 26, 2023
1 parent e6d6235 commit d88fe0c
Show file tree
Hide file tree
Showing 22 changed files with 1,200 additions and 861 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8"]
nautobot-version: ["1.5.13"]
python-version: ["3.11"]
nautobot-version: ["1.6.1"]
env:
INVOKE_NAUTOBOT_GOLDEN_CONFIG_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_NAUTOBOT_GOLDEN_CONFIG_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
Expand Down Expand Up @@ -116,20 +116,20 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
db-backend: ["postgresql"]
nautobot-version: ["latest"]
# The include is a method to limit the amount of jobs ran. This essentially
# means that in addition to standard postgres and stable, also the lowest
# supported version and with mysql
include:
- python-version: "3.10"
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "1.5.13"
- python-version: "3.7"
nautobot-version: "1.6.1"
- python-version: "3.8"
db-backend: "mysql"
nautobot-version: "1.5.13"
- python-version: "3.10"
nautobot-version: "1.6.1"
- python-version: "3.11"
db-backend: "mysql"
nautobot-version: "latest"
runs-on: "ubuntu-20.04"
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down
9 changes: 4 additions & 5 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# -------------------------------------------------------------------------------------
# !!! USE CAUTION WHEN MODIFYING LINES BELOW

# Accepts a desired Nautobot version as build argument, default to 1.5.3
ARG NAUTOBOT_VER="1.5.3"
# Accepts a desired Nautobot version as build argument, default to 1.6.1
ARG NAUTOBOT_VER="1.6.1"

# Accepts a desired Python version as build argument, default to 3.7
ARG PYTHON_VER="3.7"
# Accepts a desired Python version as build argument, default to 3.11
ARG PYTHON_VER="3.11"

# Retrieve published development image of Nautobot base which should include most CI dependencies
FROM ghcr.io/nautobot/nautobot-dev:${NAUTOBOT_VER}-py${PYTHON_VER}
Expand All @@ -26,7 +26,6 @@ ENV NAUTOBOT_ROOT ${NAUTOBOT_ROOT}
# and CI and local development may have a newer version of Poetry
# Since this is only used for development and we don't ship this container, pinning Poetry back is not expressly necessary
# We also don't need virtual environments in container
ARG POETRY_VERSION=1.5.1
RUN curl -sSL https://install.python-poetry.org -o /tmp/install-poetry.py && \
python /tmp/install-poetry.py && \
rm -f /tmp/install-poetry.py && \
Expand Down
1 change: 1 addition & 0 deletions docs/admin/compatibility_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ While that last supported version will not be strictly enforced via the `max_ver
| 1.2.X | 1.4.0 | 1.5.2 [Official] |
| 1.3.X | 1.4.0 | 1.5.2 [Official] |
| 1.4.X | 1.5.3 | 1.5.99 [Official] |
| 1.5.X | 1.6.1 | 1.6.99 [Official] |
24 changes: 24 additions & 0 deletions docs/admin/release_notes/version_1.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# v1.5 Release Notes

- Add ability to update JSON based compliance via a job and have git integrations.
- Made custom compliance a boolean to support both JSON or CLI custom compliance types.
- Add metrics for Golden Config plugin.
- Add Option to Update Config Context Repos.

## v1.5.0 - 2023-08

### Added

- [455](https://github.com/nautobot/nautobot-plugin-golden-config/pull/455) - Add metrics for Golden Config plugin.
- [506](https://github.com/nautobot/nautobot-plugin-golden-config/pull/506) - Add Option to Update Config Context Repos.
- [487](https://github.com/nautobot/nautobot-plugin-golden-config/pull/487) - Implement native JSON support.
- [485](https://github.com/nautobot/nautobot-plugin-golden-config/pull/485) - Custom compliance for CLI and JSON rules.

### Changed

- [485](https://github.com/nautobot/nautobot-plugin-golden-config/pull/485) - Changed the behavior of custom compliance to a boolean vs toggle between cli, json, and custom.

### Fixed

- [513](https://github.com/nautobot/nautobot-plugin-golden-config/pull/513) - Fixed issue with native JSON support with `get_config_element` function.
- [505](https://github.com/nautobot/nautobot-plugin-golden-config/pull/505) - fixes imports and choice definitions in the compliance nornir play.
8 changes: 4 additions & 4 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Each command can be executed with `invoke <command>`. All commands support the a

#### Local Development Environment

```
```shell
build Build all docker images.
debug Start Nautobot and its dependencies in debug mode.
destroy Destroy all containers and volumes.
Expand All @@ -117,7 +117,7 @@ Each command can be executed with `invoke <command>`. All commands support the a

#### Utility

```
```shell
cli Launch a bash shell inside the running Nautobot container.
create-user Create a new user in django (default: admin), will prompt for password.
makemigrations Run Make Migration in Django.
Expand All @@ -126,7 +126,7 @@ Each command can be executed with `invoke <command>`. All commands support the a

#### Testing

```
```shell
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.
Expand Down Expand Up @@ -155,7 +155,7 @@ Poetry is used in lieu of the "virtualenv" commands and is leveraged in both env
The `pyproject.toml` file outlines all of the relevant dependencies for the project:

- `tool.poetry.dependencies` - the main list of dependencies.
- `tool.poetry.dev-dependencies` - development dependencies, to facilitate linting, testing, and documentation building.
- `tool.poetry.group.dev.dependencies` - development dependencies, to facilitate linting, testing, and documentation building.

The `poetry shell` command is used to create and enable a virtual environment managed by Poetry, so all commands ran going forward are executed within the virtual environment. This is similar to running the `source venv/bin/activate` command with virtualenvs. To install project dependencies in the virtual environment, you should run `poetry install` - this will install **both** project and development dependencies.

Expand Down
7 changes: 3 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
griffe==0.30.1
mkdocs==1.3.1
mkdocs-material==8.4.2
mkdocs==1.5.2
mkdocs-material==9.2.4
mkdocs-version-annotations==1.0.0
mkdocstrings==0.22.0
mkdocstrings-python==1.1.2
mkdocstrings-python==1.5.2
8 changes: 8 additions & 0 deletions docs/user/app_feature_compliancecli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ configuration. The compliance engine has several features to better build work t
3. The ability to dynamically understand parent/child relationships within the configurations.

In regards to `1`, consider the following example of how to obtain service configurations:

```
service
no service
```

Specific configurations that start with either of these commands can be grouped together.

In regards to `2`, consider the configurations of SNMP on a nexus switch.

```
snmp-server community secure group network-admin
snmp-server community networktocode group network-operator
Expand All @@ -34,14 +37,17 @@ snmp-server community secure group network-admin
```

In regards to `3`, consider the following example of BGP configuration.

```
router bgp
prefix-list
```

All configurations that are a parent and child relationships would be considered within the parsing engine. Additionally, if one configuration line was
wrong, only that line and the parents would be shown, not all lines or only the missing configuration without context of the parents, e.g. Given:

Actual

```
router bgp 65250
router-id 10.0.10.5
Expand All @@ -54,6 +60,7 @@ router bgp 65250
```

Intended

```
router bgp 65250
router-id 10.0.10.6
Expand All @@ -64,6 +71,7 @@ router bgp 65250
remote-as 65250
address-family ipv4 unicast
```

Would result in the identifying the missing configurations as:

```
Expand Down
4 changes: 2 additions & 2 deletions docs/user/app_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Compliance requires Backups and Intended Configurations in order to be executed.

Golden Config properties include: Compliance Features, Compliance Rules, Config Removals, and Config Replacements. They can be created via the UI, API, or alternatively you can load these properties from a Git repository, defined in YAML files following the this directory structure (you can skip any of them if not apply):

```
```shell
├── golden_config
│ ├── compliance_features
│ ├── compliance_rules
Expand All @@ -136,7 +136,7 @@ Golden Config properties include: Compliance Features, Compliance Rules, Config

The files within these folders can follow any naming pattern or nested folder structure, all of them will be recursively taken into account. So it's up to you to decide how to you prefer to organize these files (within the previously stated directory structure):

```
```shell
├── golden_config
│ ├── compliance_features
│ │ └── all.yml
Expand Down
2 changes: 1 addition & 1 deletion docs/user/troubleshooting/troubleshoot_dispatchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Some steps to consider to troubleshooting this:

As an example if you wanted to use NAPALMs Palo Alto plugin you'd need that library installed in the environment.

```
```shell
pip install napalm-panos
```

Expand Down
2 changes: 1 addition & 1 deletion invoke.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ nautobot_golden_config:
project_name: "nautobot-golden-config"
nautobot_ver: "latest"
local: false
python_ver: "3.8"
python_ver: "3.11"
compose_dir: "development"
compose_files:
- "docker-compose.base.yml"
Expand Down
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ site_dir: "golden-config/static/golden-config/docs"
site_name: "Golden Configuration Documentation"
site_url: "https://docs.nautobot.com/projects/golden-config/en/latest/"
repo_url: "https://github.com/nautobot/nautobot-plugin-golden-config"
copyright: "Copyright &copy; 2022 The Authors"
copyright: "Copyright &copy; 2023 The Authors"
theme:
name: "material"
navigation_depth: 4
Expand All @@ -14,6 +14,7 @@ theme:
- "django"
- "yaml"
features:
- "content.code.copy"
- "navigation.tracking"
- "navigation.tabs"
- "navigation.tabs.sticky"
Expand Down Expand Up @@ -117,6 +118,7 @@ nav:
- Compatibility Matrix: "admin/compatibility_matrix.md"
- Release Notes:
- "admin/release_notes/index.md"
- v1.5: "admin/release_notes/version_1.5.md"
- v1.4: "admin/release_notes/version_1.4.md"
- v1.3: "admin/release_notes/version_1.3.md"
- v1.2: "admin/release_notes/version_1.2.md"
Expand Down
9 changes: 3 additions & 6 deletions nautobot_golden_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""Plugin declaration for nautobot_golden_config."""
# Metadata is inherited from Nautobot. If not including Nautobot in the environment, this should be added
try:
from importlib import metadata
except ImportError:
# Python version < 3.8
import importlib_metadata as metadata
from importlib import metadata


__version__ = metadata.version(__name__)

Expand All @@ -22,7 +19,7 @@ class GoldenConfig(PluginConfig):
author_email = "opensource@networktocode.com"
description = "Nautobot Apps that embraces NetDevOps and automates configuration backups, performs configuration compliance, and generates intended configurations. Includes native Git integration and gives users the flexibility to mix and match the supported features."
base_url = "golden-config"
min_version = "1.5.3"
min_version = "1.6.1"
max_version = "1.99"
default_settings = {
"enable_backup": True,
Expand Down
10 changes: 5 additions & 5 deletions nautobot_golden_config/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class GoldenConfigFilterSet(CustomFieldModelFilterSetMixin):
label="Device Name",
)

def search(self, queryset, name, value): # pylint: disable=unused-argument,no-self-use
def search(self, queryset, name, value): # pylint: disable=unused-argument
"""Perform the filtered search."""
if not value.strip():
return queryset
Expand Down Expand Up @@ -196,7 +196,7 @@ class ComplianceFeatureFilterSet(CustomFieldModelFilterSetMixin):
label="Search",
)

def search(self, queryset, name, value): # pylint: disable=unused-argument,no-self-use
def search(self, queryset, name, value): # pylint: disable=unused-argument
"""Perform the filtered search."""
if not value.strip():
return queryset
Expand All @@ -218,7 +218,7 @@ class ComplianceRuleFilterSet(GenericPlatformFilterSet):
label="Search",
)

def search(self, queryset, name, value): # pylint: disable=unused-argument,no-self-use
def search(self, queryset, name, value): # pylint: disable=unused-argument
"""Perform the filtered search."""
if not value.strip():
return queryset
Expand All @@ -240,7 +240,7 @@ class ConfigRemoveFilterSet(GenericPlatformFilterSet):
label="Search",
)

def search(self, queryset, name, value): # pylint: disable=unused-argument,no-self-use
def search(self, queryset, name, value): # pylint: disable=unused-argument
"""Perform the filtered search."""
if not value.strip():
return queryset
Expand All @@ -262,7 +262,7 @@ class ConfigReplaceFilterSet(GenericPlatformFilterSet):
label="Search",
)

def search(self, queryset, name, value): # pylint: disable=unused-argument,no-self-use
def search(self, queryset, name, value): # pylint: disable=unused-argument
"""Perform the filtered search."""
if not value.strip():
return queryset
Expand Down
4 changes: 2 additions & 2 deletions nautobot_golden_config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def to_csv(self):
self.description,
)

def get_absolute_url(self): # pylint: disable=no-self-use
def get_absolute_url(self):
"""Return absolute URL for instance."""
return reverse("plugins:nautobot_golden_config:goldenconfigsetting", args=[self.pk])

Expand Down Expand Up @@ -640,7 +640,7 @@ def __str__(self):
"""Return a simple string if model is called."""
return self.name

def get_absolute_url(self): # pylint: disable=no-self-use
def get_absolute_url(self):
"""Return absolute URL for instance."""
return reverse("plugins:nautobot_golden_config:configremove", args=[self.pk])

Expand Down
Loading

0 comments on commit d88fe0c

Please sign in to comment.