From f942401e84d4889d244f6c7f5770560a54955a0b Mon Sep 17 00:00:00 2001 From: Alexander Gittings Date: Thu, 9 May 2024 09:29:51 +0000 Subject: [PATCH] Add cookie cutter template templates --- .github/ISSUE_TEMPLATE/bug_report.yaml | 53 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 6 +++ .github/ISSUE_TEMPLATE/feature_request.yaml | 50 +++++++++++++++++++ .github/ISSUE_TEMPLATE/housekeeping.yaml | 24 ++++++++++ netbox_reorder_rack/tests/test_api.py | 5 +- netbox_reorder_rack/tests/test_view.py | 6 +-- 6 files changed, 138 insertions(+), 6 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml create mode 100644 .github/ISSUE_TEMPLATE/housekeeping.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..69823c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..245897a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -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." diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000..7807149 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -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.) diff --git a/.github/ISSUE_TEMPLATE/housekeeping.yaml b/.github/ISSUE_TEMPLATE/housekeeping.yaml new file mode 100644 index 0000000..7778713 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/housekeeping.yaml @@ -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 diff --git a/netbox_reorder_rack/tests/test_api.py b/netbox_reorder_rack/tests/test_api.py index 01b3103..03f7a52 100644 --- a/netbox_reorder_rack/tests/test_api.py +++ b/netbox_reorder_rack/tests/test_api.py @@ -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 @@ -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") diff --git a/netbox_reorder_rack/tests/test_view.py b/netbox_reorder_rack/tests/test_view.py index d3f000a..9d53587 100644 --- a/netbox_reorder_rack/tests/test_view.py +++ b/netbox_reorder_rack/tests/test_view.py @@ -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 @@ -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/")