Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into fix_423
Browse files Browse the repository at this point in the history
  • Loading branch information
pugnacity committed Jan 7, 2025
2 parents d6ff930 + 7081a98 commit 1e8859e
Show file tree
Hide file tree
Showing 88 changed files with 4,979 additions and 3,488 deletions.
4 changes: 3 additions & 1 deletion .bandit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
skips: []
# No need to check for security issues in the test scripts!
exclude_dirs:
# No need to check for security issues in the test scripts!
- "./tests/"
# Ignore locally installed collection
- "./collections/"
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
default: "ubuntu-24.04"
type: string
python-version:
description: "The Python version to use"
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable
runs-on:
description: "The OS to run the job on"
required: false
default: "ubuntu-22.04"
default: "ubuntu-24.04"
type: string
full-integration:
description: "Run full integration tests"
Expand All @@ -30,8 +30,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -51,12 +51,12 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
nautobot-version:
- "2.3"
ansible-version:
- "2.16"
- "2.17"
- "2.18"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand All @@ -70,8 +70,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
nautobot-version:
- "2.0"
- "2.1"
Expand All @@ -80,6 +80,14 @@ jobs:
ansible-version:
- "2.16"
- "2.17"
- "2.18"
exclude:
- python-version: "3.12"
nautobot-version: "2.0"
- python-version: "3.12"
nautobot-version: "2.1"
- python-version: "3.12"
nautobot-version: "2.2"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: # yamllint disable

jobs:
lint:
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
Expand All @@ -15,13 +15,13 @@ jobs:
- name: "Linting"
run: "invoke lint"
unit:
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
env:
INVOKE_NAUTOBOT_ANSIBLE_PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand All @@ -39,8 +39,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
nautobot-version:
- "2.0"
- "2.1"
Expand All @@ -49,6 +49,14 @@ jobs:
ansible-version:
- "2.16"
- "2.17"
- "2.18"
exclude:
- python-version: "3.12"
nautobot-version: "2.0"
- python-version: "3.12"
nautobot-version: "2.1"
- python-version: "3.12"
nautobot-version: "2.2"
with:
python-version: "${{ matrix.python-version }}"
nautobot-version: "${{ matrix.nautobot-version }}"
Expand All @@ -57,15 +65,15 @@ jobs:
- "unit"
publish_github:
name: "Publish to GitHub"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Build the collection"
Expand All @@ -82,15 +90,15 @@ jobs:
- "integration"
publish_galaxy:
name: "Publish to Ansible Galaxy"
runs-on: "ubuntu-22.04"
runs-on: "ubuntu-24.04"
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.10"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install ansible-core"
- name: "Create the ansible.cfg file"
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version: 2

# Set the version of Python in the build environment.
build:
os: "ubuntu-22.04"
os: "ubuntu-24.04"
tools:
python: "3.10"
python: "3.11"
jobs:
post_install:
- "ansible-galaxy collection install . --force"
Expand Down
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# networktocode.nautobot Release Notes

v5.5.0
======

New Modules
-----------

- networktocode.nautobot.job_button - Creates or removes job buttons from Nautobot
- networktocode.nautobot.dynamic_group - Creates or removes dynamic groups from Nautobot
- networktocode.nautobot.static_group_association - Creates or removes static group associations from Nautobot
- networktocode.nautobot.metadata_type - Creates or removes metadata types from Nautobot
- networktocode.nautobot.metadata_choice - Creates or removes metadata choices from Nautobot
- networktocode.nautobot.object_metadata - Creates or removes object metadata from Nautobot

