diff --git a/.cookiecutter.json b/.cookiecutter.json index 531928a8..c17e8ed1 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -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.1.0", + "template_ref": "refs/tags/nautobot-app-v2.2.0", "cookie_dir": "", "branch_prefix": "drift-manager", "pull_request_strategy": "create", @@ -29,7 +29,7 @@ "black" ], "draft": true, - "baked_commit_ref": "65a757a27f903f10bdaa73fabbf623b397551910" + "baked_commit_ref": "598f76b40b1c3b57b861d977faba4c46c5763a63" } } } diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index f4cc67f1..865ac429 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -31,5 +31,4 @@ - [ ] Attached Screenshots, Payload Example - [ ] Unit, Integration Tests - [ ] Documentation Updates (when adding/changing features) -- [ ] Example App Updates (when adding/changing features) - [ ] Outline Remaining Work, Constraints from Design diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64a85974..34fe4aae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Linting: black" run: "poetry run invoke black" bandit: @@ -35,7 +35,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Linting: bandit" run: "poetry run invoke bandit" ruff: @@ -46,7 +46,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Linting: ruff" run: "poetry run invoke ruff" check-docs-build: @@ -57,7 +57,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Check Docs Build" run: "poetry run invoke build-and-check-docs" flake8: @@ -68,7 +68,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Linting: flake8" run: "poetry run invoke flake8" poetry: @@ -79,7 +79,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Checking: poetry lock file" run: "poetry run invoke lock --check" yamllint: @@ -90,7 +90,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Linting: yamllint" run: "poetry run invoke yamllint" check-in-docker: @@ -114,7 +114,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Set up Docker Buildx" id: "buildx" uses: "docker/setup-buildx-action@v3" @@ -164,7 +164,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Set up Docker Buildx" id: "buildx" uses: "docker/setup-buildx-action@v3" @@ -200,7 +200,7 @@ jobs: with: fetch-depth: "0" - name: "Setup environment" - uses: "networktocode/gh-action-setup-poetry-environment@v4" + uses: "networktocode/gh-action-setup-poetry-environment@v6" - name: "Check for changelog entry" run: | git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }} @@ -217,7 +217,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Set up Python" - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "3.11" - name: "Install Python Packages" @@ -252,7 +252,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Set up Python" - uses: "actions/setup-python@v4" + uses: "actions/setup-python@v5" with: python-version: "3.11" - name: "Install Python Packages" diff --git a/README.md b/README.md index 36026b21..2614705f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
- +
diff --git a/changes/8.housekeeping b/changes/8.housekeeping new file mode 100644 index 00000000..653c54ac --- /dev/null +++ b/changes/8.housekeeping @@ -0,0 +1 @@ +Re-baked from the latest template. diff --git a/development/Dockerfile b/development/Dockerfile index ce11e51d..b43662ef 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -28,7 +28,7 @@ ENV INVOKE_NAUTOBOT_FIREWALL_MODELS_LOCAL=true # Since this is only used for development and we don't ship this container, pinning Poetry back is not expressly necessary # We also don't need virtual environments in container RUN which poetry || curl -sSL https://install.python-poetry.org | python3 - && \ - poetry config virtualenvs.create false + poetry config virtualenvs.create false # !!! USE CAUTION WHEN MODIFYING LINES ABOVE # ------------------------------------------------------------------------------------- diff --git a/development/nautobot_config.py b/development/nautobot_config.py index 111b0502..f83c96c8 100644 --- a/development/nautobot_config.py +++ b/development/nautobot_config.py @@ -92,11 +92,11 @@ "disable_existing_loggers": False, "formatters": { "normal": { - "format": "%(asctime)s.%(msecs)03d %(levelname)-7s %(name)s :\n %(message)s", + "format": "%(asctime)s.%(msecs)03d %(levelname)-7s %(name)s : %(message)s", "datefmt": "%H:%M:%S", }, "verbose": { - "format": "%(asctime)s.%(msecs)03d %(levelname)-7s %(name)-20s %(filename)-15s %(funcName)30s() :\n %(message)s", + "format": "%(asctime)s.%(msecs)03d %(levelname)-7s %(name)-20s %(filename)-15s %(funcName)30s() : %(message)s", "datefmt": "%H:%M:%S", }, }, diff --git a/development/towncrier_template.j2 b/development/towncrier_template.j2 index d2ec61bd..b0f6e12f 100644 --- a/development/towncrier_template.j2 +++ b/development/towncrier_template.j2 @@ -1,6 +1,6 @@ {% if render_title %} -## v{{ versiondata.version }} ({{ versiondata.date }}) +## [v{{ versiondata.version }} ({{ versiondata.date }})]({{ cookiecutter.repo_url }}/releases/tag/v{{ versiondata.version}}) {% endif %} {% for section, _ in sections.items() %} diff --git a/docs/admin/install.md b/docs/admin/install.md index 06f6251b..719fb191 100644 --- a/docs/admin/install.md +++ b/docs/admin/install.md @@ -13,7 +13,7 @@ Here you will find detailed instructions on how to **install** and **configure** ## Install Guide !!! note - Apps can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this app is [`nautobot-firewall-models`](https://pypi.org/project/nautobot-firewall-models/). + Apps can be installed from the [Python Package Index](https://pypi.org/) or locally. See the [Nautobot documentation](https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/installation/app-install/) for more details. The pip package name for this app is [`nautobot-firewall-models`](https://pypi.org/project/nautobot-firewall-models/). The app is available as a Python package via PyPI and can be installed with `pip`: diff --git a/docs/dev/contributing.md b/docs/dev/contributing.md index df2b0c13..29c74c99 100644 --- a/docs/dev/contributing.md +++ b/docs/dev/contributing.md @@ -38,3 +38,35 @@ All pull requests to `next` or `develop` must include a changelog fragment file ```plaintext title="changes/1234.changed" Changed release notes generation. ``` + +## Branching Policy + +The branching policy includes the following tenets: + +- The `develop` branch is the branch of the next major and minor paired version planned. +- PRs intended to add new features should be sourced from the `develop` branch. +- PRs intended to fix issues in the Nautobot LTM compatible release should be sourced from the latest `ltm-` branch instead of `develop`. + +Nautobot Firewall 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. + +## Release Policy + +Nautobot Firewall 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_..md` file to reflect the changes. + - Change the version from `..-beta` to `..` 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..`. + - The title should be in the form of `v..`. + - The description should be the changes that were added to the `version_..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 `..` to `..-beta` in both `pyproject.toml` and `nautobot.__init__.__version__`. + - Set the PR to the proper branch, `develop`. + - Once tests pass, merge. diff --git a/docs/dev/dev_environment.md b/docs/dev/dev_environment.md index 46218b33..e1aef018 100644 --- a/docs/dev/dev_environment.md +++ b/docs/dev/dev_environment.md @@ -74,7 +74,7 @@ nautobot-server migrate !!! note If you want to develop on the latest develop branch of Nautobot, run the following command: `poetry add --optional git+https://github.com/nautobot/nautobot@develop`. After the `@` symbol must match either a branch or a tag. -You can now run `nautobot-server` commands as you would from the [Nautobot documentation](https://nautobot.readthedocs.io/en/latest/) for example to start the development server: +You can now run `nautobot-server` commands as you would from the [Nautobot documentation](https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/tools/nautobot-server/) for example to start the development server: ```shell nautobot-server runserver 0.0.0.0:8080 --insecure @@ -470,3 +470,21 @@ To run an individual test, you can run any or all of the following: ➜ invoke ruff ➜ invoke pylint ``` + +### App Configuration Schema + +In the package source, there is the `nautobot_firewall_models/app-config-schema.json` file, conforming to the [JSON Schema](https://json-schema.org/) format. This file is used to validate the configuration of the app in CI pipelines. + +If you make changes to `PLUGINS_CONFIG` or the configuration schema, you can run the following command to validate the schema: + +```bash +invoke validate-app-config +``` + +To generate the `app-config-schema.json` file based on the current `PLUGINS_CONFIG` configuration, run the following command: + +```bash +invoke generate-app-config-schema +``` + +This command can only guess the schema, so it's up to the developer to manually update the schema as needed. diff --git a/docs/user/app_overview.md b/docs/user/app_overview.md index 1dcf1b8e..10024c26 100644 --- a/docs/user/app_overview.md +++ b/docs/user/app_overview.md @@ -1,6 +1,6 @@ # App Overview -This document provides an overview of the App including critical information and import considerations when applying it to your Nautobot environment. +This document provides an overview of the App including critical information and important considerations when applying it to your Nautobot environment. !!! note Throughout this documentation, the terms "app" and "plugin" will be used interchangeably. diff --git a/mkdocs.yml b/mkdocs.yml index b32f0777..a8fb187a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -81,7 +81,11 @@ markdown_extensions: anchor_linenums: true - "pymdownx.inlinehilite" - "pymdownx.snippets" - - "pymdownx.superfences" + - "pymdownx.superfences": + custom_fences: + - name: "mermaid" + class: "mermaid" + format: !!python/name:pymdownx.superfences.fence_code_format - "footnotes" plugins: - "search" diff --git a/pyproject.toml b/pyproject.toml index 7a56f95b..e84070b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,7 @@ license = "Apache-2.0" readme = "README.md" homepage = "https://github.com/nautobot/nautobot-app-firewall-models" repository = "https://github.com/nautobot/nautobot-app-firewall-models" +documentation = "https://docs.nautobot.com/projects/firewall-models/en/latest/" keywords = ["nautobot", "nautobot-app", "nautobot-plugin"] classifiers = [ "Intended Audience :: Developers", @@ -159,7 +160,7 @@ requires = ["poetry_core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.towncrier] -package = "nautobot" +package = "nautobot_firewall_models" directory = "changes" filename = "docs/admin/release_notes/version_X.Y.md" template = "development/towncrier_template.j2" diff --git a/tasks.py b/tasks.py index 3d6108e7..1dfcae87 100644 --- a/tasks.py +++ b/tasks.py @@ -23,8 +23,7 @@ def is_truthy(arg): """Convert "truthy" strings into Booleans. - Examples - -------- + Examples: >>> is_truthy('yes') True Args: @@ -112,7 +111,6 @@ def docker_compose(context, command, **kwargs): """Helper function for running a specific docker compose command with all appropriate parameters and environment. Args: - ---- context (obj): Used to run specific commands command (str): Command string to append to the "docker compose ..." command, such as "build", "up", etc. **kwargs: Passed through to the context.run() call. @@ -341,7 +339,13 @@ def logs(context, service="", follow=False, tail=0): # ------------------------------------------------------------------------------ # ACTIONS # ------------------------------------------------------------------------------ -@task(help={"file": "Python file to execute"}) +@task( + help={ + "file": "Python file to execute", + "env": "Environment variables to pass to the command", + "plain": "Flag to run nbshell in plain mode (default: False)", + }, +) def nbshell(context, file="", env={}, plain=False): """Launch an interactive nbshell session.""" command = [ @@ -685,7 +689,7 @@ def pylint(context): def autoformat(context): """Run code autoformatting.""" black(context, autoformat=True) - ruff(context, action="both", fix=True) + ruff(context, fix=True) @task( @@ -723,7 +727,6 @@ def yamllint(context): """Run yamllint to validate formatting adheres to NTC defined YAML standards. Args: - ---- context (obj): Used to run specific commands """ command = "yamllint . --format standard"