Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie updated by NetworkToCode Cookie Drift Manager Tool #114

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .bandit.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"_drift_manager": {
"template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
"template_dir": "nautobot-app",
"template_ref": "refs/tags/nautobot-app-v2.2.1",
"template_ref": "refs/tags/nautobot-app-v2.3.0",
"cookie_dir": "",
"branch_prefix": "drift-manager",
"pull_request_strategy": "create",
"post_actions": [
"black"
],
"draft": true,
"baked_commit_ref": "24156e9314494943cad462ccff41414f40e977a6"
"baked_commit_ref": "656df98eb8f7516e6f851a26557892b0181a3b37"
}
}
}
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ FAQ.md
.git/
.gitignore
.github
tasks.py
LICENSE
**/*.log
**/.vscode/
Expand Down
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

36 changes: 6 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
APP_NAME: "nautobot-app-floor-plan"

jobs:
black:
ruff-format:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_FLOOR_PLAN_LOCAL: "True"
Expand All @@ -25,20 +25,9 @@ jobs:
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_FLOOR_PLAN_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:
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
ruff-lint:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_FLOOR_PLAN_LOCAL: "True"
Expand All @@ -60,17 +49,6 @@ jobs:
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Check Docs Build"
run: "poetry run invoke build-and-check-docs"
flake8:
runs-on: "ubuntu-22.04"
env:
INVOKE_NAUTOBOT_FLOOR_PLAN_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: flake8"
run: "poetry run invoke flake8"
poetry:
runs-on: "ubuntu-22.04"
env:
Expand All @@ -95,12 +73,10 @@ jobs:
run: "poetry run invoke yamllint"
check-in-docker:
needs:
- "bandit"
- "ruff"
- "flake8"
- "ruff-format"
- "ruff-lint"
- "poetry"
- "yamllint"
- "black"
runs-on: "ubuntu-22.04"
strategy:
fail-fast: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://pypi.org/project/nautobot-floor-plan/"><img src="https://img.shields.io/pypi/v/nautobot-floor-plan"></a>
<a href="https://pypi.org/project/nautobot-floor-plan/"><img src="https://img.shields.io/pypi/dm/nautobot-floor-plan"></a>
<br>
An <a href="https://www.networktocode.com/nautobot/apps/">App</a> for <a href="https://nautobot.com/">Nautobot</a>.
An <a href="https://networktocode.com/nautobot-apps/">App</a> for <a href="https://nautobot.com/">Nautobot</a>.
</p>

## Overview
Expand Down
1 change: 1 addition & 0 deletions changes/114.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rebaked from the cookie `nautobot-app-v2.3.0`.
7 changes: 4 additions & 3 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Debug
#

DEBUG = is_truthy(os.getenv("NAUTOBOT_DEBUG", False))
DEBUG = is_truthy(os.getenv("NAUTOBOT_DEBUG", "false"))
_TESTING = len(sys.argv) > 1 and sys.argv[1] == "test"

if DEBUG and not _TESTING:
Expand Down Expand Up @@ -48,9 +48,10 @@
"PASSWORD": os.getenv("NAUTOBOT_DB_PASSWORD", ""), # Database password
"HOST": os.getenv("NAUTOBOT_DB_HOST", "localhost"), # Database server
"PORT": os.getenv(
"NAUTOBOT_DB_PORT", default_db_settings[nautobot_db_engine]["NAUTOBOT_DB_PORT"]
"NAUTOBOT_DB_PORT",
default_db_settings[nautobot_db_engine]["NAUTOBOT_DB_PORT"],
), # Database port, default to postgres
"CONN_MAX_AGE": int(os.getenv("NAUTOBOT_DB_TIMEOUT", 300)), # Database timeout
"CONN_MAX_AGE": int(os.getenv("NAUTOBOT_DB_TIMEOUT", "300")), # Database timeout
"ENGINE": nautobot_db_engine,
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ a.autorefs-external:hover::after {
}


