Skip to content

Commit

Permalink
Merge pull request #826 from nautobot/release/v2.2.0
Browse files Browse the repository at this point in the history
Release v2.2.0
  • Loading branch information
itdependsnetworks authored Nov 13, 2024
2 parents 2c28e1d + 30f2fa1 commit 60ea5b0
Show file tree
Hide file tree
Showing 29 changed files with 1,913 additions and 948 deletions.
11 changes: 6 additions & 5 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
"max_nautobot_version": "2.9999",
"camel_name": "NautobotGoldenConfig",
"project_short_description": "An app for configuration on nautobot",
"model_class_name": "None",
"model_class_name": "ComplianceFeature",
"open_source_license": "Apache-2.0",
"docs_base_url": "https://docs.nautobot.com",
"docs_app_url": "https://docs.nautobot.com/projects/golden-config/en/latest",
"_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.4.0",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": [
"black"
"ruff",
"poetry"
],
"draft": true,
"baked_commit_ref": "4eb0e2da920ce7f21715b4dd11549ac433eba529"
"draft": false,
"baked_commit_ref": "69ab82f79f346d3e9e9cf62432bdd6d6b9c53e3f"
}
}
}
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
APP_NAME: "nautobot-app-golden-config"
APP_NAME: "nautobot-golden-config"

jobs:
ruff-format:
Expand All @@ -38,7 +38,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: ruff"
run: "poetry run invoke ruff"
run: "poetry run invoke ruff --action lint"
check-docs-build:
runs-on: "ubuntu-22.04"
env:
Expand Down Expand Up @@ -92,6 +92,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_GOLDEN_CONFIG_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 @@ -109,6 +113,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 @@ -123,14 +128,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 @@ -142,6 +147,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_GOLDEN_CONFIG_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 @@ -159,6 +168,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 @@ -196,7 +206,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 @@ -231,7 +241,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
3 changes: 2 additions & 1 deletion .github/workflows/upstream_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ name: "Nautobot Upstream Monitor"
on: # yamllint disable-line rule:truthy rule:comments
schedule:
- cron: "0 4 */2 * *" # every other day at midnight
workflow_dispatch:

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_GOLDEN_CONFIG"
plugin_name: "nautobot-app-golden-config"
plugin_name: "nautobot-golden-config"
33 changes: 12 additions & 21 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,20 @@ 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 NAUTOBOT_VER
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, fall back to installing from git branch if not available on PyPi
# 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} || \
poetry add --lock git+https://github.com/nautobot/nautobot.git#${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/development.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ NAUTOBOT_BANNER_TOP="Local"
NAUTOBOT_CHANGELOG_RETENTION=0

NAUTOBOT_DEBUG=True
NAUTOBOT_LOG_DEPRECATION_WARNINGS=True
NAUTOBOT_LOG_LEVEL=DEBUG
NAUTOBOT_METRICS_ENABLED=True
NAUTOBOT_NAPALM_TIMEOUT=5
Expand Down
15 changes: 15 additions & 0 deletions development/towncrier_template.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@

# v{{ versiondata.version.split(".")[:2] | join(".") }} Release Notes

This document describes all new features and changes in the release. The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## Release Overview

- Major features or milestones
- Changes to compatibility with Nautobot and/or other apps, libraries etc.

{% if render_title %}
## [v{{ versiondata.version }} ({{ versiondata.date }})](https://github.com/nautobot/nautobot-app-golden-config/releases/tag/v{{ versiondata.version}})

Expand All @@ -12,7 +23,11 @@
{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
{% for item in text.split('\n') %}
{% if values %}
- {{ values|join(', ') }} - {{ item.strip() }}
{% else %}
- {{ item.strip() }}
{% endif %}
{% endfor %}
{% endfor %}

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

# v2.2 Release Notes

This document describes all new features and changes in the release. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Release Overview

- Added Python 3.12 support.
- Added REST API endpoint for Jinja as first part of journey towards a jinja live editor.

## [v2.2.0 (2024-11-04)](https://github.com/nautobot/nautobot-app-golden-config/releases/tag/v2.2.0)

### Added

- [#803](https://github.com/nautobot/nautobot-app-golden-config/issues/803) - Added Python 3.12 support.
- [#824](https://github.com/nautobot/nautobot-app-golden-config/issues/824) - Added a REST API endpoint for Jinja template developers to render intended configurations from templates in an arbitrary git repository.

### Changed

- [#814](https://github.com/nautobot/nautobot-app-golden-config/issues/814) - Changed the Git commit message of GC Jobs to be configurable.

### Fixed

- [#743](https://github.com/nautobot/nautobot-app-golden-config/issues/743) - Fixed improperly rendered panels in device and location views.
- [#810](https://github.com/nautobot/nautobot-app-golden-config/issues/810) - Fixed custom compliance to work with non-string objects.

### Housekeeping

- [#0](https://github.com/nautobot/nautobot-app-golden-config/issues/0) - Rebaked from the cookie `nautobot-app-v2.4.0`.
- [#803](https://github.com/nautobot/nautobot-app-golden-config/issues/803) - Rebaked from the cookie `nautobot-app-v2.3.2`.
- [#823](https://github.com/nautobot/nautobot-app-golden-config/issues/823) - Changed model_class_name in .cookiecutter.json to a valid model to help with drift management.
- [#824](https://github.com/nautobot/nautobot-app-golden-config/issues/824) - Updated multiple tests to use the faster `setUpTestData` instead of `setUp`. Fixed incorrect base class on `ConfigPlanTest`.
24 changes: 7 additions & 17 deletions docs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,14 @@ The branching policy includes the following tenets:

Golden Config will observe semantic versioning, as of 1.0. This may result in a quick turnaround in minor versions to keep pace with an ever-growing feature set.

### Backporting to Older Releases

If you are backporting any fixes to a prior major or minor version of this app, please open an issue, comment on an existing issue, or post in the [Network to Code Slack](https://networktocode.slack.com/) (channel `#nautobot`).

We will create a `release-X.Y` branch for you to open your PR against and cut a new release once the PR is successfully merged.

## Release Policy

Golden Config has currently no intended scheduled release schedule, and will release new features in minor versions.

When a release is ready to be created from either `develop` or `ltm-x.x`, the following should happen.

- A release PR is created from `develop` with:
- Update the release notes in `docs/admin/release_notes/version_<major>.<minor>.md` file to reflect the changes.
- Change the version from `<major>.<minor>.<patch>-beta` to `<major>.<minor>.<patch>` in `pyproject.toml`.
- Set the PR to the `main` branch.
- Ensure the tests for the PR pass.
- Merge the PR.
- Create a new tag:
- The tag should be in the form of `v<major>.<minor>.<patch>`.
- The title should be in the form of `v<major>.<minor>.<patch>`.
- The description should be the changes that were added to the `version_<major>.<minor>.md` document.
- If merged into `main`, then push from `main` to `develop`, in order to retain the merge commit created when the PR was merged
- A post release PR is created with:
- Change the version from `<major>.<minor>.<patch>` to `<major>.<minor>.<patch + 1>-beta` in both `pyproject.toml` and `nautobot.__init__.__version__`.
- Set the PR to the proper branch, `develop`.
- Once tests pass, merge.
The steps taken by maintainers when creating a new release are documented in the [release checklist](./release_checklist.md).
Loading

0 comments on commit 60ea5b0

Please sign in to comment.