Skip to content

Commit 386695a

Browse files
authored
Merge pull request #9 from minitriga/issue_8
Add cookie cutter template templates
2 parents dfb2b56 + f942401 commit 386695a

File tree

6 files changed

+138
-6
lines changed

6 files changed

+138
-6
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: 🐛 Bug Report
3+
description: Report a reproducible bug in the current release of netbox-reorder-rack
4+
labels: ["type: bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
**NOTE:** This form is only for reporting _reproducible bugs_ in a current netbox-reorder-rack release.
10+
- type: input
11+
attributes:
12+
label: netbox-reorder-rack version
13+
description: What version of netbox-reorder-rack are you currently running?
14+
placeholder: v1.1.0
15+
validations:
16+
required: true
17+
- type: dropdown
18+
attributes:
19+
label: Python version
20+
description: What version of Python are you currently running?
21+
options:
22+
- "3.10"
23+
- "3.11"
24+
- "3.12"
25+
validations:
26+
required: true
27+
- type: textarea
28+
attributes:
29+
label: Steps to Reproduce
30+
description: >
31+
Please provide a minimal working example to demonstrate the bug. Begin with the
32+
initialization of any necessary database objects and clearly enumerate each
33+
operation carried out. Ensure that your example is as concise as possible
34+
while adequately illustrating the issue.
35+
36+
_Please refrain from including any confidential or sensitive
37+
information in your example._
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Expected Behavior
43+
description: What did you expect to happen?
44+
placeholder: The script should execute without raising any errors or exceptions
45+
validations:
46+
required: true
47+
- type: textarea
48+
attributes:
49+
label: Observed Behavior
50+
description: What happened instead?
51+
placeholder: A TypeError exception was raised
52+
validations:
53+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reference: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2+
blank_issues_enabled: false
3+
contact_links:
4+
- name: 💬 Community Slack
5+
url: https://netdev.chat
6+
about: "Join #netbox on the NetDev Community Slack for assistance with installation issues and other problems."
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: ✨ Feature Request
3+
description: Propose a new netbox-reorder-rack feature or enhancement
4+
labels: ["type: feature"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
**NOTE:** This form is only for submitting well-formed proposals to extend or modify
10+
netbox-reorder-rack in some way.
11+
- type: input
12+
attributes:
13+
label: netbox-reorder-rack version
14+
description: What version of netbox-reorder-rack are you currently running?
15+
placeholder: v0.2.0
16+
validations:
17+
required: true
18+
- type: dropdown
19+
attributes:
20+
label: Feature type
21+
options:
22+
- Data model extension
23+
- New functionality
24+
- Change to existing functionality
25+
validations:
26+
required: true
27+
- type: textarea
28+
attributes:
29+
label: Proposed functionality
30+
description: >
31+
Describe in detail the new feature or behavior you are proposing. Include any specific changes
32+
to work flows, data models, and/or the user interface. The more detail you provide here, the
33+
greater chance your proposal has of being discussed. Feature requests which don't include an
34+
actionable implementation plan will be rejected.
35+
validations:
36+
required: true
37+
- type: textarea
38+
attributes:
39+
label: Use case
40+
description: >
41+
Explain how adding this functionality would benefit netbox-reorder-rack users. What need does it address?
42+
validations:
43+
required: true
44+
- type: textarea
45+
attributes:
46+
label: External dependencies
47+
description: >
48+
List any new dependencies on external libraries or services that this new feature would
49+
introduce. For example, does the proposal require the installation of a new Python package?
50+
(Not all new features introduce new dependencies.)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: 🏡 Housekeeping
3+
description: A change pertaining to the codebase itself (developers only)
4+
labels: ["type: housekeeping"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
**NOTE:** This template is for use by maintainers only. Please do not submit
10+
an issue using this template unless you have been specifically asked to do so.
11+
- type: textarea
12+
attributes:
13+
label: Proposed Changes
14+
description: >
15+
Describe in detail the new feature or behavior you'd like to propose.
16+
Include any specific changes to work flows, data models, or the user interface.
17+
validations:
18+
required: true
19+
- type: textarea
20+
attributes:
21+
label: Justification
22+
description: Please provide justification for the proposed change(s).
23+
validations:
24+
required: true

netbox_reorder_rack/tests/test_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from core.models import ObjectType
12
from dcim.models import Device
23
from dcim.models import DeviceRole
34
from dcim.models import DeviceType
45
from dcim.models import Manufacturer
56
from dcim.models import Rack
67
from dcim.models import Site
7-
from django.contrib.contenttypes.models import ContentType
88
from users.models import ObjectPermission
99
from utilities.testing import TestCase
1010

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

150149
rack = Rack.objects.get(name="Test Rack 1")
151150
device1 = Device.objects.get(name="Device 1")

netbox_reorder_rack/tests/test_view.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from core.models import ObjectType
2+
from dcim.models import Device
13
from dcim.models import Rack
24
from dcim.models import Site
3-
from django.contrib.contenttypes.models import ContentType
45
from users.models import ObjectPermission
56
from utilities.testing import TestCase
67

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

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

0 commit comments

Comments
 (0)