/* Customization for mkdocs-version-annotations */
/* Customization for markdown-version-annotations */
:root {
/* Icon for "version-added" admonition: Material Design Icons "plus-box-outline" */
--md-admonition-icon--version-added: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 19V5H5v14h14m0-16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-8 4h2v4h4v2h-4v4h-2v-4H7v-2h4V7Z"/></svg>');
Expand Down
2 changes: 1 addition & 1 deletion 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: `black`, `pylint`, `bandit`, `flake8`, 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
10 changes: 2 additions & 8 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ Each command can be executed with `invoke <command>`. All commands support the a
#### Testing

```shell
bandit Run bandit to validate basic static code security analysis.
black Run black to check that Python files adhere to its style standards.
flake8 Run flake8 to check that Python files adhere to its style standards.
ruff Run ruff to validate docstring formatting adheres to NTC defined standards.
ruff Run ruff to perform code formatting and/or linting.
pylint Run pylint code analysis.
tests Run all tests for this app.
unittest Run Django unit tests for the app.
Expand Down Expand Up @@ -454,7 +451,7 @@ This is the same as running:

### Tests

To run tests against your code, you can run all of the tests that TravisCI runs against any new PR with:
To run tests against your code, you can run all of the tests that the CI runs against any new PR with:

```bash
➜ invoke tests
Expand All @@ -464,9 +461,6 @@ To run an individual test, you can run any or all of the following:

```bash
➜ invoke unittest
➜ invoke bandit
➜ invoke black
➜ invoke flake8
➜ invoke ruff
➜ invoke pylint
```
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mkdocs==1.5.2
mkdocs-material==9.1.15
mkdocs-version-annotations==1.0.0
markdown-version-annotations==1.0.1
mkdocstrings-python==1.5.2
mkdocstrings==0.22.0
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ extra:
link: "https://twitter.com/networktocode"
name: "Network to Code Twitter"
markdown_extensions:
- "markdown_version_annotations":
admonition_tag: "???"
- "admonition"
- "toc":
permalink: true
Expand All @@ -89,7 +91,6 @@ markdown_extensions:
- "footnotes"
plugins:
- "search"
- "mkdocs-version-annotations"
- "mkdocstrings":
default_handler: "python"
handlers:
Expand Down
2 changes: 1 addition & 1 deletion nautobot_floor_plan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from django.core.exceptions import ImproperlyConfigured
from django.db.models.signals import post_migrate

from nautobot.apps import NautobotAppConfig
from nautobot.apps.config import get_app_settings_or_config

from nautobot_floor_plan.choices import AxisLabelsChoices

__version__ = metadata.version(__name__)
Expand Down
3 changes: 1 addition & 2 deletions nautobot_floor_plan/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from django.shortcuts import get_object_or_404
from django.views.decorators.clickjacking import xframe_options_sameorigin
from drf_spectacular.utils import extend_schema
from rest_framework.decorators import action

from nautobot.apps.api import NautobotModelViewSet
from rest_framework.decorators import action

from nautobot_floor_plan import filters, models
from nautobot_floor_plan.api import serializers
Expand Down
1 change: 0 additions & 1 deletion nautobot_floor_plan/filter_extensions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Extensions to Nautobot core models' filtering functionality."""

import django_filters

from nautobot.extras.plugins import PluginFilterExtension

from nautobot_floor_plan import models
Expand Down
4 changes: 1 addition & 3 deletions nautobot_floor_plan/filters.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""Filtering for nautobot_floor_plan."""

import django_filters

from nautobot.apps.filters import NaturalKeyOrPKMultipleChoiceFilter, NautobotFilterSet, SearchFilter
from nautobot.dcim.models import Location, Rack, RackGroup
from nautobot.apps.filters import NautobotFilterSet
from nautobot.apps.filters import NaturalKeyOrPKMultipleChoiceFilter, SearchFilter

from nautobot_floor_plan import models

Expand Down
15 changes: 7 additions & 8 deletions nautobot_floor_plan/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
"""Forms for nautobot_floor_plan."""

from django import forms

from nautobot.dcim.models import Location, Rack, RackGroup
from nautobot.apps.config import get_app_settings_or_config
from nautobot.apps.forms import (
DynamicModelChoiceField,
DynamicModelMultipleChoiceField,
NautobotBulkEditForm,
NautobotFilterForm,
NautobotModelForm,
TagsBulkEditFormMixin,
DynamicModelChoiceField,
DynamicModelMultipleChoiceField,
TagFilterField,
TagsBulkEditFormMixin,
add_blank_choice,
)
from nautobot.apps.config import get_app_settings_or_config
from nautobot.dcim.models import Location, Rack, RackGroup

from nautobot_floor_plan import models, choices, utils
from nautobot_floor_plan import choices, models, utils


class FloorPlanForm(NautobotModelForm):
Expand Down Expand Up @@ -104,7 +103,7 @@ def clean_y_origin_seed(self):
return self._clean_origin_seed("y_origin_seed", "Y")


class FloorPlanBulkEditForm(TagsBulkEditFormMixin, NautobotBulkEditForm):
class FloorPlanBulkEditForm(TagsBulkEditFormMixin, NautobotBulkEditForm): # pylint: disable=too-many-ancestors
"""FloorPlan bulk edit form."""

pk = forms.ModelMultipleChoiceField(queryset=models.FloorPlan.objects.all(), widget=forms.MultipleHiddenInput)
Expand Down
5 changes: 3 additions & 2 deletions nautobot_floor_plan/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Generated by Django 3.2.16 on 2023-03-02 21:23

import uuid

import django.core.serializers.json
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import nautobot.extras.models.mixins
import nautobot.extras.models.statuses
import taggit.managers
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
1 change: 0 additions & 1 deletion nautobot_floor_plan/migrations/0002_fixup_null.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.db import migrations

from nautobot.extras.utils import fixup_null_statuses


Expand Down
2 changes: 1 addition & 1 deletion nautobot_floor_plan/migrations/0003_auto_20230908_1339.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated by Django 3.2.20 on 2023-09-08 13:39

from django.db import migrations, models
import django.db.models.deletion
import nautobot.core.models.fields
import nautobot.extras.models.statuses
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion nautobot_floor_plan/migrations/0005_add_rackgroup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 3.2.21 on 2024-06-21 18:52

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Generated by Django 4.2.14 on 2024-08-07 15:39

from django.db import migrations
import django.db.models.deletion
import nautobot.extras.models.statuses
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("nautobot_floor_plan", "0005_add_rackgroup"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("nautobot_floor_plan", "0006_alter_floorplantile_status"),
]
Expand Down
8 changes: 2 additions & 6 deletions nautobot_floor_plan/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator
from django.db import models, transaction
from nautobot.apps.models import PrimaryModel, StatusField, extras_features

from nautobot.apps.models import extras_features
from nautobot.apps.models import PrimaryModel
from nautobot.apps.models import StatusField

from nautobot_floor_plan.choices import RackOrientationChoices, AxisLabelsChoices, AllocationTypeChoices
from nautobot_floor_plan.choices import AllocationTypeChoices, AxisLabelsChoices, RackOrientationChoices
from nautobot_floor_plan.svg import FloorPlanSVG


logger = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion nautobot_floor_plan/navigation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Menu items."""

from nautobot.apps.ui import NavMenuGroup, NavMenuItem, NavMenuTab, NavMenuAddButton, NavMenuImportButton
from nautobot.apps.ui import NavMenuAddButton, NavMenuGroup, NavMenuImportButton, NavMenuItem, NavMenuTab

menu_items = (
NavMenuTab(
Expand Down
Loading