-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RCF-9 Added issue links to release notes
Implemented by adding a script for post-processing
- Loading branch information
1 parent
46c4038
commit fd8854a
Showing
6 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Jira used the syntax `<project>-<issue_id>` to link PRs to the original task e.g. VP-986 | ||
* Based upon ../samples/post-processing.js | ||
*/ | ||
|
||
const TITLE_REGEX = /^([A-Z]+-\d+) (.*)$/; | ||
const ISSUE_TRACKER_HOST = "https://virdocs.atlassian.net/browse/"; | ||
|
||
module.exports = function (data, callback) { | ||
const rewritten = data.commits.map((commit) => { | ||
const matches = commit.title.match(TITLE_REGEX); | ||
if (matches && matches.length > 2) { | ||
// extra metadata to remember the linked tasks | ||
commit.issue = matches[1]; | ||
commit.issueLink = ISSUE_TRACKER_HOST + commit.issue; | ||
|
||
// remove issue from the title | ||
commit.title = matches[2]; | ||
} | ||
|
||
return commit; | ||
}); | ||
|
||
callback({ | ||
commits: rewritten.filter(Boolean), | ||
// rewrite the range because the template only cares about the newest tag | ||
range: data.range.split('..')[1], | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"title" : "^([a-z]+) #(\\d+) (.*)$", | ||
"meaning" : ["type", "issue", "title"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Release Notes | ||
## <%= range %> | ||
<% commits.forEach(function (commit) { %> | ||
* __[<%= commit.issue %>](<%= commit.issueLink %>) <%= commit.title %>__ | ||
[<%= commit.authorName %>](mailto:<%= commit.authorEmail %>) - <%= commit.committerDate %> | ||
<%= commit.messageLines.join("\n ") %> | ||
<% }) %> |