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

feat: ✨ Decommissioning Job #85

Merged
merged 43 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
62559fe
Updates pyproject.toml for 3.11
jvanderaa Aug 1, 2023
625e680
fix: Updates for OSRB documentation review
abates Oct 23, 2023
b264d0a
docs: The custom `indent` filter was removed in favor of using the bu…
abates Oct 23, 2023
6faec79
docs: Documentation updates
abates Oct 24, 2023
1c96d02
Merge branch 'develop' into support311
abates Dec 7, 2023
85e4ed0
docs: Removed unneeded doc template
abates Dec 11, 2023
b3950ac
Merge branch 'develop' into osrb-docs-review
abates Dec 11, 2023
d88f578
feat: :sparkles: Decommissioning Job
chadell Dec 12, 2023
1bd206d
Apply suggestions from code review
chadell Dec 13, 2023
e96367c
Merge pull request #81 from networktocode-llc/osrb-docs-review
abates Dec 13, 2023
b11e238
Merge pull request #62 from networktocode-llc/support311
abates Dec 13, 2023
1999e21
Decouple pre decommission job
chadell Dec 14, 2023
8a3f890
use callable
chadell Dec 14, 2023
59ea087
generalize hook
chadell Dec 15, 2023
d106fa7
wip
chadell Dec 15, 2023
ca01bd0
wip
chadell Dec 18, 2023
0962021
fix: Fixed test failures.
abates Dec 18, 2023
08aba58
refactor: JournalEntry can now be reverted.
abates Dec 19, 2023
ea007da
fix tests
chadell Dec 19, 2023
0121d1b
fix dict logic
chadell Dec 19, 2023
11eea60
docs: Documented why refreshing `design_object` is necessary
abates Dec 19, 2023
a17cf92
refactor: Refactored revert code into `Journal` model
abates Dec 19, 2023
c8b7faf
docs: Updated branding from `plugin` to `app`
abates Jan 2, 2024
8333422
Merge branch 'osrb' into feature_delices_decom_job
abates Jan 2, 2024
92ee1ed
refactor: Refactored decom code to model and hooks to signals
abates Jan 2, 2024
f1fe686
style: Autoformatting
abates Jan 2, 2024
2132ac9
Add l3vpn design example
chadell Jan 2, 2024
63ea09f
fix old dict value null
chadell Jan 2, 2024
5efb783
Merge branch 'feature_delices_decom_job' of github.com:networktocode-…
chadell Jan 2, 2024
f911eec
refactor: Minor refactoring of `JournalEntry` revert and the model it…
abates Jan 2, 2024
42e4e19
fix tests
chadell Jan 3, 2024
d8ad207
update the l3vppn example and add a hook to validate input data
chadell Jan 3, 2024
fbad8f5
bump version
chadell Jan 3, 2024
9bf5ff4
avoid overwrite of method
chadell Jan 3, 2024
1d665ea
clean up some leftovers
chadell Jan 3, 2024
ccdd49f
Missing part of previous commit
chadell Jan 3, 2024
4513c5e
Rename variables for consistency
chadell Jan 3, 2024
192874f
fix: Fixed extra `{% endmacro %}` that got added at some point.
abates Jan 3, 2024
b39a54f
fix: Now logging the design instance and journal objects.
abates Jan 3, 2024
1cc2184
Adjust test with warning, improve logging plus journalentry retrieve …
chadell Jan 4, 2024
358390c
adjust logging
chadell Jan 4, 2024
4aabdce
mre info
chadell Jan 4, 2024
31de2a4
fix exception chain
chadell Jan 4, 2024
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
26 changes: 11 additions & 15 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@
"codeowner_github_usernames": "@abates @mzbroch",
"full_name": "Network to Code, LLC",
"email": "[email protected]",
"github_org": "networktocode-llc",
"plugin_name": "design_builder",
"verbose_name": "Design Builder",
"plugin_slug": "design-builder",
"github_org": "nautobot",
"plugin_name": "nautobot_design_builder",
"verbose_name": "Nautobot Design Builder",
"plugin_slug": "nautobot-design-builder",
"project_slug": "nautobot-plugin-design-builder",
"repo_url": "https://github.com/networktocode-llc/nautobot-plugin-design-builder",
"repo_url": "https://github.com/nautobot/nautobot-plugin-design-builder",
"base_url": "design-builder",
"min_nautobot_version": "1.2.0",
"min_nautobot_version": "1.6.0",
"max_nautobot_version": "1.9999",
"nautobot_version": "latest",
"camel_name": "DesignBuilder",
"project_short_description": "A plugin that uses design templates to easily create data objects in Nautobot with minimal input from a user.",
"version": "0.1.0",
"camel_name": "NautobotDesignBuilder",
"project_short_description": "A Nautobot App that uses design templates to easily create data objects in Nautobot with minimal input from a user.",
"model_class_name": "None",
"open_source_license": "Not open source",
"open_source_license": "Apache-2.0",
"docs_base_url": "https://docs.nautobot.com",
"docs_app_url": "https://docs.nautobot.com/projects/design-builder/en/latest",
"_template": "cookiecutter-ntc/nautobot-plugin",
"_output_dir": "/Users/abates/local/devel"
"docs_app_url": "https://docs.nautobot.com/projects/design-builder/en/latest"
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
lcov.info

