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

Issue 67 #122

Draft
wants to merge 42 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1bd67d5
html template deduplication
ryanmerolle Jan 26, 2023
182b1c7
abstract classes to minimize code duplication
ryanmerolle Jan 26, 2023
e198cf6
add end of file new line
ryanmerolle Jan 26, 2023
2abc675
move included templates to inc folder
ryanmerolle Jan 26, 2023
976542d
add docstrings everywhere
ryanmerolle Jan 27, 2023
2640369
update pre-commit
ryanmerolle Jan 27, 2023
33e8717
fix ACLExtendedRule filterset tuple Rule Details
ryanmerolle Jan 27, 2023
b8d7267
consolidate acl type vs rule check
ryanmerolle Jan 27, 2023
d7f4288
merge neste ifs & create new function
ryanmerolle Jan 27, 2023
d0d892e
update setup.py
ryanmerolle Jan 27, 2023
007877f
fix constants
ryanmerolle Jan 27, 2023
fb15e3b
fix bug with acl input
ryanmerolle Jan 27, 2023
62dc456
move constants
ryanmerolle Jan 27, 2023
a8ae98d
stash conflict
ryanmerolle Jan 27, 2023
98fbb53
use ACLTypeChoices.TYPE_EXTENDED
ryanmerolle Jan 28, 2023
c21b4c7
refactor
ryanmerolle Jan 28, 2023
1dbe0b7
tweaks
ryanmerolle Jan 28, 2023
7789df3
adjust indenting for docstring
ryanmerolle Jan 28, 2023
1861c56
TODOs
ryanmerolle Jan 29, 2023
ced12c5
improve ACLInterfaceAssignmentForm clean method
ryanmerolle Jan 30, 2023
cce94e4
refactor
ryanmerolle Jan 30, 2023
bde16dd
refactor
ryanmerolle Jan 30, 2023
349b040
refactor form models
ryanmerolle Jan 30, 2023
5f5f24a
refactor to reduce complexity
ryanmerolle Jan 30, 2023
e9aa918
optimize form models
ryanmerolle Jan 30, 2023
930a40c
update acl forms
ryanmerolle Jan 30, 2023
9cdbf58
update BaseACLRuleForm
ryanmerolle Jan 30, 2023
f31b99c
update forms error order
ryanmerolle Jan 30, 2023
b316b74
refactor forms models
ryanmerolle Jan 30, 2023
4c64827
minimize redudant code in serializers
ryanmerolle Jan 31, 2023
0c71815
housekeeping
ryanmerolle Jan 31, 2023
8354c4f
add ai tooling to development
ryanmerolle Jan 31, 2023
09f67a4
add in devcontainer testing
ryanmerolle Jan 31, 2023
18b95c4
update TODO
ryanmerolle Jan 31, 2023
c04be89
black formatting
ryanmerolle Feb 1, 2023
8586145
fix acl name validator
ryanmerolle Feb 1, 2023
be1a975
fixing missing error_message
ryanmerolle Feb 1, 2023
d094bf6
isort
ryanmerolle Feb 1, 2023
3f4c9d7
update tests
ryanmerolle Feb 2, 2023
81db4da
add vs code extensions
ryanmerolle Feb 2, 2023
c46f768
fix tests
ryanmerolle Feb 2, 2023
5aec756
update models
ryanmerolle Feb 2, 2023
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
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@
"extensions": [
"DavidAnson.vscode-markdownlint",
"GitHub.codespaces",
"GitHub.copilot",
"GitHub.copilot-labs",
"GitHub.vscode-pull-request-github",
"Gruntfuggly.todo-tree",
"Tyriar.sort-lines",
"aaron-bond.better-comments",
"batisteo.vscode-django",
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ pylint
pylint-django
wily
yapf
sourcery-analytics
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ repos:
- id: isort
args:
- "--profile=black"
exclude: ^.devcontainer/
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3
exclude: ^.devcontainer/
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
Expand All @@ -34,6 +36,7 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
exclude: ^.devcontainer/
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
Expand All @@ -44,6 +47,12 @@ repos:
rev: v1.29.0
hooks:
- id: yamllint
- repo: https://github.com/econchick/interrogate
rev: 1.5.0
hooks:
- id: interrogate
args: [--fail-under=90, --verbose]
exclude: (^.devcontainer/|^netbox_acls/migrations/)
#- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
# rev: v1.1.2
# hooks:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ start:
.PHONY: all ## Run all PLUGIN DEV targets
all: setup makemigrations migrate collectstatic initializers start

#.PHONY: test
#test:
# ${VENV_PY_PATH} /opt/netbox/netbox/manage.py runserver test ${PLUGIN_NAME}
.PHONY: rebuild ## Run PLUGIN DEV targets to rebuild
rebuild: setup makemigrations migrate collectstatic start

.PHONY: test
test: setup
${VENV_PY_PATH} ${NETBOX_MANAGE_PATH}/manage.py makemigrations ${PLUGIN_NAME} --check
${VENV_PY_PATH} ${NETBOX_MANAGE_PATH}/manage.py test ${PLUGIN_NAME}

#relpatch:
# $(eval GSTATUS := $(shell git status --porcelain))
Expand Down
7 changes: 7 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- TODO: ACL Form Bubble/ICON Extended/Standard
- TODO: Add an Access List to an Interface Custom Fields after comments - DONE
- TODO: ACL rules, look at last number and increment to next 10
- TODO: Clone for ACL Interface should include device
- TODO: Inconsistent errors for add/edit (where model is using a generic page)
- TODO: Check Constants across codebase for consistency.
- TODO: Test API, Forms, & Models - https://github.com/k01ek/netbox-bgp/tree/main/netbox_bgp/tests , https://github.com/DanSheps/netbox-secretstore/tree/develop/netbox_secretstore/tests & https://github.com/FlxPeters/netbox-plugin-prometheus-sd/tree/main/netbox_prometheus_sd/tests
Loading