Skip to content

Commit

Permalink
Create Issue form/template
Browse files Browse the repository at this point in the history
  • Loading branch information
rcalixte committed Oct 5, 2023
1 parent 7bad5d8 commit 88cf726
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 30 deletions.
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE

This file was deleted.

165 changes: 165 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# DO NOT EDIT THIS FILE MANUALLY.
# Execute the script called bug_report_creator.py to generate it.

body:
- attributes:
value: Thanks for taking the time to fill out this bug report!
type: markdown
- attributes:
description: (can be found in "About..." or in `metadata.json`)
label: Desklet version/Build date
placeholder: ex. 4.2.1
id: desklet_version
type: input
validations:
required: false
- attributes:
description: (`cinnamon --version`)
label: Cinnamon version
placeholder: ex. 5.6.3
id: cinnamon_version
type: input
validations:
required: true
- attributes:
description: (Mint 21.2, Arch, Fedora 38)
label: Distribution
placeholder: ex. Mint 21.2
id: distribution
type: input
validations:
required: true
- attributes:
description: (AMD/NVIDIA/Intel and nouveau/kernel/package(s))
label: Graphics hardware *and* driver used
placeholder: ex. NVIDIA GeForce RTX 4060 and nouveau
id: graphics
type: input
validations:
required: true
- attributes:
label: Snippet or attachment of `~/.cinnamon/glass.log`
id: glass-log
type: textarea
validations:
required: false
- attributes:
label: Snippet or attachment of `~/.xsession-errors`
id: xsession-errors
type: textarea
validations:
required: false
- attributes:
default: 0
label: Desklet name and maintainer
options:
- [email protected] @cobinja
- battery@schorschii @schorschii
- [email protected] @tipichris
- binaryclock2@euxneks
- calc@ptandler @ptandler
- calculator@scollins @schorschii
- calendar@deeppradhan @kanchudeep
- calendar@schorschii @schorschii
- clock@schorschii @schorschii
- clocket@tirtha @tirtharajsinha
- clockTow@armandobs14
- commandOfTheDay@logg
- commandResult@ZimiZones @ZimiZones
- cpuload@kimse @ipimpat
- cryptocoins@pbojan @pbojan
- deskNote@BrainAxe @BrainAxe
- devTools@scollins @collinss
- diskspace@schorschii @schorschii
- dual-datetime@rcalixte @rcalixte
- eKreta@thegergo02 @thegergo02
- ganjine@mohammad-sn @mohammad-sn
- [email protected] @slgobinath
- growattmonitor@jtoberling @jtoberling
- hostcheck@schorschii @schorschii
- InternetTimeDesklet@stefan @stefan12O
- [email protected]
- jira@codeunifier @codeunifier
- kdecdesklet@joejoetv @JoeJoeTV
- mintoo@sujitagarwal @sujitagarwal
- nepalipatro@deeppradhan @kanchudeep
- [email protected] @pdcurtis
- notes@schorschii @schorschii
- panchang@india @OnlineLearningTutorials
- quoteOfTheDay@tinnu @JessW
- reddit-reader@orangeshark
- SevenSegmentClock@lxs242 @lxs242
- show-remote-ip-desklet@nejdetckenobi @nejdetckenobi
- shutdown@phpdreamer
- simple-system-monitor@ariel @arielandrade
- soundBox@scollins @collinss
- system-monitor-graph@rcassani @rcassani
- temperature@india @OnlineLearningTutorials
- temperature@swalladge @swalladge
- TimeAndDate@nightflame
- [email protected] @slgobinath
- top@ryannerd @ryannerd
- ViennaTextBasedWeather@f-istvan @f-istvan
- xkcd@rjanja @rjanja
- yfquotes@thegli @thegli
id: desklet
type: dropdown
validations:
required: true
- attributes:
description: Please copy and paste any relevant log output. This will be automatically
formatted into code, so no need for backticks.
label: Relevant log output
render: shell
id: logs
type: textarea
validations:
required: false
- attributes:
description: Also tell us, what did you expect to happen?
label: What happened?
placeholder: Tell us what you see!
value: A bug happened!
id: what-happened
type: textarea
validations:
required: true
- attributes:
description: How can this problem be reproduced?
label: Steps to reproduce
placeholder: 1. Click or type somewhere...
id: reproduce
type: textarea
validations:
required: true
- attributes:
description: What should have happened
label: Expected behaviour
placeholder: No bugs...
id: expected
type: textarea
validations:
required: true
- attributes:
description: Anything else that might help get this fixed faster
label: Other information
placeholder: Extra details...
id: other
type: textarea
validations:
required: false
- attributes:
description: By submitting this issue, you agree to behave respectfully and in
a mature manner. If in doubt, refer to the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule)
and [Github's Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines).
label: Code of Conduct
options:
- label: I agree to follow this project's Code of Conduct
required: true
id: terms
type: checkboxes
description: "If something isn't working, file a report. \U0001F527"
labels:
- bug
name: "\U0001F41C Desklet Bug Report"
title: 'desklet@author: Bug'
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
blank_issues_enabled: false
contact_links:
- name: 🚀 Feature Request
url: https://github.com/orgs/linuxmint/discussions
about: If you have a feature request 💡
- name: ❓ Linux Mint Forums
url: https://forums.linuxmint.com/
about: Please ask and answer questions here. 🏥
123 changes: 123 additions & 0 deletions .github/bug_report_creator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/usr/bin/python3
'''
Generate 01_bug_report.yml based on repository files
'''

import os
import json
import yaml

dirs_blacklist = ['.git', '.github']

repo_folder = os.path.realpath(os.path.abspath(os.path.join(
os.path.normpath(os.path.join(os.getcwd(), *(['..'] * 1))))))

HEADER = '''# DO NOT EDIT THIS FILE MANUALLY.
# Execute the script called bug_report_creator.py to generate it.
'''

BUG_REPORT = {'name': '🐜 Desklet Bug Report',
'description': "If something isn't working, file a report. 🔧",
'title': 'desklet@author: Bug',
'labels': ['bug'],
'body': [{'type': 'markdown',
'attributes': {'value': 'Thanks for taking the time to fill out this bug report!'}},
{'type': 'input', 'id': 'desklet_version',
'attributes': {'description': '(can be found in "About..." or in `metadata.json`)',
'label': 'Desklet version/Build date',
'placeholder': 'ex. 4.2.1'},
'validations': {'required': False}},
{'type': 'input', 'id': 'cinnamon_version',
'attributes': {'description': '(`cinnamon --version`)',
'label': 'Cinnamon version',
'placeholder': 'ex. 5.6.3'},
'validations': {'required': True}},
{'type': 'input', 'id': 'distribution',
'attributes': {'description': '(Mint 21.2, Arch, Fedora 38)',
'label': 'Distribution',
'placeholder': 'ex. Mint 21.2'},
'validations': {'required': True}},
{'type': 'input', 'id': 'graphics',
'attributes': {'description': '(AMD/NVIDIA/Intel and nouveau/kernel/package(s))',
'label': 'Graphics hardware *and* driver used',
'placeholder': 'ex. NVIDIA GeForce RTX 4060 and nouveau'},
'validations': {'required': True}},
{'type': 'textarea', 'id': 'glass-log',
'attributes': {'label': 'Snippet or attachment of `~/.cinnamon/glass.log`'},
'validations': {'required': False}},
{'type': 'textarea', 'id': 'xsession-errors',
'attributes': {'label': 'Snippet or attachment of `~/.xsession-errors`'},
'validations': {'required': False}},
{'type': 'dropdown', 'id': 'desklet',
'attributes': {'default': 0,
'label': 'Desklet name and maintainer',
'options': []},
'validations': {'required': True}},
{'type': 'textarea', 'id': 'logs',
'attributes': {'description': 'Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.',
'label': 'Relevant log output',
'render': 'shell'},
'validations': {'required': False}},
{'type': 'textarea', 'id': 'what-happened',
'attributes': {'description': 'Also tell us, what did you expect to happen?',
'label': 'What happened?',
'placeholder': 'Tell us what you see!',
'value': 'A bug happened!'},
'validations': {'required': True}},
{'type': 'textarea', 'id': 'reproduce',
'attributes': {'description': 'How can this problem be reproduced?',
'label': 'Steps to reproduce',
'placeholder': '1. Click or type somewhere...'},
'validations': {'required': True}},
{'type': 'textarea', 'id': 'expected',
'attributes': {'description': 'What should have happened',
'label': 'Expected behaviour',
'placeholder': 'No bugs...'},
'validations': {'required': True}},
{'type': 'textarea', 'id': 'other',
'attributes': {'description': 'Anything else that might help get this fixed faster',
'label': 'Other information',
'placeholder': 'Extra details...'},
'validations': {'required': False}},
{'type': 'checkboxes', 'id': 'terms',
'attributes': {'description': "By submitting this issue, you agree to behave respectfully and in a mature manner. If in doubt, refer to the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule) and [Github's Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines).",
'label': 'Code of Conduct',
'options': [{'label': "I agree to follow this project's Code of Conduct",
'required': True}]}}]}


def main():
"""
List the repository directories and retrieve author information.
"""
xlets_and_authors = []

try:
for name in os.listdir(repo_folder):
if name in dirs_blacklist:
continue

info_file_path = os.path.join(repo_folder, name, 'info.json')

if os.path.isfile(info_file_path):
with open(info_file_path, 'r', encoding='utf-8') as info:
file_data = json.load(info)

author_value = file_data.get('author', 'none')
author = '' if author_value == 'none' else f' @{author_value}'

xlets_and_authors.append(f'{name}{author}')
finally:
dropdown_list = sorted(sorted(xlets_and_authors), key=str.casefold)
with open(os.path.join(repo_folder, '.github', 'ISSUE_TEMPLATE',
'01_bug_report.yml'), 'w',
encoding='utf-8') as bug_report_yaml:
BUG_REPORT['body'][7]['attributes']['options'] = dropdown_list

bug_report_yaml.write(HEADER)
yaml.dump(BUG_REPORT, bug_report_yaml)


if __name__ == '__main__':
main()

0 comments on commit 88cf726

Please sign in to comment.