Skip to content

Commit

Permalink
Update docs to correspond to cookiecutter template
Browse files Browse the repository at this point in the history
  • Loading branch information
DistantVoyager committed Mar 28, 2023
1 parent d195d51 commit 7089c24
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 41 deletions.
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
---
name: 🐛 Bug Report
about: Report a reproducible bug in the current release of nautobot-data-validation-engine
about: Report a reproducible bug in the current release of nautobot-data-validation-engine
---

### Environment
* Python version: <!-- Example: 3.7.7 -->
* Nautobot version: <!-- Example: 1.0.0 -->
* nautobot-data-validation-engine version: <!-- Example: 1.0.0 -->
* Nautobot version: <!-- Example: 1.5.7 -->
* nautobot-data-validation-engine version: <!-- Example: 2.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
Expand All @@ -16,10 +23,3 @@ about: Report a reproducible bug in the current release of nautobot-data-validat
1.
2.
3.

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


<!-- What happened instead? -->
### Observed Behavior
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
10 changes: 5 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Copyright 2021 Network to Code <opensource@networktocode.com>
Network to Code, LLC
Apache Software License 2.0

Copyright (c) 2023, 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.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
26 changes: 19 additions & 7 deletions docs/admin/install.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Installing the App in Nautobot

Here you will find detailed instructions on how to **install** and **configure** the App within your Nautobot environment.

## Prerequisites

- The plugin is compatible with Nautobot 1.0.0 and higher.
- This Nautobot App is compatible with Nautobot 1.0.0 and higher.
- Databases supported: PostgreSQL, MySQL

!!! note
Please check the [dedicated page](compatibility_matrix.md) for a full compatibility matrix and the deprecation policy.

### Access Requirements

## Install Guide

