From fd04d925bfbbb1da6026749436ee56174ce3b889 Mon Sep 17 00:00:00 2001 From: Rick Calixte <10281587+rcalixte@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:12:35 -0400 Subject: [PATCH] Create Feature Request form/template (#935) --- .github/ISSUE_TEMPLATE/02_feature_request.yml | 84 +++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/feature_request_creator.py | 74 ++++++++++++++++ 3 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/02_feature_request.yml create mode 100755 .github/feature_request_creator.py diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml new file mode 100644 index 000000000..fac9c1059 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature_request.yml @@ -0,0 +1,84 @@ +# DO NOT EDIT THIS FILE MANUALLY. +# Execute the script called feature_request_creator.py to generate it. + +--- +body: +- attributes: + value: Thanks for taking the time to fill out this feature request! + type: markdown +- attributes: + default: 0 + label: Desklet name and maintainer + options: + - analog-clock@cobinja.de @cobinja + - battery@schorschii @schorschii + - bbcwx@oak-wood.co.uk @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 + - googleCalendar@javahelps.com @slgobinath + - growattmonitor@jtoberling @jtoberling + - hostcheck@schorschii @schorschii + - InternetTimeDesklet@stefan @stefan12O + - jalalidesklet@30yavash.com + - jira@codeunifier @codeunifier + - kdecdesklet@joejoetv @JoeJoeTV + - mintoo@sujitagarwal @sujitagarwal + - nepalipatro@deeppradhan @kanchudeep + - netusage@30yavash.com @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 + - timelet@linuxedo.com @slgobinath + - top@ryannerd @ryannerd + - ViennaTextBasedWeather@f-istvan @f-istvan + - xkcd@rjanja @rjanja + - yarr@jtoberling @jtoberling + - yfquotes@thegli @thegli + id: desklet + type: dropdown + validations: + required: true +- attributes: + description: Add as many details as possible! + label: What would you like to see? + placeholder: Tell the author what you want to see! + id: feature-request + type: textarea + validations: + required: true +- attributes: + value: '*By submitting this feature request, 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).*' + type: markdown +description: "If you have a feature request \U0001F4A1" +labels: +- feature request +name: "\U0001F680 Desklet Feature Request" +title: Desklet Feature Request diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 19054161f..22dbace55 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,9 +1,9 @@ --- blank_issues_enabled: false contact_links: - - name: 🚀 Feature Request + - name: 💬 Linux Mint Discussions url: https://github.com/orgs/linuxmint/discussions - about: If you have a feature request 💡 + about: Engage with other members of the community. 👋 - name: ❓ Linux Mint Forums url: https://forums.linuxmint.com/ about: Please ask and answer questions here. 🏥 diff --git a/.github/feature_request_creator.py b/.github/feature_request_creator.py new file mode 100755 index 000000000..1a6078bba --- /dev/null +++ b/.github/feature_request_creator.py @@ -0,0 +1,74 @@ +#!/usr/bin/python3 +''' +Generate 02_feature_request.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 feature_request_creator.py to generate it. + +--- +''' + +FEATURE_RQ = {'name': '🚀 Desklet Feature Request', + 'description': "If you have a feature request 💡", + 'title': 'Desklet Feature Request', + 'labels': ['feature request'], + 'body': [{'type': 'markdown', + 'attributes': {'value': 'Thanks for taking the time to fill out this feature request!'}}, + {'type': 'dropdown', 'id': 'desklet', + 'attributes': {'default': 0, + 'label': 'Desklet name and maintainer', + 'options': []}, + 'validations': {'required': True}}, + {'type': 'textarea', 'id': 'feature-request', + 'attributes': {'description': 'Add as many details as possible!', + 'label': 'What would you like to see?', + 'placeholder': 'Tell the author what you want to see!'}, + 'validations': {'required': True}}, + {'type': 'markdown', + 'attributes': {'value': "*By submitting this feature request, 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).*"}}]} + + +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', + '02_feature_request.yml'), 'w', + encoding='utf-8') as feature_request_yaml: + FEATURE_RQ['body'][1]['attributes']['options'] = dropdown_list + + feature_request_yaml.write(HEADER) + yaml.dump(FEATURE_RQ, feature_request_yaml) + + +if __name__ == '__main__': + main()