Skip to content

Commit

Permalink
Merge pull request #536 from nautobot/release-3.1.0
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
jdrew82 authored Sep 6, 2024
2 parents 6effda8 + bc8e850 commit 7709b45
Show file tree
Hide file tree
Showing 26 changed files with 509 additions and 145 deletions.
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.3.0",
"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": "edf831ea98364f9a475ef147f13c1fb2f17b825f"
"baked_commit_ref": "022954d51f46c54813d3c8c81584a16f0faea1f5"
}
}
}
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
APP_NAME: "nautobot-app-ssot"
APP_NAME: "nautobot-ssot"

jobs:
ruff-format:
Expand Down Expand Up @@ -91,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_SSOT_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 @@ -108,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 @@ -122,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.2.1"
- python-version: "3.11"
- python-version: "3.12"
db-backend: "mysql"
nautobot-version: "stable"
runs-on: "ubuntu-22.04"
Expand Down Expand Up @@ -158,6 +163,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 @@ -195,7 +201,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 @@ -230,7 +236,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
1 change: 1 addition & 0 deletions changes/536.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cut release for 3.1.0
1 change: 0 additions & 1 deletion changes/562.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
4 changes: 3 additions & 1 deletion development/app_config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def _main():
**SchemaBuilder().to_json_schema(app_config), # type: ignore
}
app_config = import_module(package_name).config
_enrich_object_schema(schema, app_config.default_settings, app_config.required_settings)
_enrich_object_schema(
schema, app_config.default_settings, app_config.required_settings
)
schema_path.write_text(json.dumps(schema, indent=4) + "\n")
print(f"\n==================\nGenerated schema:\n\n{schema_path}\n")
print(
Expand Down
12 changes: 9 additions & 3 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@

if "debug_toolbar" not in INSTALLED_APPS: # noqa: F405
INSTALLED_APPS.append("debug_toolbar") # noqa: F405
if "debug_toolbar.middleware.DebugToolbarMiddleware" not in MIDDLEWARE: # noqa: F405
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware") # noqa: F405
if (
"debug_toolbar.middleware.DebugToolbarMiddleware" not in MIDDLEWARE
): # noqa: F405
MIDDLEWARE.insert(
0, "debug_toolbar.middleware.DebugToolbarMiddleware"
) # noqa: F405

#
# Misc. settings
Expand Down Expand Up @@ -51,7 +55,9 @@
"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
27 changes: 14 additions & 13 deletions docs/admin/compatibility_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ While that last supported version will not be strictly enforced--via the max_ver
| 2.0.0-beta.2 | 2.0.0b2 | 2.0.0b2 |
| 2.0.0-rc.1 | 2.0.0rc1 | 2.0.0rc1 |
| 2.0.0-rc.2 | 2.0.0rc2 | 2.0.0rc99 |
| 2.0.0 | 2.0.0 | 2.99.09 |
| 2.0.1 | 2.0.0 | 2.99.09 |
| 2.0.2 | 2.0.0 | 2.99.09 |
| 2.1.0 | 2.0.0 | 2.99.09 |
| 2.2.0 | 2.0.0 | 2.99.09 |
| 2.3.0 | 2.1.0 | 2.99.09 |
| 2.4.0 | 2.1.0 | 2.99.09 |
| 2.5.0 | 2.1.0 | 2.99.09 |
| 2.6.0 | 2.1.0 | 2.99.09 |
| 2.7.0 | 2.1.0 | 2.99.09 |
| 2.8.0 | 2.1.0 | 2.99.09 |
| 3.0.0 | 2.1.0 | 2.99.09 |
| 3.0.1 | 2.1.0 | 2.99.09 |
| 2.0.0 | 2.0.0 | 2.99.99 |
| 2.0.1 | 2.0.0 | 2.99.99 |
| 2.0.2 | 2.0.0 | 2.99.99 |
| 2.1.0 | 2.0.0 | 2.99.99 |
| 2.2.0 | 2.0.0 | 2.99.99 |
| 2.3.0 | 2.1.0 | 2.99.99 |
| 2.4.0 | 2.1.0 | 2.99.99 |
| 2.5.0 | 2.1.0 | 2.99.99 |
| 2.6.0 | 2.1.0 | 2.99.99 |
| 2.7.0 | 2.1.0 | 2.99.99 |
| 2.8.0 | 2.1.0 | 2.99.99 |
| 3.0.0 | 2.1.0 | 2.99.99 |
| 3.0.1 | 2.1.0 | 2.99.99 |
| 3.1.0 | 2.1.0 | 2.99.99 |
14 changes: 13 additions & 1 deletion docs/admin/integrations/infoblox_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ pip install nautobot-ssot[infoblox]
!!! note
Legacy configuration settings defined in the `nautobot_config.py` and environmental variables are deprecated. These settings are migrated on a best-effort basis on the first startup following migration to the Nautobot SSOT 2.7.0 or higher.

Integration configuration is defined in the instance of the `SSOTInfobloxConfig` model. Multiple configuration instances are supported. Synchronization jobs take the `Config` parameter which specifies the configuration instance to use.
The integration with Infoblox utilizes [External Integrations](https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/externalintegration/?h=external) to specify your Infoblox host information. To enable this integration, the only modification needed is to activate it in the nautobot_config.py file.

Below is an example snippet from `nautobot_config.py` that demonstrates how to enable the Infoblox integration:

```python
PLUGINS_CONFIG = {
"nautobot_ssot": {
"enable_infoblox": True,
}
}
```

The remaining integration configuration is defined in the instance of the `SSOTInfobloxConfig` model. Multiple configuration instances are supported. Synchronization jobs take the `Config` parameter which specifies the configuration instance to use.

To access integration configuration navigate to `Apps -> Installed Apps` and click on the cog icon in the `Single Source of Truth` entry. Then in the table `SSOT Integration Configs` click on the `Infoblox Configuration List` link. This will take you to the view where you can view/modify existing config instances or create new ones.

Expand Down
27 changes: 27 additions & 0 deletions docs/admin/release_notes/version_3.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

## [v3.1.0 (2024-09-06)](https://github.com/nautobot/nautobot-app-ssot/releases/tag/v3.1.0)

### Added

- [#527](https://github.com/nautobot/nautobot-app-ssot/issues/527) - Added Python 3.12 support.
- [#528](https://github.com/nautobot/nautobot-app-ssot/issues/528) - Added DNA Center integration to _MIN_NAUTOBOT_VERSION as it requires Nautobot 2.2 for Controller object.

### Changed

- [#526](https://github.com/nautobot/nautobot-app-ssot/issues/526) - Updated the ExampleDataSource job to improve memory utilization with large data sets.
- [#526](https://github.com/nautobot/nautobot-app-ssot/issues/526) - Changed memory profiling logging output to format bytes into KiB/MiB.

### Fixed

- [#521](https://github.com/nautobot/nautobot-app-ssot/issues/521) - Fixed generalized Exception with SecretsGroup and add custom Exception in case SecretsGroup not found on ExternalIntegration.
- [#528](https://github.com/nautobot/nautobot-app-ssot/issues/528) - Fixed bug preventing use of Nautobot 2.1 due to ACI requiring 2.2.
- [#528](https://github.com/nautobot/nautobot-app-ssot/issues/528) - Fixed JobResult association to Sync object to CASCADE instead of PROTECT so Sync object is deleted when JobResult is instead of preventing deletion.
- [#530](https://github.com/nautobot/nautobot-app-ssot/issues/530) - Fixed Infoblox Configuration List Bug when on Nautobot 2.3 by disabling SSOTInfobloxConfig from being a saved view.

### Documentation

- [#520](https://github.com/nautobot/nautobot-app-ssot/issues/520) - Added instructions for enabling Infoblox integration.

### Housekeeping

- [#527](https://github.com/nautobot/nautobot-app-ssot/issues/527) - Rebaked from the cookie 'nautobot-app-v2.3.2'.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ mkdocs-material==9.5.32
markdown-version-annotations==1.0.1
griffe==1.1.1
mkdocstrings-python==1.10.8
mkdocstrings==0.25.2
mkdocstrings==0.25.2
19 changes: 11 additions & 8 deletions invoke.example.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
nautobot_ssot:
project_name: "nautobot-ssot"
nautobot_ver: "2.0.0"
local: false
python_ver: "3.11"
compose_dir: "development"
compose_files:
- "docker-compose.base.yml"
- "docker-compose.redis.yml"
- "docker-compose.postgres.yml"
- "docker-compose.dev.yml"
# local: false
# compose_dir: "/full/path/to/nautobot-app-ssot/development"

# The following is an example of using MySQL as the database backend
# ---
# nautobot_ssot:
# compose_files:
# - "docker-compose.base.yml"
# - "docker-compose.redis.yml"
# - "docker-compose.mysql.yml"
# - "docker-compose.dev.yml"
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dev_addr: "127.0.0.1:8001"
edit_uri: "edit/main/nautobot-app-ssot/docs"
edit_uri: "edit/main/docs"
site_dir: "nautobot_ssot/static/nautobot_ssot/docs"
site_name: "Single Source of Truth Documentation"
site_url: "https://docs.nautobot.com/projects/ssot/en/latest/"
Expand Down Expand Up @@ -135,6 +135,7 @@ nav:
- Compatibility Matrix: "admin/compatibility_matrix.md"
- Release Notes:
- "admin/release_notes/index.md"
- v3.1: "admin/release_notes/version_3.1.md"
- v3.0: "admin/release_notes/version_3.0.md"
- v2.8: "admin/release_notes/version_2.8.md"
- v2.7: "admin/release_notes/version_2.7.md"
Expand Down
21 changes: 0 additions & 21 deletions nautobot_ssot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
from importlib import metadata

import packaging
from django.conf import settings
from nautobot.core.settings_funcs import is_truthy
from nautobot.extras.plugins import NautobotAppConfig
Expand All @@ -25,24 +24,6 @@
"nautobot_ssot_servicenow",
]

_MIN_NAUTOBOT_VERSION = {
"nautobot_ssot_aci": "2.2",
}


def _check_min_nautobot_version_met():
incompatible_apps_msg = []
nautobot_version = metadata.version("nautobot")
for app, nb_ver in _MIN_NAUTOBOT_VERSION.items():
if packaging.version.parse(nb_ver) > packaging.version.parse(nautobot_version):
incompatible_apps_msg.append(f"The `{app}` requires Nautobot version {nb_ver} or higher.\n")

if incompatible_apps_msg:
raise RuntimeError(
f"This version of Nautobot ({nautobot_version}) does not meet minimum requirements for the following apps:\n {''.join(incompatible_apps_msg)}."
"See: https://docs.nautobot.com/projects/ssot/en/latest/admin/upgrade/#potential-apps-conflicts"
)


def _check_for_conflicting_apps():
intersection = set(_CONFLICTING_APP_NAMES).intersection(set(settings.PLUGINS))
Expand All @@ -56,8 +37,6 @@ def _check_for_conflicting_apps():
if not is_truthy(os.getenv("NAUTOBOT_SSOT_ALLOW_CONFLICTING_APPS", "False")):
_check_for_conflicting_apps()

_check_min_nautobot_version_met()


class NautobotSSOTAppConfig(NautobotAppConfig):
"""App configuration for the nautobot_ssot app."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class InfobloxVLAN(Vlan):
"""Infoblox implementation of the VLAN Model."""


class InfobloxIPAddress(IPAddress):
class InfobloxIPAddress(IPAddress): # pylint: disable=too-many-instance-attributes
"""Infoblox implementation of the VLAN Model."""

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions nautobot_ssot/integrations/infoblox/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class SSOTInfobloxConfig(PrimaryModel): # pylint: disable=too-many-ancestors
"""SSOT Infoblox Configuration model."""

name = models.CharField(max_length=CHARFIELD_MAX_LENGTH, unique=True)
# TODO: Claify how saved views can be done for child apps
is_saved_view_model = False
description = models.CharField(
max_length=CHARFIELD_MAX_LENGTH,
blank=True,
Expand Down
2 changes: 1 addition & 1 deletion nautobot_ssot/integrations/itential/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ class Meta:
"""Meta class definition."""

model = models.AutomationGatewayModel
fields = ["name", "description", "location", "location_descendants", "gateway", "enabled"]
fields = "__all__"
Loading

0 comments on commit 7709b45

Please sign in to comment.