Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
docs: update bug report and add feature request templates (#6)
Browse files Browse the repository at this point in the history
* docs: update bug report template and add config to enable template chooser

* build(deps): add @semantic-release/exec package

* ci: add composite action to install yq

* ci: update the versions of the bug report issue template in release workflow

* docs: add feature request issue template
  • Loading branch information
kieranroneill authored Nov 27, 2023
1 parent a4e0aef commit 8d82130
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Bug
description: File a bug
name: "\U0001F41B Bug Report"
description: "File a bug report"
title: "[Bug]: "
labels: ["🐛 bug"]
labels: ["\U0001F41B bug"]
assignees:
- agoralabs-bot
- kieranroneill
body:
# Welcome
# welcome
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug, all issues are welcome and remember, you're awesome!
# Contact
Thanks for taking the time to fill out this bug report, all issues are welcome and remember, you're awesome!
# contact
- type: input
id: contact
attributes:
Expand All @@ -19,29 +19,32 @@ body:
placeholder: e.g. email@example.com
validations:
required: false
# Version
# version
- type: dropdown
id: version
attributes:
label: Version
description: What version of the software are you running?
options:
- 1.0.0 (Default)
- 1.1.0
- 1.0.0
validations:
required: true
# Platform
# browser
- type: dropdown
id: platform
id: browsers
attributes:
label: What platform are you seeing the problem on?
label: What browser are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Other
# Description
validations:
required: true
# description
- type: textarea
id: description
attributes:
Expand All @@ -51,16 +54,16 @@ body:
value: "A bug happened!"
validations:
required: true
# Steps to reproduce
# steps to reproduce
- type: textarea
id: reproduction
attributes:
label: Steps To Reproduce
description: Use a simple bulleted pointed list of the steps to reproduce.
placeholder: * Light a small spark...
placeholder: "* Light a small spark..."
validations:
required: true
# Expected Results
# expected results
- type: textarea
id: expected
attributes:
Expand All @@ -69,7 +72,7 @@ body:
placeholder: My NFDomain data!
validations:
required: true
# Actual Results
# actual results
- type: textarea
id: actual
attributes:
Expand All @@ -78,12 +81,12 @@ body:
placeholder: The quantum realm is threatened and we must miniaturize to save it!
validations:
required: true
# Logs
# logs
- type: textarea
id: logs
id: browser-console-logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
label: Relevant browser console output
description: Please copy and paste any relevant browser console output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "✨ Feature Request"
description: Suggest an idea or feature for Algorand Provider
title: "[Feature]: "
labels: ["✨ feature"]
assignees: []

body:
# welcome
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request, all features are welcome and remember, you're awesome!
- type: textarea
attributes:
label: What is your idea or feature suggestion?
description: Tell us, what idea or feature you suggest to be added to Algorand Provider.
validations:
required: true

- type: textarea
attributes:
label: Benefits
description: Tell us, how this this will be beneficial to Algorand Provider.
validations:
required: false

- type: textarea
attributes:
label: Where can we find information about this?
description: If you are proposing an integration or third-party plugins, please add relevant links and documentation.
validations:
required: false

- type: dropdown
attributes:
label: Are you willing to provide a PR to address this?
options:
- "Yes"
- "No"
12 changes: 12 additions & 0 deletions .github/actions/install-yq/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Install yq"

description: "Downloads and installs yq"

runs:
using: "composite"
steps:
- name: "📦 Install yq"
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
shell: bash
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v3
- name: "📦 Install yq"
uses: ./.github/actions/install-yq
- name: "📝 Create .npmrc"
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.PUBLISH_PUBLIC_PACKAGES_TOKEN }}" >> .npmrc
Expand Down
8 changes: 7 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"prepareCmd": "./bin/update_issue_templates.sh ${nextRelease.version}"
}
],
[
"@semantic-release/git",
{
"assets": ["package.json", "CHANGELOG.md"],
"assets": [".github/ISSUE_TEMPLATE/bug_report_template.yml", "package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}
],
Expand Down
6 changes: 6 additions & 0 deletions bin/set_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

function set_vars() {
export ERROR_PREFIX='\033[0;31m[ERROR]\033[0m'
export INFO_PREFIX='\033[1;33m[INFO]\033[0m'
}
47 changes: 47 additions & 0 deletions bin/update_issue_templates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

SCRIPT_DIR=$(dirname "${0}")

source "${SCRIPT_DIR}/set_vars.sh"

# Public: Adds the latest version to the issue templates.
#
# $1 - The version to add.
#
# Examples
#
# ./bin/update_issue_templates.sh "1.0.0"
#
# Returns exit code 0 if successful, or 1 if the semantic version is incorrectly formatted.
function main {
local version_included

set_vars

if [ -z "${1}" ]; then
printf "%b no version specified, use: ./bin/update_issue_templates.sh [version] \n" "${ERROR_PREFIX}"
exit 1
fi

# check the input is in semantic version format
if [[ ! "${1}" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
printf "%b invalid semantic version, got '${1}', but should be in the format '1.0.0' \n" "${ERROR_PREFIX}"
exit 1
fi

# printf "%b adding version '%s' to .github/ISSUE_TEMPLATE/bug_report_template.yml \n" "${INFO_PREFIX}" "${1}"
version_included=$(version="${1}" yq '(.body[] | select(.id == "version") | .attributes.options) | contains([env(version)])' "${PWD}/.github/ISSUE_TEMPLATE/bug_report_template.yml")

if ! "${version_included}"; then
printf "%b adding version '%s' to .github/ISSUE_TEMPLATE/bug_report_template.yml \n" "${INFO_PREFIX}" "${1}"
version="${1}" \
yq -i '(.body[] | select(.id == "version") | .attributes.options) = [env(version)] + (.body[] | select(.id == "version") | .attributes.options)' "${PWD}/.github/ISSUE_TEMPLATE/bug_report_template.yml"
else
printf "%b version '%s' already added to .github/ISSUE_TEMPLATE/bug_report_template.yml \n" "${INFO_PREFIX}" "${1}"
fi

exit 0
}

# And so, it begins...
main "$1"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@mdx-js/react": "^1.6.22",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.7",
"@semantic-release/npm": "^9.0.2",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,18 @@
resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-3.0.0.tgz#30a3b97bbb5844d695eb22f9d3aa40f6a92770c2"
integrity sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==

"@semantic-release/exec@^6.0.3":
version "6.0.3"
resolved "https://registry.yarnpkg.com/@semantic-release/exec/-/exec-6.0.3.tgz#d212fdf19633bdfb553de6cb6c7f8781933224db"
integrity sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ==
dependencies:
"@semantic-release/error" "^3.0.0"
aggregate-error "^3.0.0"
debug "^4.0.0"
execa "^5.0.0"
lodash "^4.17.4"
parse-json "^5.0.0"

"@semantic-release/git@^10.0.1":
version "10.0.1"
resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-10.0.1.tgz#c646e55d67fae623875bf3a06a634dd434904498"
Expand Down

0 comments on commit 8d82130

Please sign in to comment.