Skip to content

Commit

Permalink
Migrates Issue Reporting to the New GitHub Template Format (tgstation…
Browse files Browse the repository at this point in the history
…#85909)

## About The Pull Request

Screenshots slightly outdated, check it out here for the latest:
https://github.com/san7890/bruhstation/blob/issue-reporting/.github/ISSUE_TEMPLATE/bug_report_form.yml

Gone are the days of copypasting markdowns and people leaving out
important information! A much cleaner form is upon us!

![image](https://github.com/user-attachments/assets/9639014d-5206-405a-901f-ddcba1f48c1e)

First off, the button will now automatically redirect people to the
forums for feature requests. No more accidental entries through blank
MDs, should be a lot cleaner.

If it is a valid issue report, you'll be navigated to this menu. No more
having to worry about putting comments in the input field as the
important information is fully visible in the form:

<details>
<summary>Template Image</summary>


![image](https://github.com/user-attachments/assets/580a0162-7e99-491d-9dc2-98e0c07e6eaf)
</details>

This will be the end result of filling in all the fields:
<details>
<summary>End Result</summary>


![image](https://github.com/user-attachments/assets/59dd1eb4-29ba-48f4-b989-7cbafcdab5e0)

```md
### Client Version

515.1642

### Issue Summary

insert blank here

### Round ID

_No response_

### Test Merges

perhaps

### Reproduction steps

alirght
```
</details>


I updated the BYOND-side code to ensure that this would work just as it
did prior, auto-filling the applicable fields that we generate ingame.
## Why It's Good For The Game

Far more clarity to people who wish to report issues, no more worrying
about comment formatting, can have mandatory fields, just a cleaner
experience overall.
## Changelog
:cl:
qol: Reporting issues on the Github should now be a far more simpler
experience. Hitting the "Report Issue" button in the top-right of your
BYOND Client Screen will still autofill in the fields as expected.
/:cl:

Ignore how dumb the commit history of this branch is.

---------

Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
san7890 and MrMelbert authored Aug 18, 2024
1 parent 8b0cd15 commit c5de743
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 69 deletions.
29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_form.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Bug Report
description: Create a report to help reproduce and fix the issue.
body:
- type: markdown
attributes:
value: |
# **Please read the following guidelines. Follow all instructions or else your issue is subject to closure.**
## If you use the "Report Issue" button in the top-right corner of the game, it will automatically fill in some of the information below.
If you are reporting an issue found in another branch or codebase, you _must_ link the branch or codebase repo in your issue report or it will be closed.
For branches, If you have not pushed your code up, please either reproduce it on master or push your code up before making an issue report.
For other codebases, if you do not have a public code repository you will be refused help unless you can completely reproduce the issue on our master branch.
- type: input
id: reporting-version
attributes:
label: "Client Version:"
description: |
The BYOND version you are using to report this issue. You can find this information in the bottom left corner of the "About BYOND" window in the BYOND client.
It is strongly recommended that you include this, especially for concerns on the visual aspects of the game.
placeholder: "xxx.xxxx"
validations:
required: false
- type: textarea
id: issue-summary
attributes:
label: "Issue Summary:"
description: |
Briefly explain your issue in a few plain sentences. You may copy and paste the issue title here if it is suitable.
placeholder: |
"When I do X, Y happens instead of Z."
"X on Y map has Z issue."
validations:
required: true
- type: input
id: round-id
attributes:
label: "Round ID:"
description: |
If you discovered this issue from playing tgstation hosted servers, the Round ID can be found in the Status panel or retrieved from https://statbus.space/
The Round ID lets us look up valuable information and logs for the round the bug happened. Leave this blank if there is no round ID.
placeholder: "XXXXXX"
validations:
required: false
- type: textarea
id: test-merges
attributes:
label: "Test Merge Information:"
description: |
If you're certain the issue is to be caused by a test merge [OOC Tab -> Show Server Revision], report it in the pull request's comment section rather than on the tracker.
If you're unsure you can refer to the issue number by prefixing said number with #. The issue number can be found beside the title after submission of this form.
validations:
required: false
- type: textarea
id: reproduction
attributes:
label: "Reproduction Steps:"
description: |
Describe the steps to reproduce the issue in detail. Include any relevant information, such as the map, round type, and any other factors that may be relevant.
If it is a runtime-related error, please include the runtime here as that is pertient information. Issues are not for oddities introduced by admin varedits, ensure these occur in normal circumstances.
placeholder: |
1. Go to the X location
2. Do Y action
3. Observe Z result
validations:
required: true
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Feature Requests
url: https://tgstation13.org/phpBB/viewforum.php?f=9
about: Post feature requests and suggestions on the forums. This repository does not handle them.
7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

66 changes: 33 additions & 33 deletions interface/interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,45 +58,45 @@
set desc = "Report an issue"
set hidden = TRUE
var/githuburl = CONFIG_GET(string/githuburl)
if(githuburl)
var/message = "This will open the Github issue reporter in your browser. Are you sure?"
if(GLOB.revdata.testmerge.len)
message += "<br>The following experimental changes are active and are probably the cause of any new or sudden issues you may experience. If possible, please try to find a specific thread for your issue instead of posting to the general issue tracker:<br>"
message += GLOB.revdata.GetTestMergeInfo(FALSE)
// We still use tgalert here because some people were concerned that if someone wanted to report that tgui wasn't working
// then the report issue button being tgui-based would be problematic.
if(tgalert(src, message, "Report Issue","Yes","No")!="Yes")
return
if(!githuburl)
to_chat(src, span_danger("The Github URL is not set in the server configuration."))
return

// Keep a static version of the template to avoid reading file
var/static/issue_template = file2text(".github/ISSUE_TEMPLATE/bug_report.md")
var/testmerge_data = GLOB.revdata.testmerge
var/has_testmerge_data = (length(testmerge_data) != 0)

// Get a local copy of the template for modification
var/local_template = issue_template
var/message = "This will open the Github issue reporter in your browser. Are you sure?"
if(has_testmerge_data)
message += "<br>The following experimental changes are active and are probably the cause of any new or sudden issues you may experience. If possible, please try to find a specific thread for your issue instead of posting to the general issue tracker:<br>"
message += GLOB.revdata.GetTestMergeInfo(FALSE)

// Remove comment header
var/content_start = findtext(local_template, "<")
if(content_start)
local_template = copytext(local_template, content_start)
// We still use tgalert here because some people were concerned that if someone wanted to report that tgui wasn't working
// then the report issue button being tgui-based would be problematic.
if(tgalert(src, message, "Report Issue","Yes","No") != "Yes")
return

// Insert round
if(GLOB.round_id)
local_template = replacetext(local_template, "## Round ID:\n", "## Round ID:\n[GLOB.round_id]")
var/base_link = githuburl + "/issues/new?template=bug_report_form.yml"
var/list/concatable = list(base_link)

// Insert testmerges
if(GLOB.revdata.testmerge.len)
var/list/all_tms = list()
for(var/entry in GLOB.revdata.testmerge)
var/datum/tgs_revision_information/test_merge/tm = entry
all_tms += "- \[[tm.title]\]([githuburl]/pull/[tm.number])"
var/all_tms_joined = all_tms.Join("\n") // for some reason this can't go in the []
local_template = replacetext(local_template, "## Testmerges:\n", "## Testmerges:\n[all_tms_joined]")
var/client_version = "[byond_version].[byond_build]"
concatable += ("&reporting-version=" + client_version)

// the way it works is that we use the ID's that are baked into the template YML and replace them with values that we can collect in game.
if(GLOB.round_id)
concatable += ("&round-id=" + GLOB.round_id)

// Insert testmerges
if(has_testmerge_data)
var/list/all_tms = list()
for(var/entry in testmerge_data)
var/datum/tgs_revision_information/test_merge/tm = entry
all_tms += "- \[[tm.title]\]([githuburl]/pull/[tm.number])"
var/all_tms_joined = jointext(all_tms, "%0A") // %0A is a newline for URL encoding because i don't trust \n to not break

concatable += ("&test-merges=" + all_tms_joined)

DIRECT_OUTPUT(src, link(jointext(concatable, "")))

var/url_params = "Reporting client version: [byond_version].[byond_build]\n\n[local_template]"
DIRECT_OUTPUT(src, link("[githuburl]/issues/new?body=[url_encode(url_params)]"))
else
to_chat(src, span_danger("The Github URL is not set in the server configuration."))
return

/client/verb/changelog()
set name = "Changelog"
Expand Down

0 comments on commit c5de743

Please sign in to comment.