Skip to content

Commit

Permalink
Merge pull request #134 from nautobot/develop
Browse files Browse the repository at this point in the history
v1.2.0 release
  • Loading branch information
whitej6 authored Feb 8, 2023
2 parents e763c3f + bbf5daa commit ddf8f32
Show file tree
Hide file tree
Showing 12 changed files with 296 additions and 116 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/upstream_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Nautobot Upstream Testing"

on: # yamllint disable-line rule:truthy rule:comments
schedule:
- cron: "0 4 */2 * *" # every other day at midnight

jobs:
upstream-test:
uses: "nautobot/nautobot/.github/workflows/plugin_upstream_testing_base.yml@develop"
with: # Below could potentially be collapsed into a single argument if a concrete relationship between both is enforced
invoke_context_name: "NAUTOBOT_FIREWALL_MODELS"
plugin_name: "nautobot-firewall-models"
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## v1.2.0 - 2022-02-08

### Fixed

- #120 Resolved inconsistent forms.

### Changed

- #108 Changed Application & Application Group migrations to allow null values.

### Added

- #108 Application & ApplicationGroup support

## v1.2.0-alpha.2 - 2022-12-07

### Fixed

- #120 Resolved inconsistent forms.

## v1.2.0-alpha.1 - 2022-11-25

### Changed

- #108 Changed Application & Application Group migrations to allow null values.

## v1.2.0-alpha.0 - 2022-11-22

### Added
Expand Down
75 changes: 53 additions & 22 deletions development/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,74 @@
# -------------------------------------------------------------------------------------
# Nautobot Plugin Development Dockerfile Template
# Version: 1.0.0
#
# Plugins that need to add additional steps or packages can do in the section below.
# -------------------------------------------------------------------------------------
# !!! USE CAUTION WHEN MODIFYING LINES BELOW

# Accepts a desired Nautobot version as build argument, default to 1.4.1
ARG NAUTOBOT_VER="1.4.1"
ARG PYTHON_VER=3.8

# Accepts a desired Python version as build argument, default to 3.8
ARG PYTHON_VER="3.8"

# Retrieve published development image of Nautobot base which should include most CI dependencies
FROM ghcr.io/nautobot/nautobot-dev:${NAUTOBOT_VER}-py${PYTHON_VER}

# Runtime argument and environment setup
ARG NAUTOBOT_ROOT=/opt/nautobot

ENV prometheus_multiproc_dir=/prom_cache
ENV NAUTOBOT_ROOT ${NAUTOBOT_ROOT}

WORKDIR $NAUTOBOT_ROOT

# Configure poetry
# Don't need virtual environments in container, parallelized installer has inconsistent behavior
RUN poetry config virtualenvs.create false \
&& poetry config installer.parallel false

# !!! USE CAUTION WHEN MODIFYING LINES ABOVE
# -------------------------------------------------------------------------------------
# Install Nautobot Plugin
# Plugin-specific system build/test dependencies.
#
# Example: LDAP requires `libldap2-dev` to be apt-installed before the Python package.
# -------------------------------------------------------------------------------------
WORKDIR /tmp/install
# --> Start safe to modify section

# Copy in only pyproject.toml/poetry.lock to help with caching this layer if no updates to dependencies
COPY poetry.lock pyproject.toml /tmp/install/

# Add the requested Nautobot version to pyproject
# to install the correct version based on the NAUTOBOT_VER argument
# Otherwise Poetry will override the version in this container
# with the one in the poetry.lock
# Redifine NAUTOBOT_VER as a build arg as initial is defined outside FROM.
ARG NAUTOBOT_VER="1.4.1"
RUN poetry add nautobot@$NAUTOBOT_VER
# Uncomment the line below if you are apt-installing any package.
# RUN apt update
# RUN apt install libldap2-dev

# --no-root declares not to install the project package since we're wanting to take advantage of caching dependency installation
# and the project is copied in and installed after this step
RUN poetry install --no-interaction --no-ansi --no-root
# --> Stop safe to modify section
# -------------------------------------------------------------------------------------
# Install Nautobot Plugin
# -------------------------------------------------------------------------------------
# !!! USE CAUTION WHEN MODIFYING LINES BELOW

# Copy in the rest of the source code and install local Nautobot plugin
# Copy in the source code
WORKDIR /source
COPY . /source
RUN cp /tmp/install/* /source/
RUN poetry install --no-interaction --no-ansi

# 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

# 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 --output poetry_freeze_base.txt
RUN poetry export -f requirements.txt --dev --without-hashes --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 plugin
RUN pip install -c constraints.txt -e .

# Install any dev dependencies frozen from Poetry
# Can be improved in Poetry 1.2 which allows `poetry install --only dev`
RUN pip install -c constraints.txt -r poetry_freeze_dev.txt

COPY development/nautobot_config.py ${NAUTOBOT_ROOT}/nautobot_config.py
# !!! USE CAUTION WHEN MODIFYING LINES ABOVE

4 changes: 2 additions & 2 deletions nautobot_firewall_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class NautobotFirewallModelsConfig(PluginConfig):
"""Plugin configuration for the nautobot_firewall_models plugin."""

name = "nautobot_firewall_models"
verbose_name = "Nautobot Plugin Firewall Model"
verbose_name = "Firewall & Security Models"
version = __version__
author = "Network to Code, LLC"
description = "Nautobot plugin to model firewall objects.."
description = "Nautobot App to model firewall and security objects. Allows users to model policies in a vendor-neutral manner and use that data to drive network security automation."
base_url = "firewall"
required_settings = []
min_version = "1.4.0"
Expand Down
4 changes: 2 additions & 2 deletions nautobot_firewall_models/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Meta:

model = models.ApplicationObject

fields = ["id", "name", "description", "category", "subcategory", "risk", "description"]
fields = ["id", "name", "description", "category", "subcategory", "risk"]


class ApplicationObjectGroupFilterSet(BaseFilterSet, NautobotFilterSet):
Expand Down Expand Up @@ -175,7 +175,7 @@ class Meta:
"""Meta attributes for filter."""

model = models.PolicyRule
fields = ["id", "action", "log", "request_id"]
fields = ["id", "action", "log", "request_id", "description"]


# TODO: Refactor to allow for better filtering, currently very limited.
Expand Down
Loading

0 comments on commit ddf8f32

Please sign in to comment.