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

Release v3.1.0 #329

Merged
merged 26 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1b4a53d
Update Account Link docs to refer to fallback_chatops_user option
itdependsnetworks Apr 14, 2024
adc0bf6
Save changelog fragment
itdependsnetworks Apr 14, 2024
0982e15
add back link
itdependsnetworks Apr 14, 2024
7c92fc0
Pin Meraki to <=1.45.0
smk4664 Jun 13, 2024
f8722a5
Add change fragment
smk4664 Jun 13, 2024
82a42ed
Update 314.dependencies
smk4664 Jun 13, 2024
06e3d84
Add reversible migration
smk4664 Jun 13, 2024
e9917ae
Update docker-compose.mysql.yml
smk4664 Jun 13, 2024
0d7bc3b
Merge pull request #311 from itdependsnetworks/update-docs
smk4664 Jun 13, 2024
15cdf56
Add Meraki minimum version
smk4664 Jun 14, 2024
f239265
Merge pull request #315 from nautobot/pin-meraki
smk4664 Jun 14, 2024
2b84d28
Merge branch 'develop' into grafana-0005-reversable
smk4664 Jun 14, 2024
a9b80af
Merge pull request #316 from nautobot/grafana-0005-reversable
smk4664 Jun 14, 2024
6fb942d
Updates for activating docs link.
jvanderaa Jun 28, 2024
8f6b03d
Merge pull request #320 from nautobot/update_docs_link
smk4664 Jul 30, 2024
34e9dbe
Cookie updated by NetworkToCode Cookie Drift Manager Tool
Aug 8, 2024
02c8bbd
Fix Ruff errors
smk4664 Aug 9, 2024
832cbb6
Finish removing Bandit
smk4664 Aug 9, 2024
6e7b625
Revert unwanted changes.
smk4664 Aug 9, 2024
a9782d2
Merge pull request #321 from nautobot/drift-manager/pr
smk4664 Aug 12, 2024
cccd88f
add dev experience with bot framework emulator (#169)
jeffkala Aug 14, 2024
ec8bfb2
Migrate IPFabric SSoT Command (#318)
jdrew82 Aug 21, 2024
42f578e
Cookie updated by NetworkToCode Cookie Drift Manager Tool (#325)
nautobot-bot Sep 13, 2024
a1e8f37
IP Fabric Pydantic v2 (#313)
jjeff07 Sep 30, 2024
bb9f256
Fix slack send files (#328)
smk4664 Sep 30, 2024
8319ecd
Release v3.1.0
smk4664 Sep 30, 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
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.2",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": [
"black"
],
"draft": true,
"baked_commit_ref": "cfd9475f3ea601572d0f3b23d4bb6d9655bc2721"
"baked_commit_ref": "81d2070deb685f72fb02bf7f73be007d37ce3376"
}
}
}
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
56 changes: 21 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
APP_NAME: "nautobot-app-chatops"
APP_NAME: "nautobot-chatops"

jobs:
black:
ruff-format:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_CHATOPS_LOCAL: "True"
Expand All @@ -25,20 +25,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_CHATOPS_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_CHATOPS_LOCAL: "True"
Expand All @@ -60,17 +49,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_CHATOPS_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 @@ -95,12 +73,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 All @@ -115,6 +91,10 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_CHATOPS_LOCAL: "true"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v3"
Expand All @@ -132,6 +112,7 @@ jobs:
build-args: |
NAUTOBOT_VER=${{ matrix.nautobot-version }}
PYTHON_VER=${{ matrix.python-version }}
CI=true
- name: "Copy credentials"
run: "cp development/creds.example.env development/creds.env"
- name: "Linting: pylint"
Expand All @@ -146,14 +127,14 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
db-backend: ["postgresql"]
nautobot-version: ["stable"]
include:
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "2.0.0"
- python-version: "3.11"
- python-version: "3.12"
db-backend: "mysql"
nautobot-version: "stable"
runs-on: "ubuntu-22.04"
Expand All @@ -165,6 +146,10 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_CHATOPS_LOCAL: "true"
run: "poetry run invoke lock --constrain-nautobot-ver --constrain-python-ver"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v3"
Expand All @@ -182,6 +167,7 @@ jobs:
build-args: |
NAUTOBOT_VER=${{ matrix.nautobot-version }}
PYTHON_VER=${{ matrix.python-version }}
CI=true
- name: "Copy credentials"
run: "cp development/creds.example.env development/creds.env"
- name: "Use Mysql invoke settings when needed"
Expand Down Expand Up @@ -219,7 +205,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down Expand Up @@ -254,7 +240,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down
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-chatops/"><img src="https://img.shields.io/pypi/v/nautobot-chatops"></a>
<a href="https://pypi.org/project/nautobot-chatops/"><img src="https://img.shields.io/pypi/dm/nautobot-chatops"></a>
<br>
A multi-platform ChatOps bot <a href="https://www.networktocode.com/nautobot/apps/">App</a> for <a href="https://nautobot.com/">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: 0 additions & 1 deletion changes/309.housekeeping

This file was deleted.

31 changes: 10 additions & 21 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,18 @@ RUN which poetry || curl -sSL https://install.python-poetry.org | python3 - && \
WORKDIR /source
COPY . /source

# Get container's installed Nautobot version as a forced constraint
# NAUTOBOT_VER may be a branch name and not a published release therefor we need to get the installed version
# so pip can use it to recognize local constraints.
RUN pip show nautobot | grep "^Version: " | sed -e 's/Version: /nautobot==/' > constraints.txt
# Build args must be declared in each stage
ARG PYTHON_VER

# Use Poetry to grab dev dependencies from the lock file
# Can be improved in Poetry 1.2 which allows `poetry install --only dev`
#
# We can't use the entire freeze as it takes forever to resolve with rigidly fixed non-direct dependencies,
# especially those that are only direct to Nautobot but the container included versions slightly mismatch
RUN poetry export -f requirements.txt --without-hashes --extras all --output poetry_freeze_base.txt
RUN poetry export -f requirements.txt --without-hashes --extras all --with dev --output poetry_freeze_all.txt
RUN sort poetry_freeze_base.txt poetry_freeze_all.txt | uniq -u > poetry_freeze_dev.txt

# Install all local project as editable, constrained on Nautobot version, to get any additional
# direct dependencies of the app
RUN --mount=type=cache,target="/root/.cache/pip",sharing=locked \
pip install -c constraints.txt -e .[all]
# Constrain the Nautobot version to NAUTOBOT_VER
# In CI, this should be done outside of the Dockerfile to prevent cross-compile build failures
ARG CI
RUN if [ -z "${CI+x}" ]; then \
INSTALLED_NAUTOBOT_VER=$(pip show nautobot | grep "^Version" | sed "s/Version: //"); \
poetry add --lock nautobot@${INSTALLED_NAUTOBOT_VER} --python ${PYTHON_VER}; fi

# Install any dev dependencies frozen from Poetry
# Can be improved in Poetry 1.2 which allows `poetry install --only dev`
RUN --mount=type=cache,target="/root/.cache/pip",sharing=locked \
pip install -c constraints.txt -r poetry_freeze_dev.txt
# Install the app
RUN poetry install --extras all --with dev

COPY development/nautobot_config.py ${NAUTOBOT_ROOT}/nautobot_config.py
# !!! USE CAUTION WHEN MODIFYING LINES ABOVE
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
11 changes: 11 additions & 0 deletions development/docker-compose.bot-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# If Bot Framework is running on the same host machine and Ngrok is not configured in Bot Framework for tunneling,
# it will tell nautobot that it is running on http://localhost:55550 (this port number can be different). The port
# that Bot Framework utilizes is displayed in the Bot Framework Emulator Connection Monitor
services:
nautobot:
extra_hosts:
- "localhost:host-gateway" # Allow Nautobot to communicate with the Bot Framework Emulator running on the host machine.
worker:
extra_hosts:
- "localhost:host-gateway" # Allow Nautobot to communicate with the Bot Framework Emulator running on the host machine.
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
3 changes: 0 additions & 3 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 @@ -19,7 +17,6 @@ services:
db:
image: "mysql:8"
command:
- "--default-authentication-plugin=mysql_native_password"
- "--max_connections=1000"
env_file:
- "development.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
3 changes: 1 addition & 2 deletions development/docker-compose.socket.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
version: "3.8"
services:
socket:
image: "nautobot-chatops-plugin/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}"
image: "nautobot-chatops/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}"
env_file:
- "development.env"
- "creds.env"
Expand Down
1 change: 0 additions & 1 deletion development/mattermost/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ x-nautobot: &nautobot
environment:
NAUTOBOT_CHATOPS_ENABLE_MATTERMOST: "True"

version: "3.8"
services:
nautobot:
<<: *nautobot
Expand Down
9 changes: 4 additions & 5 deletions development/mattermost/nautobot_bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
"""Bootstrap script for Nautobot to allow Mattermost integration."""


import contextlib

from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist

from nautobot_chatops.models import (
AccessGrantTypeChoices,
PlatformChoices,
AccessGrant,
CommandToken,
AccessGrantTypeChoices,
ChatOpsAccountLink,
CommandToken,
PlatformChoices,
)


User = get_user_model()

for grant_type in AccessGrantTypeChoices.values():
Expand Down
10 changes: 6 additions & 4 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 @@ -171,7 +173,7 @@
"tower_password": os.getenv("NAUTOBOT_TOWER_PASSWORD"),
"tower_uri": os.getenv("NAUTOBOT_TOWER_URI"),
"tower_username": os.getenv("NAUTOBOT_TOWER_USERNAME"),
"tower_verify_ssl": is_truthy(os.getenv("NAUTOBOT_TOWER_VERIFY_SSL", True)),
"tower_verify_ssl": is_truthy(os.getenv("NAUTOBOT_TOWER_VERIFY_SSL", "true")),
# - Arista CloudVision ---------------
"enable_aristacv": is_truthy(os.getenv("NAUTOBOT_CHATOPS_ENABLE_ARISTACV")),
"aristacv_cvaas_url": os.environ.get("ARISTACV_CVAAS_URL"),
Expand Down
3 changes: 2 additions & 1 deletion docs/admin/compatibility_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ While that last supported version will not be strictly enforced via the `max_ver
| 1.10.X | 1.3.0 | 1.5.99 [Official] |
| 2.0.X | 1.5.4 | 1.6.99 [Official] |
| 2.1.X | 1.6.2 | 1.6.99 [Official] |
| 3.0.X | 2.0.0 | 2.2.99 [Official] |
| 3.0.X | 2.0.0 | 2.99.99 [Official] |
| 3.1.X | 2.0.0 | 2.99.99 [Official] |
22 changes: 11 additions & 11 deletions docs/admin/integrations/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ Create a top-level command named `grafana` in your enabled chat platform. For de

You must define the following values in your `nautobot_config.py` file:

| Configuration Setting | Mandatory? | Default | Notes | Available on Admin Config |
| --------------------- | ---------- | ------- | ----- | ------------------------- |
| `enable_grafana` | **Yes** | False | Enable Grafana integration. | Yes |
| `grafana_url` | **Yes** | | Base url that the Grafana application is hosted at. | No |
| `grafana_api_key` | **Yes** | | Found in `<grafana_url>/org/apikeys`. | No |
| `grafana_default_width` | | 0 | Grafana image width when rendered into the chat client. Default will render width dynamically. | No |
| `grafana_default_height` | | 0 | Grafana image height when rendered into the chat client. Default will render height dynamically. | No |
| `grafana_default_theme` | | dark | Theme color to use when generating rendered Grafana images. Options are [`dark`, `light`]. | No |
| `grafana_default_timespan` | | 0 | Timespan that data is collected on a panel in Grafana. Default action is to use the defined timespan in Grafana. | No |
| `grafana_org_id` | | 1 | Found in `<grafana_url>/admin/orgs`. | No |
| `grafana_default_tz` | | | Timezone in which the renderer will render charts and graphs in. | No |
| Configuration Setting | Mandatory? | Default | Notes | Available on Admin Config |
|----------------------------|------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| `enable_grafana` | **Yes** | False | Enable Grafana integration. | Yes |
| `grafana_url` | **Yes** | | Base url that the Grafana application is hosted at. | No |
| `grafana_api_key` | **Yes** | | Found in `<grafana_url>/org/apikeys`. | No |
| `grafana_default_width` | | 0 | Grafana image width when rendered into the chat client. Default will render width dynamically. | No |
| `grafana_default_height` | | 0 | Grafana image height when rendered into the chat client. Default will render height dynamically. | No |
| `grafana_default_theme` | | dark | Theme color to use when generating rendered Grafana images. Options are [`dark`, `light`]. | No |
| `grafana_default_timespan` | | 0 | Timespan that data is collected on a panel in Grafana. Default action is to use the defined timespan in Grafana. See [Pydanitc Docs](https://docs.pydantic.dev/2.6/api/standard_library_types/#datetimetimedelta). | No |
| `grafana_org_id` | | 1 | Found in `<grafana_url>/admin/orgs`. | No |
| `grafana_default_tz` | | | Timezone in which the renderer will render charts and graphs in. | No |

!!! note
Grafana API key only needs to have `Viewer` permissions assigned!
Expand Down
Loading