!!! note
Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`nautobot-data-validation-engine`](https://pypi.org/project/nautobot-data-validation-engine/).
Nautobot Apps can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this Nautobot App
is [`nautobot-data-validation-engine`](https://pypi.org/project/nautobot-data-validation-engine/).

The plugin is available as a Python package via PyPI and can be installed with `pip`:
This Nautobot App is available as a Python package via PyPI and can be installed with `pip`:

```shell
pip install nautobot-data-validation-engine
Expand All @@ -26,16 +30,23 @@ To ensure Data Validation Engine is automatically re-installed during future upg
echo nautobot-data-validation-engine >> local_requirements.txt
```

Once installed, the plugin needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file:
Once installed, this Nautobot App needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file:

- Append `"nautobot_data_validation_engine"` to the `PLUGINS` list.
- Append `"nautobot_data_validation_engine"` to the `NAUTOBOT_APPS` list.
- Append the `"nautobot_data_validation_engine"` dictionary to the `NAUTOBOT_APPS_CONFIG` dictionary and override any defaults.

```python
# In your nautobot_config.py
PLUGINS = ["nautobot_data_validation_engine"]
NAUTOBOT_APPS = ["nautobot_data_validation_engine"]

# NAUTOBOT_APPS_CONFIG = {
# "nautobot_data_validation_engine": {
# ADD YOUR SETTINGS HERE
# }
# }
```

Once the Nautobot configuration is updated, run the Post Upgrade command (`nautobot-server post_upgrade`) to run migrations and clear any cache.
Once the Nautobot configuration is updated, run the Post Upgrade command (`nautobot-server post_upgrade`) to run migrations and clear any cache:

```shell
nautobot-server post_upgrade
Expand All @@ -51,3 +62,4 @@ Then restart (if necessary) the Nautobot services which may include:
sudo systemctl restart nautobot nautobot-worker nautobot-scheduler
```

## App Configuration
7 changes: 4 additions & 3 deletions docs/admin/uninstall.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Uninstall the App from Nautobot

Here you will find any steps necessary to cleanly remove the App from your Nautobot environment.

## Uninstall Guide

Remove the configuration you added in `nautobot_config.py` from the `PLUGINS` list.
Remove the configuration you added in `nautobot_config.py` from `NAUTOBOT_APPS` & `NAUTOBOT_APPS_CONFIG`.

## Database Cleanup

Drop all tables from the plugin: `nautobot_plugin_data_validation_engine*`.

Drop all tables from the Nautobot App: `nautobot_plugin_data_validation_engine*`.
4 changes: 3 additions & 1 deletion docs/admin/upgrade.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Upgrading the App

Here you will find any steps necessary to upgrade the App in your Nautobot environment.

## Upgrade Guide

When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this plugin. Execute the command `nautobot-server migrate` from the Nautobot install nautobot/ directory after updating the `nautobot-data-validation-engine` package via `pip`.
When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this Nautobot App. Execute the command `nautobot-server post-upgrade` within the runtime environment of your Nautobot installation after updating the `nautobot-data-validation-engine` package via `pip`.
2 changes: 1 addition & 1 deletion docs/assets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}

img.logo {
height: 100px;
height: 200px;
}

img.copyright-logo {
Expand Down
1 change: 0 additions & 1 deletion docs/dev/code_reference/models.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/dev/code_reference/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: nautobot_data_validation_engine
2 changes: 1 addition & 1 deletion docs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The project is following Network to Code software development guidelines and is

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

Documentation is built using [mkdocs](https://www.mkdocs.org/). The [Docker based development environment](dev_environment.md#docker-development-environment) automatically starts a container hosting a live version of the documentation website on [http://localhost:8001](http://localhost:8001) that auto-refreshes when you make any changes to your local files.

Expand Down
17 changes: 9 additions & 8 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Building Your Development Environment

## Quickstart
## Quickstart Guide

The development environment can be used in two ways:

1. `Recommended` All services are spun up using Docker and a local mount so you can develop locally, but Nautobot is spun up within the Docker container.
2. With a local poetry environment if you wish to develop outside of Docker with the caveat of using external services provided by Docker for PostgresQL and Redis.
1. **(Recommended)** All services, including Nautobot, are spun up using Docker containers and a volume mount so you can develop locally.
2. With a local Poetry environment if you wish to develop outside of Docker, with the caveat of using external services provided by Docker for the database (PostgreSQL by default, MySQL optionally) and Redis services.

This is a quick reference guide if you're already familiar with the development environment provided, which you can read more about later in this document.

Expand Down Expand Up @@ -132,8 +132,8 @@ Each command can be executed with `invoke <command>`. All commands support the a
flake8 Run flake8 to check that Python files adhere to its style standards.
pydocstyle Run pydocstyle to validate docstring formatting adheres to NTC defined standards.
pylint Run pylint code analysis.
tests Run all tests for this plugin.
unittest Run Django unit tests for the plugin.
tests Run all tests for this Nautobot App.
unittest Run Django unit tests for the Nautobot App.
```


Expand Down Expand Up @@ -216,6 +216,7 @@ This will start all of the Docker containers used for hosting Nautobot. You shou
```bash
➜ docker ps
****CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ee90fbfabd77 nautobot-data-validation-engine/nautobot:latest-py3.7 "nautobot-server rqw…" 16 seconds ago Up 13 seconds nautobot_data_validation_engine_worker_1
b8adb781d013 nautobot-data-validation-engine/nautobot:latest-py3.7 "/docker-entrypoint.…" 20 seconds ago Up 15 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp nautobot_data_validation_engine_nautobot_1
d64ebd60675d nautobot-data-validation-engine/nautobot:latest-py3.7 "mkdocs serve -v -a …" 25 seconds ago Up 18 seconds 0.0.0.0:8001->8080/tcp, :::8001->8080/tcp nautobot_data_validation_engine_docs_1
e72d63129b36 postgres:13-alpine "docker-entrypoint.s…" 25 seconds ago Up 19 seconds 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp nautobot_data_validation_engine_postgres_1
Expand Down Expand Up @@ -359,9 +360,9 @@ Once the dependencies are resolved, stop the existing containers, rebuild the Do
➜ invoke start
```

### Installing Additional Nautobot Plugins
### Installing Additional Nautobot Apps

Let's say for example you want the new plugin you're creating to integrate into Slack. To do this, you will want to integrate into the existing Nautobot ChatOps Plugin.
Let's say for example you want the new plugin you're creating to integrate into Slack. To do this, you will want to integrate into the existing Nautobot ChatOps Nautobot App.

```bash
➜ poetry shell
Expand All @@ -370,7 +371,7 @@ Let's say for example you want the new plugin you're creating to integrate into

Once you activate the virtual environment via Poetry, you then tell Poetry to install the new plugin.

Before you continue, you'll need to update the file `development/nautobot_config.py` accordingly with the name of the new plugin under `PLUGINS` and any relevant settings as necessary for the plugin under `PLUGINS_CONFIG`. Since you're modifying the underlying OS (not just Django files), you need to rebuild the image. This is a similar process to updating environment variables, which was explained earlier.
Before you continue, you'll need to update the file `development/nautobot_config.py` accordingly with the name of the new plugin under `NAUTOBOT_APPS` and any relevant settings as necessary for the Nautobot App under `NAUTOBOT_APPS_CONFIG`. Since you're modifying the underlying OS (not just Django files), you need to rebuild the image. This is a similar process to updating environment variables, which was explained earlier.

```bash
➜ invoke stop
Expand Down
6 changes: 3 additions & 3 deletions docs/user/app_getting_started.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Getting Started with the App

A step-by-step tutorial on how to get the App going and how to use it.
This document provides a step-by-step tutorial on how to get the App going and how to use it.

## Install the App

To install the App, please follow the instructions detailed in the [Installation Guide](../admin/install.md).

## First steps with the App

Once the App is installed, under "Extensibility" tab, you will find the supported Data Validation Engine rules in the "Data Validation" section. For example, "Min/Max Rules", or "Regex Rule".
Once the App is installed, under the "Extensibility" tab, you will find the supported Data Validation Engine rules in the "Data Validation" section. For example, "Min/Max Rules" or "Regex Rules".

There you can list the existing validation rules of each type, or create them (one by one, or dumping them).

!!! note
The validation rules only take effect for new data entries, not for previous existing data. So, when you create a new object, for instance, a `ipam.VLAN`, is when the existing validation rules will be enforced. Validation rules will be enforced when explicitly editing existing data.
The validation rules only take effect for new data entries, not for previous existing data. So, when you create a new object, for instance, an `ipam.VLAN`, that is when the existing validation rules will be enforced. Validation rules will be enforced when explicitly editing existing data.
7 changes: 6 additions & 1 deletion docs/user/app_overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# App Overview

## Description/Overview
This document provides an overview of the App including critical information and import considerations when applying it to your Nautobot environment.

!!! note
Throughout this documentation, the terms "app" and "plugin" will be used interchangeably.

## Description

The data validation engine app offers a set of user definable rules which are used to enforce business constraints on the data in Nautobot. These rules are tied to particular models and each rule is meant to enforce one aspect of a business use case.

Expand Down
2 changes: 2 additions & 0 deletions docs/user/app_use_cases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Using the App

This document describes common use-cases and scenarios for this App.

## General Usage

The data validation engine app offers a set of user definable rules which are used to enforce business constraints on the data in Nautobot. These rules are tied to particular models and each rule is meant to enforce one aspect of a business use case.
Expand Down

0 comments on commit 7089c24

Please sign in to comment.