diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-01-11 21:41:04 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-02-21 12:19:53 +0000 |
commit | e657206a766f0cc48fe93f79bae01739387e2291 (patch) | |
tree | 3210e77bde8bb3c2917f47033b8fc9c11039b9f9 /src | |
parent | 5ffb1c105d1eec3c3f9eaba122fb040001afbe69 (diff) | |
download | qtqa-e657206a766f0cc48fe93f79bae01739387e2291.tar.gz |
createchangelog: fetch bug summaries from Jira
This is only to provide more context for bug-fix patches that do not
have ChangeLog entries. These generally require rewriting in the
changelog anyway, but more context makes it easier.
Change-Id: Ib5141e66720bcce5e0c65d23be9a7e0ad6da547c
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/createchangelog/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/createchangelog/main.go b/src/createchangelog/main.go index 1706b5e..7fc82a5 100644 --- a/src/createchangelog/main.go +++ b/src/createchangelog/main.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/go-version" "github.com/eidolon/wordwrap" + "github.com/andygrunwald/go-jira" ) type commandWithCapturedOutput struct { @@ -245,11 +246,20 @@ func extractBugFix(commitMessage string) (entry changeLogEntry) { } if taskNumber != "" { + wrapper := wordwrap.Wrapper(70, false) entry.text = "[" + taskNumber + "] " + summary if description != "" { - wrapper := wordwrap.Wrapper(70, false) entry.text += "\n" + wordwrap.Indent(wrapper(description), " ", false) } + jiraClient, _ := jira.NewClient(nil, "https://bugreports.qt.io/") + issue, _, err := jiraClient.Issue.Get(taskNumber, nil) + if err != nil { + fmt.Fprintf(os.Stderr, "%s: %s\n", taskNumber, err.Error()) + return + } + if (issue != nil) { + entry.text += "\n" + wordwrap.Indent(wrapper("The bug was: " + issue.Fields.Summary), " ", false) + } } else { entry.text = "" } |