# Translations
*.mo
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<p align="center">
<img src="/docs/images/icon-design-builder.png" class="logo" height="200px">
<br>
<a href="https://github.com/networktocode-llc/nautobot-plugin-design-builder/actions"><img src="https://github.com/networktocode-llc/nautobot-plugin-design-builder/actions/workflows/ci.yml/badge.svg?branch=main"></a>
<a href="https://docs.nautobot.com/projects/design-builder/en/latest"><img src="https://readthedocs.org/projects/nautobot-plugin-design-builder/badge/"></a>
<a href="https://github.com/nautobot/nautobot-app-design-builder/actions"><img src="https://github.com/nautobot/nautobot-app-design-builder/actions/workflows/ci.yml/badge.svg?branch=main"></a>
<a href="https://docs.nautobot.com/projects/design-builder/en/latest"><img src="https://readthedocs.org/projects/nautobot-app-design-builder/badge/"></a>
<a href="https://pypi.org/project/design-builder/"><img src="https://img.shields.io/pypi/v/design-builder"></a>
<a href="https://pypi.org/project/design-builder/"><img src="https://img.shields.io/pypi/dm/design-builder"></a>
<br>
Expand All @@ -27,7 +27,7 @@ Full documentation for this App can be found over on the [Nautobot Docs](https:/

### Contributing to the Documentation

You can find all the Markdown source for the App documentation under the [`docs`](https://github.com/networktocode-llc/nautobot-plugin-design-builder/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.
You can find all the Markdown source for the App documentation under the [`docs`](https://github.com/nautobot/nautobot-app-design-builder/tree/develop/docs) folder in this repository. For simple edits, a Markdown capable editor is sufficient: clone the repository and edit away.

If you need to view the fully-generated documentation site, you can build it with [MkDocs](https://www.mkdocs.org/). A container hosting the documentation can be started using the `invoke` commands (details in the [Development Environment Guide](https://docs.nautobot.com/projects/design-builder/en/latest/dev/dev_environment/#docker-development-environment)) on [http://localhost:8001](http://localhost:8001). Using this container, as your changes to the documentation are saved, they will be automatically rebuilt and any pages currently being viewed will be reloaded in your browser.

Expand Down
2 changes: 1 addition & 1 deletion development/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NAUTOBOT_VER="1.0.1"
ARG NAUTOBOT_VER="1.6"
ARG PYTHON_VER=3.8
FROM ghcr.io/nautobot/nautobot-dev:${NAUTOBOT_VER}-py${PYTHON_VER}

Expand Down
13 changes: 0 additions & 13 deletions development/Dockerfile.git-server

This file was deleted.

6 changes: 0 additions & 6 deletions development/development.env
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,3 @@ POSTGRES_DB=${NAUTOBOT_DB_NAME}
MYSQL_USER=${NAUTOBOT_DB_USER}
MYSQL_DATABASE=${NAUTOBOT_DB_NAME}
MYSQL_ROOT_HOST=%

# This needs to match the slug for the desired config context repo design builder will use
DESIGN_BUILDER_GIT_SERVER=http://git-server.local:3000
DESIGN_BUILDER_CONTEXT_REPO_SLUG=config-contexts
DESIGN_BUILDER_CONTEXT_REPO=config-contexts.git
DESIGN_BUILDER_DESIGN_REPO=designs.git
13 changes: 0 additions & 13 deletions development/docker-compose.git-server.yml

This file was deleted.

39 changes: 0 additions & 39 deletions development/git-entrypoint.sh

This file was deleted.

12 changes: 11 additions & 1 deletion development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@
if nautobot_version < Version("2.0"):
PLUGINS.append("nautobot_bgp_models")

PLUGINS_CONFIG = {"design_builder": {"context_repository": os.getenv("DESIGN_BUILDER_CONTEXT_REPO_SLUG", None)}}

def pre_decommission_hook_example(design_instance):
return True, "Everything good!"


PLUGINS_CONFIG = {
"nautobot_design_builder": {
"context_repository": os.getenv("DESIGN_BUILDER_CONTEXT_REPO_SLUG", None),
"pre_decommission_hook": pre_decommission_hook_example,
}
}

STRICT_FILTERING = False
7 changes: 1 addition & 6 deletions docs/admin/compatibility_matrix.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Compatibility Matrix

!!! warning "Developer Note - Remove Me!"
Explain how the release models of the plugin and of Nautobot work together, how releases are supported, how features and older releases are deprecated etc.

| Design Builder Version | Nautobot First Support Version | Nautobot Last Support Version |
| ------------- | -------------------- | ------------- |
| 1.0.X | 1.2.0 | 1.99.99 |
| 1.1.X | 1.4.0 | 1.99.99 |
| 1.2.X | 2.0.0 | 2.99.99 |
| 1.0.X | 1.6.0 | 2.0.X |
37 changes: 10 additions & 27 deletions docs/admin/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,46 @@

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

!!! warning "Developer Note - Remove Me!"
Detailed instructions on installing the App. You will need to update this section based on any additional dependencies or prerequisites.

## Prerequisites

- The plugin is compatible with Nautobot 1.2.0 and higher.
- The plugin is compatible with Nautobot 1.6.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

!!! warning "Developer Note - Remove Me!"
What external systems (if any) it needs access to in order to work.
Design Builder does not necessarily require any external system access. However, if design jobs will be loaded from a git repository, then the Nautobot instances will need access to the git repo.

## 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 [`design-builder`](https://pypi.org/project/design-builder/).
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-design-builder`](https://pypi.org/project/nautobot/design-builder/).

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

```shell
pip install design-builder
pip install nautobot-design-builder
```

To ensure Design Builder is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `design-builder` package:
To ensure Design Builder is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `nautobot-design-builder` package:

```shell
echo design-builder >> local_requirements.txt
echo nautobot-design-builder >> 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:

- Append `"design_builder"` to the `PLUGINS` list.
- Append the `"design_builder"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults.
- Append `"nautobot_design_builder"` to the `PLUGINS` list.
- Append the `"nautobot_design_builder"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults.

```python
# In your nautobot_config.py
PLUGINS = ["design_builder"]
PLUGINS = ["nautobot_design_builder"]

# PLUGINS_CONFIG = {
# "design_builder": {
# "nautobot_design_builder": {
# ADD YOUR SETTINGS HERE
# }
# }
Expand All @@ -66,16 +62,3 @@ Then restart (if necessary) the Nautobot services which may include:
```shell
sudo systemctl restart nautobot nautobot-worker nautobot-scheduler
```

## App Configuration

!!! warning "Developer Note - Remove Me!"
Any configuration required to get the App set up. Edit the table below as per the examples provided.

The plugin behavior can be controlled with the following list of settings:

| Key | Example | Default | Description |
| ------- | ------ | -------- | ------------------------------------- |
| `enable_backup` | `True` | `True` | A boolean to represent whether or not to run backup configurations within the plugin. |
| `platform_slug_map` | `{"cisco_wlc": "cisco_aireos"}` | `None` | A dictionary in which the key is the platform slug and the value is what netutils uses in any "network_os" parameter. |
| `per_feature_bar_width` | `0.15` | `0.15` | The width of the table bar within the overview report |
43 changes: 3 additions & 40 deletions docs/admin/release_notes/version_1.0.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,11 @@
# v1.0 Release Notes

!!! warning "Developer Note - Remove Me!"
Guiding Principles:

- Changelogs are for humans, not machines.
- There should be an entry for every single version.
- The same types of changes should be grouped.
- Versions and sections should be linkable.
- The latest version comes first.
- The release date of each version is displayed.
- Mention whether you follow Semantic Versioning.

Types of changes:

- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.


This document describes all new features and changes in the release `1.0`. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Release Overview

- Major features or milestones
- Achieved in this `x.y` release
- Changes to compatibility with Nautobot and/or other plugins, libraries etc.

## [v1.0.1] - 2021-09-08

### Added

### Changed

### Fixed

- [#123](https://github.com/networktocode-llc/nautobot-plugin-design-builder/issues/123) Fixed Tag filtering not working in job launch form

## [v1.0.0] - 2021-08-03

### Added
Initial Public Release

### Changed
## [v1.0.0] - 2023-11-01

### Fixed
Initial Public Release
10 changes: 2 additions & 8 deletions docs/admin/uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ Here you will find any steps necessary to cleanly remove the App from your Nauto

## Uninstall Guide

!!! warning "Developer Note - Remove Me!"
Detailed instructions on how to remove the app from Nautobot.

Remove the configuration you added in `nautobot_config.py` from `PLUGINS` & `PLUGINS_CONFIG`.
Remove the `DESIN_BUILDER` section that was added to `nautobot_config.py` `PLUGINS` & `PLUGINS_CONFIG`.

## Database Cleanup

!!! warning "Developer Note - Remove Me!"
Any cleanup operations to ensure the database is clean after the app is removed. Beyond deleting tables, is there anything else that needs cleaning up, such as CFs, relationships, etc. if they're no longer desired?

Drop all tables from the plugin: `nautobot_plugin_design_builder*`.
The current version of Design Builder does not include any database models, so no database cleanup is necessary.
7 changes: 4 additions & 3 deletions docs/admin/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Here you will find any steps necessary to upgrade the App in your Nautobot envir

## Upgrade Guide

!!! warning "Developer Note - Remove Me!"
Add more detailed steps on how the app is upgraded in an existing Nautobot setup and any version specifics (such as upgrading between major versions with breaking changes).
Since Design Builder does not currently include any custom data models the only requirement for updating is to update the `nautobot-design-builder` package using the `pip` command:

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 post-upgrade` within the runtime environment of your Nautobot installation after updating the `design-builder` package via `pip`.
```python
pip install --upgrade nautobot-design-builder
```
18 changes: 14 additions & 4 deletions docs/dev/contributing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Contributing to the App

Contributions are encouraged and we are always delighted in any form of work. We are always looking for feedback both in the development of code as well as documentation, use cases, and examples. To contribute to this project, please use the following guidlines:

## Code Development

The project is packaged with a light [development environment](dev_environment.md) based on `docker-compose` to help with the local development of the project and to run tests.

The project is following Network to Code software development guidelines and is leveraging the following:
Expand All @@ -10,12 +14,18 @@ The project is following Network to Code software development guidelines and is

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.

## Documentation

Code documentation follows the [Google docstring](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) style. Where possible, include a description, argument documentation and examples.

The user and developer documentation is located in the top level `docs/` directory. The documenation is written in markdown format and is rendered using MkDocs.

Example designs should be placed in the top level `examples/` directory, as appropriate.

## Branching Policy

!!! warning "Developer Note - Remove Me!"
What branching policy is used for this project and where contributions should be made.
The active branch in Design Builder is the `develop` branch. However, commits are not allowed directly to this branch. Instead, fork the code and open a pull request to `develop`.

## Release Policy

!!! warning "Developer Note - Remove Me!"
How new versions are released.
There is no set release schedule for this App. New releases will be published as appropriate when new features and/or bug fixes are ready.
1 change: 1 addition & 0 deletions docs/user/app_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The easiest way to experience Design Builder is to run it in a local environment
## What are the next steps?

The Design Builder application ships with some sample designs to demonstrate capabilities. Once the application stack is ready, you should have two designs listed under the "Jobs" -> "Jobs" menu item.

![Jobs list](../images/screenshots/sample-design-jobs-list.png)

Note that both jobs are disabled. Nautobot automatically marks jobs as disabled when they are first loaded. In order to run these jobs, click the edit button ![edit button](../images/screenshots/edit-button.png) and check the "enabled" checkbox:
Expand Down
2 changes: 2 additions & 0 deletions docs/user/app_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This document provides an overview of the App including critical information and

## Description

Design Builder provides a system where standardized network designs can be developed to produce collections of objects within Nautobot. These designs are text based templates that can create and update hierarchical data structures within Nautobot.

## Audience (User Personas) - Who should use this App?

- Network engineers who want to have reproducible sets of Nautobot objects based on some standard design.
Expand Down
Loading
Loading