Skip to content

Commit

Permalink
Cookie updated by NetworkToCode Cookie Drift Manager Tool (#223)
Browse files Browse the repository at this point in the history
* Cookie updated by NetworkToCode Cookie Drift Manager Tool

Template:

```
{
    "template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
    "dir": "nautobot-app",
    "ref": "refs/tags/nautobot-app-v2.4.0",
    "path": null
}
```

Cookie:

```
{
    "remote": "https://github.com/nautobot/nautobot-app-bgp-models.git",
    "path": "/tmp/tmpg0ke1qs_/nautobot-app-bgp-models",
    "repository_path": "/tmp/tmpg0ke1qs_/nautobot-app-bgp-models",
    "dir": "",
    "branch_prefix": "drift-manager",
    "context": {
        "codeowner_github_usernames": "@glennmatthews @mzbroch",
        "full_name": "Network to Code, LLC",
        "email": "opensource@networktocode.com",
        "github_org": "nautobot",
        "app_name": "nautobot_bgp_models",
        "verbose_name": "BGP Models",
        "app_slug": "nautobot-bgp-models",
        "project_slug": "nautobot-app-bgp-models",
        "repo_url": "https://github.com/nautobot/nautobot-app-bgp-models",
        "base_url": "bgp",
        "min_nautobot_version": "2.0.3",
        "max_nautobot_version": "2.9999",
        "camel_name": "NautobotBGPModels",
        "project_short_description": "Nautobot BGP Models App",
        "model_class_name": "None",
        "open_source_license": "Apache-2.0",
        "docs_base_url": "https://docs.nautobot.com",
        "docs_app_url": "https://docs.nautobot.com/projects/bgp-models/en/latest",
        "_template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
        "_output_dir": "/tmp/tmpg0ke1qs_",
        "_repo_dir": "/github/home/.cookiecutters/cookiecutter-nautobot-app/nautobot-app",
        "_checkout": "refs/tags/nautobot-app-v2.4.0"
    },
    "base_branch": "develop",
    "remote_name": "origin",
    "pull_request_strategy": "PullRequestStrategy.CREATE",
    "post_actions": [
        "PostAction.RUFF",
        "PostAction.POETRY"
    ],
    "baked_commit_ref": "d914775acefd7695249a04fbfe0cb0f3dbf170d0",
    "draft": false
}
```

CLI Arguments:

```
{
    "cookie_dir": "",
    "input": false,
    "json_filename": "",
    "output_dir": "",
    "push": true,
    "template": "",
    "template_dir": "",
    "template_ref": "refs/tags/nautobot-app-v2.4.0",
    "pull_request": null,
    "post_action": [
        "ruff",
        "poetry"
    ],
    "disable_post_actions": true,
    "draft": false
}
```

* fix lockfile

* remove file that drift manager re-added

* Update README.md

* fix bad merge

* add missing url pattern

---------

Co-authored-by: bakebot <info@networktocode.com>
Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 1, 2024
1 parent 426388c commit f07e3f8
Show file tree
Hide file tree
Showing 15 changed files with 1,138 additions and 881 deletions.
9 changes: 5 additions & 4 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "refs/tags/nautobot-app-v2.3.2",
"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": "d914775acefd7695249a04fbfe0cb0f3dbf170d0"
"draft": false,
"baked_commit_ref": "00caf083839acaa6628bcdb922abfa797186341b"
}
}
}
18 changes: 3 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ jobs:
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
bandit:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_BGP_MODELS_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
ruff-lint:
runs-on: "ubuntu-22.04"
env:
Expand All @@ -48,7 +37,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 @@ -84,7 +73,6 @@ jobs:
run: "poetry run invoke yamllint"
check-in-docker:
needs:
- "bandit"
- "ruff-format"
- "ruff-lint"
- "poetry"
Expand Down Expand Up @@ -188,9 +176,9 @@ jobs:
- name: "Run Tests"
run: "poetry run invoke unittest"
changelog:
if: |
if: >
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
(github.head_ref != 'main')
(github.head_ref != 'main') && (!startsWith(github.head_ref, 'release'))
runs-on: "ubuntu-22.04"
steps:
- name: "Check out repository code"
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_BGP_MODELS"
plugin_name: "nautobot-app-bgp-models"
plugin_name: "nautobot-bgp-models"
1 change: 1 addition & 0 deletions changes/+nautobot-app-v2.4.0.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rebaked from the cookie `nautobot-app-v2.4.0`.
6 changes: 4 additions & 2 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ WORKDIR /source
COPY . /source

# Build args must be declared in each stage
ARG NAUTOBOT_VER
ARG PYTHON_VER

# Constrain the Nautobot version to NAUTOBOT_VER
# 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}; fi
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 the app
RUN poetry install --extras all --with dev
Expand Down
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-bgp-models/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
26 changes: 8 additions & 18 deletions docs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The project is packaged with a light [development environment](dev_environment.m

The project is following Network to Code software development guidelines and is leveraging the following:

- Python linting and formatting: `pylint`, `bandit`, and `ruff`.
- Python linting and formatting: `pylint` and `ruff`.
- YAML linting is done with `yamllint`.
- Django unit test to ensure the app is working properly.

Expand Down Expand Up @@ -49,24 +49,14 @@ The branching policy includes the following tenets:

BGP Models 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

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

When a new release, from `develop` to `main`, is created 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).
2 changes: 0 additions & 2 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Each command can be executed with `invoke <command>`. All commands support the a
#### Testing

```
bandit Run bandit to validate basic static code security analysis.
ruff Run ruff to perform code formatting and/or linting.
pylint Run pylint code analysis.
tests Run all tests for this app.
Expand Down Expand Up @@ -462,7 +461,6 @@ To run an individual test, you can run any or all of the following:

```bash
➜ invoke unittest
➜ invoke bandit
➜ invoke ruff
➜ invoke pylint
```
Expand Down
Loading

0 comments on commit f07e3f8

Please sign in to comment.