Skip to content

Commit

Permalink
Merge pull request #9 from minitriga/issue_8
Browse files Browse the repository at this point in the history
Add cookie cutter template templates
  • Loading branch information
minitriga authored May 9, 2024
2 parents dfb2b56 + f942401 commit 386695a
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 6 deletions.
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: 🐛 Bug Report
description: Report a reproducible bug in the current release of netbox-reorder-rack
labels: ["type: bug"]
body:
- type: markdown
attributes:
value: >
**NOTE:** This form is only for reporting _reproducible bugs_ in a current netbox-reorder-rack release.
- type: input
attributes:
label: netbox-reorder-rack version
description: What version of netbox-reorder-rack are you currently running?
placeholder: v1.1.0
validations:
required: true
- type: dropdown
attributes:
label: Python version
description: What version of Python are you currently running?
options:
- "3.10"
- "3.11"
- "3.12"
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: >
Please provide a minimal working example to demonstrate the bug. Begin with the
initialization of any necessary database objects and clearly enumerate each
operation carried out. Ensure that your example is as concise as possible
while adequately illustrating the issue.
_Please refrain from including any confidential or sensitive
information in your example._
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: What did you expect to happen?
placeholder: The script should execute without raising any errors or exceptions
validations:
required: true
- type: textarea
attributes:
label: Observed Behavior
description: What happened instead?
placeholder: A TypeError exception was raised
validations:
required: true
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false
contact_links:
- name: 💬 Community Slack
url: https://netdev.chat
about: "Join #netbox on the NetDev Community Slack for assistance with installation issues and other problems."
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: ✨ Feature Request
description: Propose a new netbox-reorder-rack feature or enhancement
labels: ["type: feature"]
body:
- type: markdown
attributes:
value: >
**NOTE:** This form is only for submitting well-formed proposals to extend or modify
netbox-reorder-rack in some way.
- type: input
attributes:
label: netbox-reorder-rack version
description: What version of netbox-reorder-rack are you currently running?
placeholder: v0.2.0
validations:
required: true
- type: dropdown
attributes:
label: Feature type
options:
- Data model extension
- New functionality
- Change to existing functionality
validations:
required: true
- type: textarea
attributes:
label: Proposed functionality
description: >
Describe in detail the new feature or behavior you are proposing. Include any specific changes
to work flows, data models, and/or the user interface. The more detail you provide here, the
greater chance your proposal has of being discussed. Feature requests which don't include an
actionable implementation plan will be rejected.
validations:
required: true
- type: textarea
attributes:
label: Use case
description: >
Explain how adding this functionality would benefit netbox-reorder-rack users. What need does it address?
validations:
required: true
- type: textarea
attributes:
label: External dependencies
description: >
List any new dependencies on external libraries or services that this new feature would
introduce. For example, does the proposal require the installation of a new Python package?
(Not all new features introduce new dependencies.)
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/housekeeping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: 🏡 Housekeeping
description: A change pertaining to the codebase itself (developers only)
labels: ["type: housekeeping"]
body:
- type: markdown
attributes:
value: >
**NOTE:** This template is for use by maintainers only. Please do not submit
an issue using this template unless you have been specifically asked to do so.
- type: textarea
attributes:
label: Proposed Changes
description: >
Describe in detail the new feature or behavior you'd like to propose.
Include any specific changes to work flows, data models, or the user interface.
validations:
required: true
- type: textarea
attributes:
label: Justification
description: Please provide justification for the proposed change(s).
validations:
required: true
5 changes: 2 additions & 3 deletions netbox_reorder_rack/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from core.models import ObjectType
from dcim.models import Device
from dcim.models import DeviceRole
from dcim.models import DeviceType
from dcim.models import Manufacturer
from dcim.models import Rack
from dcim.models import Site
from django.contrib.contenttypes.models import ContentType
from users.models import ObjectPermission
from utilities.testing import TestCase

Expand Down Expand Up @@ -144,8 +144,7 @@ def test_reorder_rack_view_with_permissions(self):
obj_perm = ObjectPermission(name="Test permission", actions=["view", "change"])
obj_perm.save()
obj_perm.users.add(self.user)
ct = ContentType.objects.filter(model="device").first()
obj_perm.object_types.add(ct)
obj_perm.object_types.add(ObjectType.objects.get_for_model(Device))

rack = Rack.objects.get(name="Test Rack 1")
device1 = Device.objects.get(name="Device 1")
Expand Down
6 changes: 3 additions & 3 deletions netbox_reorder_rack/tests/test_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from core.models import ObjectType
from dcim.models import Device
from dcim.models import Rack
from dcim.models import Site
from django.contrib.contenttypes.models import ContentType
from users.models import ObjectPermission
from utilities.testing import TestCase

Expand All @@ -21,8 +22,7 @@ def test_reorder_rack_view_with_permissions(self):
obj_perm = ObjectPermission(name="Test permission", actions=["change", "view"])
obj_perm.save()
obj_perm.users.add(self.user)
ct = ContentType.objects.filter(model="device").first()
obj_perm.object_types.add(ct)
obj_perm.object_types.add(ObjectType.objects.get_for_model(Device))
rack = Rack.objects.all().first()

response = self.client.get(f"/dcim/racks/{rack.pk}/reorder/")
Expand Down

0 comments on commit 386695a

Please sign in to comment.