issue templates (#47108)

This commit is contained in:
commitay
2018-05-15 08:00:31 +10:00
committed by GitHub
parent 6d9d47d50d
commit 2dea9572f8
11 changed files with 7 additions and 162 deletions
-106
View File
@@ -1,106 +0,0 @@
#!/usr/bin/env bash
#
# update_issue_template_urls
#
###
### settings
###
set -e # exit on uncaught error
set +o histexpand # don't expand history expressions
shopt -s nocasematch # case-insensitive regular expressions
###
### constants
###
script_subdir='developer/bin'
template_subdir='doc/issue_templates'
generate_url_script='generate_issue_template_url'
files_to_update=(README.md doc/readme.md doc/reporting_bugs/*)
###
### functions
###
warn () {
local message="$*"
message="${message//\\t/$'\011'}"
message="${message//\\n/$'\012'}"
message="${message%${message##*[![:space:]]}}"
printf "%s\n" "$message" 1>&2
}
die () {
warn "$@"
exit 1
}
usage () {
printf "update_issue_template_urls
Regenerate issue template URLs and update them in relevant files.
Note: docs using issue template URLs must use a specific format.
If the template file is called 'bug_report.md', the URL must be
referenced in the doc as follows:
[Some link text][bug_report_template]
...
[bug_report_template]: (auto-generated-url)
"
}
cd_to_project_root () {
local script_dir git_root
script_dir="$(/usr/bin/dirname "$0")"
cd "$script_dir"
git_root="$(git rev-parse --show-toplevel)"
if [[ -z "$git_root" ]]; then
die "ERROR: Could not find git project root"
fi
cd "$git_root"
}
generate_template_url () {
local template_file="$1"
"$script_subdir/$generate_url_script" "$template_file"
}
update_template_url () {
local template_name="$1"
local template_url="$2"
local escaped_template_url="${template_url/&/\\&}"
/usr/bin/sed -i '' \
-e "s|^\\(\\[${template_name}\\]: \\).*$|\\1${escaped_template_url}|g" \
-- "${files_to_update[@]}"
}
###
### main
###
_update_issue_template_urls () {
local template_file template_name template_url
cd_to_project_root
for template_file in ./$template_subdir/*; do
template_name="${template_file##*/}"
template_name="${template_name%%.*}"
template_url="$(generate_template_url "$template_file")"
update_template_url "$template_name" "$template_url"
done
}
# process args
if [[ $1 =~ ^-+h(elp)?$ ]]; then
usage
exit
fi
# dispatch main
_update_issue_template_urls
-8
View File
@@ -1,8 +0,0 @@
Dead app:
* Insert the name of the cask in the title, after the `:`.
* Insert the name of the cask and a link to it in the body of this issue (example: [`alfred`](https://github.com/caskroom/homebrew-cask/blob/master/Casks/alfred.rb)).
* Insert a link to the page that informs about the app being dead.
* After all that **delete all this pre-inserted template text**.
Failure to follow these instructions may get your issue closed without further explanation. Thank you for taking the time to correctly report the issue.
@@ -1,8 +0,0 @@
Outdated cask:
* Insert the name of the cask in the title, after the `:`.
* Insert the name of the cask and a link to it in the body of this issue (example: [`alfred`](https://github.com/caskroom/homebrew-cask/blob/master/Casks/alfred.rb)).
* Insert the new version of the app.
* After all that **delete all this pre-inserted template text**.
Failure to follow these instructions may get your issue closed without further explanation. Thank you for taking the time to correctly report the issue.
@@ -1,8 +0,0 @@
Outdated cask but cannot find link:
* Insert the name of the cask in the title, after the `:`.
* Insert the name of the cask and a link to it in the body of this issue (example: [`alfred`](https://github.com/caskroom/homebrew-cask/blob/master/Casks/alfred.rb)).
* Insert a detailed explanation of what you tried to do and why you failed to find the download link.
* After all that **delete all this pre-inserted template text**.
Failure to follow these instructions may get your issue closed without further explanation. Thank you for taking the time to correctly report the issue.
@@ -1,8 +0,0 @@
Source not there and cannot find it:
* Insert the name of the cask in the title, after the `:`.
* Insert the name of the cask and a link to it in the body of this issue (example: [`alfred`](https://github.com/caskroom/homebrew-cask/blob/master/Casks/alfred.rb)).
* Insert a detailed explanation of what you tried to do and why you failed to find the new artifact source.
* After all that **delete all this pre-inserted template text**.
Failure to follow these instructions may get your issue closed without further explanation. Thank you for taking the time to correctly report the issue.
@@ -1,8 +0,0 @@
Getting wrong number of arguments and cannot fix:
* Insert the name of the cask in the title, after the `:`.
* Insert the name of the cask and a link to it in the body of this issue (example: [`alfred`](https://github.com/caskroom/homebrew-cask/blob/master/Casks/alfred.rb)).
* Insert a detailed explanation of what you tried to do and the current situation.
* After all that **delete all this pre-inserted template text**.
Failure to follow these instructions may get your issue closed without further explanation. Thank you for taking the time to correctly report the issue.
@@ -8,6 +8,4 @@ Let's bring the cask up to date. Itll likely need a new version, but its p
3. Take a look at the casks version (`brew cask _stanza version {{cask_name}}`) and verify it is indeed outdated.
* If the apps version is `latest`, it means the `url` itself is outdated. It will need to be changed to the new one.
If it is outdated, start by trying to [submit a fix](../../CONTRIBUTING.md#updating-a-cask). If youre having trouble, open an issue [with this template][issue_outdated_cask] explaining your steps so far and why youre having trouble submitting the update.
[issue_outdated_cask]: https://github.com/caskroom/homebrew-cask/issues/new?title=Outdated%20cask%3A%20&body=%0A%2A%20Insert%20the%20name%20of%20the%20cask%20in%20the%20title%2C%20after%20the%20%60%3A%60.%0A%2A%20Insert%20the%20name%20of%20the%20cask%20and%20a%20link%20to%20it%20in%20the%20body%20of%20this%20issue%20%28example%3A%20%5B%60alfred%60%5D%28https%3A%2F%2Fgithub.com%2Fcaskroom%2Fhomebrew-cask%2Fblob%2Fmaster%2FCasks%2Falfred.rb%29%29.%0A%2A%20Insert%20the%20new%20version%20of%20the%20app.%0A%2A%20After%20all%20that%20%2A%2Adelete%20all%20this%20pre-inserted%20template%20text%2A%2A.%0A%0AFailure%20to%20follow%20these%20instructions%20may%20get%20your%20issue%20closed%20without%20further%20explanation.%20Thank%20you%20for%20taking%20the%20time%20to%20correctly%20report%20the%20issue.%0A
If it is outdated, start by trying to [submit a fix](../../CONTRIBUTING.md#updating-a-cask). If youre having trouble, [open an issue](https://github.com/caskroom/homebrew-cask/issues/new?template=01_bug_report.md) explaining your steps so far and why youre having trouble submitting the update.
@@ -3,8 +3,7 @@
There are a few reasons why you might not be finding a download:
* You cant access the vendors website at all. [Continue here](curl_error_fix_wont_fix.md).
* You can access the vendors site but theyre informing you the app is now discontinued. Submit a pull request deleting the cask or open an issue [with this template][issue_dead_app] informing us of the situation.
* You can access the vendors site but you cannot find the download link. [Open an issue][issue_outdated_cask_but_cannot_find_link] and detail all your steps so far.
* You can access the vendors site but theyre informing you the app is now discontinued. Submit a pull request deleting the cask or [open an issue][01_bug_report] informing us of the situation.
* You can access the vendors site but you cannot find the download link. [Open an issue][01_bug_report] and detail all your steps so far.
[issue_dead_app]: https://github.com/caskroom/homebrew-cask/issues/new?title=Dead%20app%3A%20&body=%0A%2A%20Insert%20the%20name%20of%20the%20cask%20in%20the%20title%2C%20after%20the%20%60%3A%60.%0A%2A%20Insert%20the%20name%20of%20the%20cask%20and%20a%20link%20to%20it%20in%20the%20body%20of%20this%20issue%20%28example%3A%20%5B%60alfred%60%5D%28https%3A%2F%2Fgithub.com%2Fcaskroom%2Fhomebrew-cask%2Fblob%2Fmaster%2FCasks%2Falfred.rb%29%29.%0A%2A%20Insert%20a%20link%20to%20the%20page%20that%20informs%20about%20the%20app%20being%20dead.%0A%2A%20After%20all%20that%20%2A%2Adelete%20all%20this%20pre-inserted%20template%20text%2A%2A.%0A%0AFailure%20to%20follow%20these%20instructions%20may%20get%20your%20issue%20closed%20without%20further%20explanation.%20Thank%20you%20for%20taking%20the%20time%20to%20correctly%20report%20the%20issue.%0A
[issue_outdated_cask_but_cannot_find_link]: https://github.com/caskroom/homebrew-cask/issues/new?title=Outdated%20cask%20but%20cannot%20find%20link%3A%20&body=%0A%2A%20Insert%20the%20name%20of%20the%20cask%20in%20the%20title%2C%20after%20the%20%60%3A%60.%0A%2A%20Insert%20the%20name%20of%20the%20cask%20and%20a%20link%20to%20it%20in%20the%20body%20of%20this%20issue%20%28example%3A%20%5B%60alfred%60%5D%28https%3A%2F%2Fgithub.com%2Fcaskroom%2Fhomebrew-cask%2Fblob%2Fmaster%2FCasks%2Falfred.rb%29%29.%0A%2A%20Insert%20a%20detailed%20explanation%20of%20what%20you%20tried%20to%20do%20and%20why%20you%20failed%20to%20find%20the%20download%20link.%0A%2A%20After%20all%20that%20%2A%2Adelete%20all%20this%20pre-inserted%20template%20text%2A%2A.%0A%0AFailure%20to%20follow%20these%20instructions%20may%20get%20your%20issue%20closed%20without%20further%20explanation.%20Thank%20you%20for%20taking%20the%20time%20to%20correctly%20report%20the%20issue.%0A
[01_bug_report]: https://github.com/caskroom/homebrew-cask/issues/new?template=01_bug_report.md
@@ -6,6 +6,4 @@ Since the download started, it likely means the cask is outdated. Let's fix it:
2. Take a look at the casks version (`brew cask _stanza version {{cask_name}}`) and verify it is indeed outdated.
* If the apps version is `latest`, it means the `url` itself is outdated. It will need to be changed to the new one.
If it is outdated, start by trying to [submit a fix](../../CONTRIBUTING.md#updating-a-cask). If youre having trouble, open an issue [with this template][issue_outdated_cask] explaining your steps so far and why youre having trouble submitting the update.
[issue_outdated_cask]: https://github.com/caskroom/homebrew-cask/issues/new?title=Outdated%20cask%3A%20&body=%0A%2A%20Insert%20the%20name%20of%20the%20cask%20in%20the%20title%2C%20after%20the%20%60%3A%60.%0A%2A%20Insert%20the%20name%20of%20the%20cask%20and%20a%20link%20to%20it%20in%20the%20body%20of%20this%20issue%20%28example%3A%20%5B%60alfred%60%5D%28https%3A%2F%2Fgithub.com%2Fcaskroom%2Fhomebrew-cask%2Fblob%2Fmaster%2FCasks%2Falfred.rb%29%29.%0A%2A%20Insert%20the%20new%20version%20of%20the%20app.%0A%2A%20After%20all%20that%20%2A%2Adelete%20all%20this%20pre-inserted%20template%20text%2A%2A.%0A%0AFailure%20to%20follow%20these%20instructions%20may%20get%20your%20issue%20closed%20without%20further%20explanation.%20Thank%20you%20for%20taking%20the%20time%20to%20correctly%20report%20the%20issue.%0A
If it is outdated, start by trying to [submit a fix](../../CONTRIBUTING.md#updating-a-cask). If youre having trouble, [open an issue](https://github.com/caskroom/homebrew-cask/issues/new?template=01_bug_report.md) explaining your steps so far and why youre having trouble submitting the update.
@@ -23,6 +23,4 @@ The cask was expecting `SomeApp.app` to be in the top directory of the archive (
Note that occasionally the apps name changes completely (from `SomeApp.app` to `OtherApp.app`, let's say). In these instances, the filename of the cask itself, as well as its token, must also change. Consult the [`token reference`](https://github.com/caskroom/homebrew-cask/blob/master/doc/cask_language_reference/token_reference.md) for complete instructions on the new name.
Follow the instructions to [submit a fix](../../CONTRIBUTING.md#updating-a-cask), and make the change to the cask. If using `cask-repair`, you may give it the `--edit-cask` flag when calling it on the command-line to step right into editing it. If youre having trouble, open an issue [with this template][issue_source_not_there_and_cannot_find_it] explaining your steps so far and why youre having trouble submitting the update.
[issue_source_not_there_and_cannot_find_it]: https://github.com/caskroom/homebrew-cask/issues/new?title=Source%20not%20there%20and%20cannot%20find%20it%3A%20&body=%0A%2A%20Insert%20the%20name%20of%20the%20cask%20in%20the%20title%2C%20after%20the%20%60%3A%60.%0A%2A%20Insert%20the%20name%20of%20the%20cask%20and%20a%20link%20to%20it%20in%20the%20body%20of%20this%20issue%20%28example%3A%20%5B%60alfred%60%5D%28https%3A%2F%2Fgithub.com%2Fcaskroom%2Fhomebrew-cask%2Fblob%2Fmaster%2FCasks%2Falfred.rb%29%29.%0A%2A%20Insert%20a%20detailed%20explanation%20of%20what%20you%20tried%20to%20do%20and%20why%20you%20failed%20to%20find%20the%20new%20artifact%20source.%0A%2A%20After%20all%20that%20%2A%2Adelete%20all%20this%20pre-inserted%20template%20text%2A%2A.%0A%0AFailure%20to%20follow%20these%20instructions%20may%20get%20your%20issue%20closed%20without%20further%20explanation.%20Thank%20you%20for%20taking%20the%20time%20to%20correctly%20report%20the%20issue.%0A
Follow the instructions to [submit a fix](../../CONTRIBUTING.md#updating-a-cask), and make the change to the cask. If using `cask-repair`, you may give it the `--edit-cask` flag when calling it on the command-line to step right into editing it. If youre having trouble, [open an issue](https://github.com/caskroom/homebrew-cask/issues/new?template=01_bug_report.md) explaining your steps so far and why youre having trouble submitting the update.
@@ -2,6 +2,4 @@
Make sure the issue really lies with your macOS version. To do so, try to install the software manually. If it is incompatible with your macOS version, it will tell you. In that case, there is nothing we can do to help you install the software, but we can add a [`depends_on macos:`](https://github.com/caskroom/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/depends_on.md#depends_on-macos) stanza to prevent the cask from trying to install on incompatible macOS versions.
Follow the instructions to [submit a fix](../../CONTRIBUTING.md#updating-a-cask), and make the change to the cask. If using `cask-repair`, you may give it the `--edit-cask` flag when calling it on the command-line to step right into editing it. If youre having trouble submitting the fix or manually installing the software worked without a problem, open an issue [with this template][issue_wrong_number_of_arguments] explaining your steps so far and the current situation.
[issue_wrong_number_of_arguments]: https://github.com/caskroom/homebrew-cask/issues/new?title=Getting%20wrong%20number%20of%20arguments%20and%20cannot%20fix%3A&body=%0A%2A%20Insert%20the%20name%20of%20the%20cask%20in%20the%20title%2C%20after%20the%20%60%3A%60.%0A%2A%20Insert%20the%20name%20of%20the%20cask%20and%20a%20link%20to%20it%20in%20the%20body%20of%20this%20issue%20%28example%3A%20%5B%60alfred%60%5D%28https%3A%2F%2Fgithub.com%2Fcaskroom%2Fhomebrew-cask%2Fblob%2Fmaster%2FCasks%2Falfred.rb%29%29.%0A%2A%20Insert%20a%20detailed%20explanation%20of%20what%20you%20tried%20to%20do%20and%20the%20current%20situation.%0A%2A%20After%20all%20that%20%2A%2Adelete%20all%20this%20pre-inserted%20template%20text%2A%2A.%0A%0AFailure%20to%20follow%20these%20instructions%20may%20get%20your%20issue%20closed%20without%20further%20explanation.%20Thank%20you%20for%20taking%20the%20time%20to%20correctly%20report%20the%20issue.%0A
Follow the instructions to [submit a fix](../../CONTRIBUTING.md#updating-a-cask), and make the change to the cask. If using `cask-repair`, you may give it the `--edit-cask` flag when calling it on the command-line to step right into editing it. If youre having trouble submitting the fix or manually installing the software worked without a problem, [open an issue](https://github.com/caskroom/homebrew-cask/issues/new?template=01_bug_report.md) explaining your steps so far and the current situation.