Skip to content

Commit

Permalink
dm side workings
Browse files Browse the repository at this point in the history
  • Loading branch information
san7890 committed Aug 16, 2024
1 parent d000b41 commit 75bb99a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ body:
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, you must 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 repo you will be refused help unless you can completely reproduce the issue on our code.
- type: input
id: reporting-version
attributes:
label: Reporting Version
description: |
The BYOND version you are using to report this issue. You can find this information in the bottom right corner of the BYOND client.
placeholder: "515.1642"
- type: textarea
id: issue-summary
attributes:
Expand Down
26 changes: 10 additions & 16 deletions interface/interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,24 @@
set name = "report-issue"
set desc = "Report an issue"
set hidden = TRUE
var/githuburl = CONFIG_GET(string/githuburl)
var/githuburl = "https://github.com/san7890/bruhstation" //san7890 fix me
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")
if(tgalert(src, message, "Report Issue","Yes","No") != "Yes")
return

// Keep a static version of the template to avoid reading file
var/static/issue_template = file2text(".github/ISSUE_TEMPLATE/bug_report.md")

// Get a local copy of the template for modification
var/local_template = issue_template
var/base_link = githuburl + "/issues/new?template=bug_report_form.yml"
var/list/concatable = list(base_link)

// Remove comment header
var/content_start = findtext(local_template, "<")
if(content_start)
local_template = copytext(local_template, content_start)

// Insert round
// 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)
local_template = replacetext(local_template, "## Round ID:\n", "## Round ID:\n[GLOB.round_id]")
concatable += ("&round-id=" + GLOB.round_id)

// Insert testmerges
if(GLOB.revdata.testmerge.len)
Expand All @@ -90,10 +83,11 @@
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]")

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

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)]"))
DIRECT_OUTPUT(src, link("[githuburl]/issues/new?template=bug_report_form.yml]"))
else
to_chat(src, span_danger("The Github URL is not set in the server configuration."))
return
Expand Down

0 comments on commit 75bb99a

Please sign in to comment.