Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nautobot/nautobot-app-secrets-providers
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: develop
Choose a base ref
...
head repository: nautobot/nautobot-app-secrets-providers
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: drift-manager/baked
Choose a head ref

There isn’t anything to compare.

develop and drift-manager/baked are entirely different commit histories.

2 changes: 1 addition & 1 deletion .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "refs/tags/nautobot-app-v2.4.0",
"template_ref": "refs/tags/nautobot-app-v2.4.1",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
File renamed without changes.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
ruff-lint:
@@ -36,6 +38,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: ruff"
run: "poetry run invoke ruff --action lint"
check-docs-build:
@@ -47,6 +51,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
poetry:
@@ -58,6 +64,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Checking: poetry lock file"
run: "poetry run invoke lock --check"
yamllint:
@@ -69,6 +77,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
check-in-docker:
@@ -91,6 +101,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_SECRETS_PROVIDERS_LOCAL: "true"
@@ -146,6 +158,8 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Constrain Nautobot version and regenerate lock file"
env:
INVOKE_NAUTOBOT_SECRETS_PROVIDERS_LOCAL: "true"
@@ -187,6 +201,8 @@ jobs:
fetch-depth: "0"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
with:
poetry-version: "1.8.5"
- name: "Check for changelog entry"
run: |
git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache Software License 2.0

Copyright (c) 2024, Network to Code, LLC
Copyright (c) 2025, 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.
6 changes: 4 additions & 2 deletions development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -45,10 +45,12 @@ services:
volumes:
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py"
- "../:/source"
# To expose postgres or redis to the host uncomment the following
# postgres:
# To expose postgres (5432), myql (3306) on db service or redis (6379) to the host uncomment the
# following. Ensure to match the 2 idented spaces which to have the service nested under services.
# db:
# ports:
# - "5432:5432"
# - "3306:3306"
# redis:
# ports:
# - "6379:6379"
7 changes: 7 additions & 0 deletions development/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,13 @@ services:
- "development.env"
- "creds.env"
- "development_mysql.env"
beat:
environment:
- "NAUTOBOT_DB_ENGINE=django.db.backends.mysql"
env_file:
- "development.env"
- "creds.env"
- "development_mysql.env"
db:
image: "mysql:8"
command:
14 changes: 3 additions & 11 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import sys

from nautobot.core.settings import * # noqa: F403 # pylint: disable=wildcard-import,unused-wildcard-import
from nautobot.core.settings_funcs import is_truthy, parse_redis_connection
from nautobot.core.settings_funcs import is_truthy

#
# Debug
@@ -64,16 +64,8 @@
#

# The django-redis cache is used to establish concurrent locks using Redis.
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": parse_redis_connection(redis_database=0),
"TIMEOUT": 300,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}
# Inherited from nautobot.core.settings
# CACHES = {....}

#
# Celery settings are not defined here because they can be overloaded with
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -121,6 +121,7 @@ nav:
- Extending the App: "dev/extending.md"
- Contributing to the App: "dev/contributing.md"
- Development Environment: "dev/dev_environment.md"
- Release Checklist: "dev/release_checklist.md"
- Architecture Decision Records: "dev/arch_decision.md"
- Code Reference:
- "dev/code_reference/index.md"
23 changes: 23 additions & 0 deletions nautobot_secrets_providers/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Django urlpatterns declaration for nautobot_secrets_providers app."""

from django.templatetags.static import static
from django.urls import path
from django.views.generic import RedirectView
from nautobot.apps.urls import NautobotUIViewSetRouter


# Uncomment the following line if you have views to import
# from nautobot_secrets_providers import views


router = NautobotUIViewSetRouter()

# Here is an example of how to register a viewset, you will want to replace views.NautobotSecretsProvidersUIViewSet with your viewset
# router.register("nautobot_secrets_providers", views.NautobotSecretsProvidersUIViewSet)


urlpatterns = [
path("docs/", RedirectView.as_view(url=static("nautobot_secrets_providers/docs/index.html")), name="docs"),
]

urlpatterns += router.urls
28 changes: 17 additions & 11 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ def docker_compose(context, command, **kwargs):
return context.run(compose_command, env=build_env, **kwargs)


def run_command(context, command, **kwargs):
def run_command(context, command, service="nautobot", **kwargs):
"""Wrapper to run a command locally or inside the nautobot container."""
if is_truthy(context.nautobot_secrets_providers.local):
if "command_env" in kwargs:
@@ -159,7 +159,7 @@ def run_command(context, command, **kwargs):
}
return context.run(command, **kwargs)
else:
# Check if nautobot is running, no need to start another nautobot container to run a command
# Check if service is running, no need to start another container to run a command
docker_compose_status = "ps --services --filter status=running"
results = docker_compose(context, docker_compose_status, hide="out")

@@ -169,10 +169,10 @@ def run_command(context, command, **kwargs):
for key, value in command_env.items():
command_env_args += f' --env="{key}={value}"'

if "nautobot" in results.stdout:
compose_command = f"exec{command_env_args} nautobot {command}"
if service in results.stdout:
compose_command = f"exec{command_env_args} {service} {command}"
else:
compose_command = f"run{command_env_args} --rm --entrypoint='{command}' nautobot"
compose_command = f"run{command_env_args} --rm --entrypoint='{command}' {service}"

pty = kwargs.pop("pty", True)

@@ -412,10 +412,14 @@ def shell_plus(context):
run_command(context, command)


@task
def cli(context):
"""Launch a bash shell inside the Nautobot container."""
run_command(context, "bash")
@task(
help={
"service": "Docker compose service name to launch cli in (default: nautobot).",
}
)
def cli(context, service="nautobot"):
"""Launch a bash shell inside the container."""
run_command(context, "bash", service=service)


@task(
@@ -732,7 +736,8 @@ def pylint(context):
else:
print("No migrations directory found, skipping migrations checks.")

raise Exit(code=exit_code)
if exit_code != 0:
raise Exit(code=exit_code)


@task(aliases=("a",))
@@ -776,7 +781,8 @@ def ruff(context, action=None, target=None, fix=False, output_format="concise"):
if not run_command(context, command, warn=True):
exit_code = 1

raise Exit(code=exit_code)
if exit_code != 0:
raise Exit(code=exit_code)


@task