From 9bbdf64e5f78feecfdf740135ac49f7dfd6df92d Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 2 May 2017 17:39:16 +0100 Subject: [PATCH] Include details from the report in the github issue (#15) ... to make triaging easier. --- src/github.com/matrix-org/rageshake/submit.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/github.com/matrix-org/rageshake/submit.go b/src/github.com/matrix-org/rageshake/submit.go index 0076ebe..6c01f68 100644 --- a/src/github.com/matrix-org/rageshake/submit.go +++ b/src/github.com/matrix-org/rageshake/submit.go @@ -323,13 +323,16 @@ func buildGithubIssueRequest(p payload, listingURL string) github.IssueRequest { } } - body := fmt.Sprintf( - "User message:\n```\n%s\n```\nVersion: %s\n[Details](%s) / [Logs](%s)", - p.Text, - p.Version, - listingURL+"/details.log.gz", - listingURL, - ) + var bodyBuf bytes.Buffer + fmt.Fprintf(&bodyBuf, "User message:\n```\n%s\n```\n", p.Text) + for k, v := range p.Data { + fmt.Fprintf(&bodyBuf, "%s: `%s`\n", k, v) + } + if p.Version != "" { + fmt.Fprintf(&bodyBuf, "Version: `%s`\n", p.Version) + } + fmt.Fprintf(&bodyBuf, "[Logs](%s)\n", listingURL) + body := bodyBuf.String() return github.IssueRequest{ Title: &title,