Minor Changes
-------------
- (#464) Added full support for caching to GraphQL Inventory plugin
- (#465) Changed `parent_location_type` to allow for explicit name attribute lookup

v5.4.0
======

New Modules
-----------

- networktocode.nautobot.cloud_account - Creates or removes cloud accounts from Nautobot
- networktocode.nautobot.cloud_network - Creates or removes cloud networks from Nautobot
- networktocode.nautobot.cloud_resource_type - Creates or removes cloud resource types from Nautobot
- networktocode.nautobot.cloud_service - Creates or removes cloud services from Nautobot
- networktocode.nautobot.cloud_service_network_assignment - Creates or removes cloud service network assignments from Nautobot
- networktocode.nautobot.cloud_network_prefix_assignment - Creates or removes cloud network prefix assignments from Nautobot
- networktocode.nautobot.module - Creates or removes modules from Nautobot
- networktocode.nautobot.module_type - Creates or removes module types from Nautobot
- networktocode.nautobot.module_bay - Creates or removes module bays from Nautobot
- networktocode.nautobot.module_bay_template - Creates or removes module bay templates from Nautobot

Minor Changes
-------------
- (#431) Added tags and custom fields options to `cable` module
- (#433) Added role option to `device_interface` module
- (#438) Added cloud_network option to `circuit_termination` module
- (#446) Added module option to multiple existing modules
- (#449) Changed lookup plugin to allow for multiple `id` filters

v5.3.1
======

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
# This base stage just installs the dependencies required for production
# without any development deps.
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
FROM python:${PYTHON_VER} AS base

# Allow for flexible Python versions, for broader testing
ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
ENV PYTHON_VERSION=${PYTHON_VER}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -yqq && apt-get install -yqq shellcheck && apt-get clean
Expand Down Expand Up @@ -60,7 +60,7 @@ FROM lint AS unittests
ARG ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections
ENV ANSIBLE_COLLECTIONS_PATH=${ANSIBLE_COLLECTIONS_PATH}

ARG PYTHON_VER=3.10
ARG PYTHON_VER=3.11
ENV PYTHON_VERSION=${PYTHON_VER}

# Allows for custom command line arguments to be passed to ansible-test (like -vvv)
Expand Down Expand Up @@ -89,7 +89,7 @@ RUN ansible-test sanity $ANSIBLE_SANITY_ARGS \
plugins/

# Run unit tests
RUN ansible-test units $ANSIBLE_UNIT_ARGS --coverage --python ${PYTHON_VERSION}
RUN ansible-test units $ANSIBLE_UNIT_ARGS --coverage --requirements --python ${PYTHON_VERSION}

############
# Integration Tests
Expand Down
63 changes: 63 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,66 @@ releases:
minor_changes:
- (#422) Fixed `admin_permission` module to properly convert list of groups to UUIDs
- (#427) Fixed setting of `default_ip_version` option. Fixed logic in `add_ip_address` that sets Ansible `host` values
5.4.0:
modules:
- description: Creates or removes cloud accounts from Nautobot
name: cloud_account
namespace: ''
- description: Creates or removes cloud networks from Nautobot
name: cloud_network
namespace: ''
- description: Creates or removes cloud resource types from Nautobot
name: cloud_resource_type
namespace: ''
- description: Creates or removes cloud services from Nautobot
name: cloud_service
namespace: ''
- description: Creates or removes cloud service network assignments from Nautobot
name: cloud_service_network_assignment
namespace: ''
- description: Creates or removes cloud network prefix assignments from Nautobot
name: cloud_network_prefix_assignment
namespace: ''
- description: Creates or removes modules from Nautobot
name: module
namespace: ''
- description: Creates or removes module types from Nautobot
name: module_type
namespace: ''
- description: Creates or removes module bays from Nautobot
name: module_bay
namespace: ''
- description: Creates or removes module bay templates from Nautobot
name: module_bay_template
namespace: ''
changes:
minor_changes:
- (#431) Added tags and custom fields options to `cable` module
- (#433) Added role option to `device_interface` module
- (#438) Added cloud_network option to `circuit_termination` module
- (#446) Added module option to multiple existing modules
- (#449) Changed lookup plugin to allow for multiple `id` filters
5.5.0:
modules:
- description: Creates or removes job buttons from Nautobot
name: job_button
namespace: ''
- description: Creates or removes dynamic groups from Nautobot
name: dynamic_group
namespace: ''
- description: Creates or removes static group associations from Nautobot
name: static_group_association
namespace: ''
- description: Creates or removes metadata types from Nautobot
name: metadata_type
namespace: ''
- description: Creates or removes metadata choices from Nautobot
name: metadata_choice
namespace: ''
- description: Creates or removes object metadata from Nautobot
name: object_metadata
namespace: ''
changes:
minor_changes:
- (#464) Added full support for caching to GraphQL Inventory plugin
- (#465) Changed `parent_location_type` to allow for explicit name attribute lookup
7 changes: 5 additions & 2 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ ARG PYTHON_VER
FROM ghcr.io/nautobot/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER} as nautobot

# Copy in the requirements file
COPY ./development/requirements.txt /opt/nautobot/requirements.txt
COPY --chown=nautobot:nautobot ./development/requirements.txt /opt/nautobot/requirements.txt

# Install the requirements
RUN pip install -r /opt/nautobot/requirements.txt

# Copy in the jobs
COPY --chown=nautobot:nautobot ./development/jobs /opt/nautobot/jobs

# Copy in the development configuration file
COPY ./development/nautobot_config.py /opt/nautobot/nautobot_config.py
COPY --chown=nautobot:nautobot ./development/nautobot_config.py /opt/nautobot/nautobot_config.py
4 changes: 4 additions & 0 deletions development/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ NAUTOBOT_REDIS_PORT=6379
# NAUTOBOT_REDIS_SSL=True
NAUTOBOT_SECRET_KEY=0123456789abcdef0123456789abcdef01234567

NAUTOBOT_DEBUG=True
NAUTOBOT_LOG_DEPRECATION_WARNINGS=True
NAUTOBOT_LOG_LEVEL=DEBUG

# Needed for Postgres should match the values for Nautobot above
PGPASSWORD=decinablesprewad
POSTGRES_DB=nautobot
Expand Down
17 changes: 16 additions & 1 deletion development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,23 @@ services:
<<: *nautobot-base
worker:
entrypoint: "nautobot-server rqworker"
#### ENABLE CELERY ######
# This is what is required to add a celery worker. This broke CI so is disabled for now.
# - "sh"
# - "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
# - "nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events" ## $$ because of docker-compose
# depends_on:
# nautobot:
# condition: "service_healthy"
# healthcheck:
# interval: "30s"
# timeout: "10s"
# start_period: "30s"
# retries: 3
# test: ["CMD", "bash", "-c", "nautobot-server celery inspect ping --destination celery@$$HOSTNAME"] ## $$ because of docker-compose
###########################
depends_on:
- "nautobot"
- "nautobot"
<<: *nautobot-base
postgres:
image: "postgres:13"
Expand Down
13 changes: 13 additions & 0 deletions development/jobs/example_job_button_receiver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from nautobot.apps.jobs import JobButtonReceiver, register_jobs


class ExampleSimpleJobButtonReceiver(JobButtonReceiver):
class Meta:
name = "Example Simple Job Button Receiver"

def receive_job_button(self, obj):
self.logger.info("Running Job Button Receiver.", extra={"object": obj})
# Add job logic here


register_jobs(ExampleSimpleJobButtonReceiver)
2 changes: 1 addition & 1 deletion development/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nautobot-bgp-models==0.20.0
nautobot-bgp-models==2.3.0
Loading

0 comments on commit 1e8859e

Please sign in to comment.