From a976e9259da303af4a58cddc6b6353884786ab3a Mon Sep 17 00:00:00 2001 From: Georgie Date: Mon, 19 Aug 2019 13:57:03 +0530 Subject: [PATCH 1/5] helpUrl --- Tasks/GitHubReleaseV1/task.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/GitHubReleaseV1/task.json b/Tasks/GitHubReleaseV1/task.json index 147afe52eaeb..bf9565e438f8 100644 --- a/Tasks/GitHubReleaseV1/task.json +++ b/Tasks/GitHubReleaseV1/task.json @@ -3,7 +3,7 @@ "name": "GitHubRelease", "friendlyName": "GitHub Release", "description": "Create, edit, or delete a GitHub release", - "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/github-release", + "helpUrl": "https://aka.ms/AA5vv5o", "helpMarkDown": "[Learn more about this task](https://aka.ms/AA3aeiw)", "category": "Utility", "visibility": [ From 1223e714d1982b5707e632a3ccd7f9c29df84c22 Mon Sep 17 00:00:00 2001 From: Georgie Date: Wed, 21 Aug 2019 12:37:17 +0530 Subject: [PATCH 2/5] Minor changes to GitHubReleaseTask --- .../resources.resjson/en-US/resources.resjson | 4 +-- .../GitHubReleaseV0/Tests/ChangeLogL0Tests.ts | 2 +- Tasks/GitHubReleaseV0/operations/ChangeLog.ts | 27 ++++++++++--------- Tasks/GitHubReleaseV0/task.json | 10 +++---- Tasks/GitHubReleaseV0/task.loc.json | 6 ++--- .../resources.resjson/en-US/resources.resjson | 4 +-- .../GitHubReleaseV1/Tests/ChangeLogL0Tests.ts | 2 +- Tasks/GitHubReleaseV1/operations/ChangeLog.ts | 27 ++++++++++--------- Tasks/GitHubReleaseV1/task.json | 8 +++--- Tasks/GitHubReleaseV1/task.loc.json | 6 ++--- 10 files changed, 51 insertions(+), 45 deletions(-) diff --git a/Tasks/GitHubReleaseV0/Strings/resources.resjson/en-US/resources.resjson b/Tasks/GitHubReleaseV0/Strings/resources.resjson/en-US/resources.resjson index 5b280c5d951a..5e6bf87d2f8c 100644 --- a/Tasks/GitHubReleaseV0/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/GitHubReleaseV0/Strings/resources.resjson/en-US/resources.resjson @@ -15,7 +15,7 @@ "loc.input.label.tagSource": "Tag source", "loc.input.help.tagSource": "Specify the tag to be used for release creation. The 'Git tag' option automatically takes the tag which is associated with the Git commit. Use the 'User specified tag' option to manually provide a tag.", "loc.input.label.tagPattern": "Tag Pattern", - "loc.input.help.tagPattern": "Specify the regex for tag to be used for release creation.", + "loc.input.help.tagPattern": " Specify the git tag pattern using regex(Eg. `release-v1.*`). GitHub release will be created only for commits that have matching git tag. ", "loc.input.label.tag": "Tag", "loc.input.help.tag": "Specify the tag for which to create, edit, or delete a release. You can also use a variable here. E.g. `$(myTagName)`.", "loc.input.label.title": "Release title", @@ -66,7 +66,7 @@ "loc.messages.MissingAssetError": "File not found: %s", "loc.messages.MultipleReleasesFoundError": "Only 1 release was expected but more than 1 release was found for tag: %s. Unable to perform the action.", "loc.messages.MultipleTagFound": "Only 1 tag was expected but more than 1 tag was found for the given commit: %s. Unable to perform the action.", - "loc.messages.NoTagFound": "Release will not be created as no tags could be found for the target commit. For more details check out the ‘Tag Source’ section in documentation: https://aka.ms/AA4f03a.", + "loc.messages.NoTagFound": "Release will not be created as the tags for the target commit do not match with the given tag pattern.", "loc.messages.DeleteAllExistingAssets": "Deleting all existing assets...", "loc.messages.DuplicateAssetFound": "Duplicate asset found: %s", "loc.messages.AssetsDeletedSuccessfully": "Assets deleted successfully.", diff --git a/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts b/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts index 638293c568fa..13d3dd5fa774 100644 --- a/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts +++ b/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts @@ -44,7 +44,7 @@ export class ChangeLogL0Tests { public static readonly expectedCommitBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* xyz Fixing issue #56. [ #9 ]\n* abc Fixing issue #2 #3. [ #4, #5 ]\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; public static readonly expectedAllIssuesChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* #1: Incorrect color contrast in control panel\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; - public static readonly expectedIssueBasedChanges = "\n\n## Closed UX Issues/PRs:\n\n\n* #1: Incorrect color contrast in control panel\n\n\n## Open Bugs:\n\n\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; + public static readonly expectedIssueBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n\n### Closed UX Issues/PRs:\n\n\n* #1: Incorrect color contrast in control panel\n\n### Open Bugs:\n\n\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; } diff --git a/Tasks/GitHubReleaseV0/operations/ChangeLog.ts b/Tasks/GitHubReleaseV0/operations/ChangeLog.ts index 83c959407ea7..dd86b2843bc1 100644 --- a/Tasks/GitHubReleaseV0/operations/ChangeLog.ts +++ b/Tasks/GitHubReleaseV0/operations/ChangeLog.ts @@ -132,13 +132,15 @@ export class ChangeLog { tl.debug("Group wise issues : " + JSON.stringify(groupedIssuesDictionary)); Object.keys(groupedIssuesDictionary).forEach((group: string) => { if (groupedIssuesDictionary[group].length === 0) return; - let changeLogGroupTitle = util.format(this._changeLogTitleFormat, group); - if (index >= this._changeLogVisibleLimit) { - seeMoreChangeLog = seeMoreChangeLog + changeLogGroupTitle + Delimiters.newLine; - } - else { - topXChangeLog = topXChangeLog + changeLogGroupTitle + Delimiters.newLine; - index++; + if (index > 0 || group!= this._defaultGroup){ + let changeLogGroupTitle = util.format(this._groupTitleFormat, group); + if (index >= this._changeLogVisibleLimit) { + seeMoreChangeLog = seeMoreChangeLog + changeLogGroupTitle + Delimiters.newLine; + } + else { + topXChangeLog = topXChangeLog + changeLogGroupTitle + Delimiters.newLine; + index++; + } } groupedIssuesDictionary[group].forEach(issueDetails => { let changeLogPerIssue: string = this._getChangeLogPerIssue(issueDetails.id, issueDetails.issue); @@ -151,7 +153,7 @@ export class ChangeLog { } }); }); - changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog, false); + changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog); console.log(tl.loc("ComputingChangeLogSuccess")); return changeLog; } @@ -199,7 +201,7 @@ export class ChangeLog { topXChangeLog = topXChangeLog + changeLogPerIssue + Delimiters.newLine; } }); - changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog, true); + changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog); console.log(tl.loc("ComputingChangeLogSuccess")); return changeLog; } @@ -234,7 +236,7 @@ export class ChangeLog { topXChangeLog = topXChangeLog + changeLogPerCommit + Delimiters.newLine; } }); - changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog, true); + changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog); console.log(tl.loc("ComputingChangeLogSuccess")); return changeLog; } @@ -644,10 +646,10 @@ export class ChangeLog { return ""; } - private _generateChangeLog(topXChangeLog: string, seeMoreChangeLog: string, includeDefaultTitle: boolean): string { + private _generateChangeLog(topXChangeLog: string, seeMoreChangeLog: string): string { let changeLog: string = ""; if (topXChangeLog) { - changeLog = (includeDefaultTitle ? util.format(this._changeLogTitleFormat, this._changeLogTitle) : "") + topXChangeLog; + changeLog = util.format(this._changeLogTitleFormat, this._changeLogTitle) + topXChangeLog; if(!seeMoreChangeLog) { changeLog = changeLog + Delimiters.newLine + this._getAutoGeneratedText(); @@ -691,6 +693,7 @@ export class ChangeLog { private readonly _defaultGroup: string = tl.loc("DefaultCategory"); private readonly _changeLogVisibleLimit: number = 10; private readonly _changeLogTitleFormat: string = "\n\n## %s:\n\n"; + private readonly _groupTitleFormat: string = "\n### %s:\n\n"; private readonly _buildUrlFormat: string = "%s/%s/_build/results?buildId=%s&view=logs"; private readonly _autoGeneratedTextFormat: string = "This list of changes was [auto generated](%s)."; private readonly _seeMoreChangeLogFormat: string = "
%s\n\n%s\n%s
"; // For showing See more button if more than 10 commits message are to be shown to user. diff --git a/Tasks/GitHubReleaseV0/task.json b/Tasks/GitHubReleaseV0/task.json index 67dbdf1e3355..7e8e49087a4f 100644 --- a/Tasks/GitHubReleaseV0/task.json +++ b/Tasks/GitHubReleaseV0/task.json @@ -3,7 +3,7 @@ "name": "GitHubRelease", "friendlyName": "GitHub Release", "description": "Create, edit, or delete a GitHub release", - "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/github-release", + "helpUrl": "https://aka.ms/AA5vv5o", "helpMarkDown": "[Learn more about this task](https://aka.ms/AA3aeiw)", "category": "Utility", "visibility": [ @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 157, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -89,7 +89,7 @@ "label": "Tag Pattern", "required": false, "visibleRule": "tagSource = auto", - "helpMarkDown": "Specify the regex for tag to be used for release creation." + "helpMarkDown": " Specify the git tag pattern using regex(Eg. `release-v1.*`). GitHub release will be created only for commits that have matching git tag. " }, { "name": "tag", @@ -226,7 +226,7 @@ "type": "radio", "label": "Changelog type", "required": true, - "defaultValue": "issueBased", + "defaultValue": "commitBased", "groupName": "changeLogConfiguration", "visibleRule": "addChangeLog = true", "helpMarkDown": "Changelog can be commit based or issue based . Commit based changelog lists all commits included in a release where as Issue based changelog lists all the issues/pr included in the release. ", @@ -283,7 +283,7 @@ "MissingAssetError": "File not found: %s", "MultipleReleasesFoundError": "Only 1 release was expected but more than 1 release was found for tag: %s. Unable to perform the action.", "MultipleTagFound": "Only 1 tag was expected but more than 1 tag was found for the given commit: %s. Unable to perform the action.", - "NoTagFound": "Release will not be created as no tags could be found for the target commit. For more details check out the ‘Tag Source’ section in documentation: https://aka.ms/AA4f03a.", + "NoTagFound": "Release will not be created as the tags for the target commit do not match with the given tag pattern.", "DeleteAllExistingAssets": "Deleting all existing assets...", "DuplicateAssetFound": "Duplicate asset found: %s", "AssetsDeletedSuccessfully": "Assets deleted successfully.", diff --git a/Tasks/GitHubReleaseV0/task.loc.json b/Tasks/GitHubReleaseV0/task.loc.json index a49f7e127e2f..3094bff76950 100644 --- a/Tasks/GitHubReleaseV0/task.loc.json +++ b/Tasks/GitHubReleaseV0/task.loc.json @@ -3,7 +3,7 @@ "name": "GitHubRelease", "friendlyName": "ms-resource:loc.friendlyName", "description": "ms-resource:loc.description", - "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/github-release", + "helpUrl": "https://aka.ms/AA5vv5o", "helpMarkDown": "ms-resource:loc.helpMarkDown", "category": "Utility", "visibility": [ @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 157, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -225,7 +225,7 @@ "type": "radio", "label": "ms-resource:loc.input.label.changeLogType", "required": true, - "defaultValue": "issueBased", + "defaultValue": "commitBased", "groupName": "changeLogConfiguration", "visibleRule": "addChangeLog = true", "helpMarkDown": "ms-resource:loc.input.help.changeLogType", diff --git a/Tasks/GitHubReleaseV1/Strings/resources.resjson/en-US/resources.resjson b/Tasks/GitHubReleaseV1/Strings/resources.resjson/en-US/resources.resjson index a4eb941141a2..dc4a14bce873 100644 --- a/Tasks/GitHubReleaseV1/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/GitHubReleaseV1/Strings/resources.resjson/en-US/resources.resjson @@ -15,7 +15,7 @@ "loc.input.label.tagSource": "Tag source", "loc.input.help.tagSource": "Specify the tag to be used for release creation. The 'Git tag' option automatically takes the tag which is associated with the Git commit. Use the 'User specified tag' option to manually provide a tag.", "loc.input.label.tagPattern": "Tag Pattern", - "loc.input.help.tagPattern": "Specify the regex for tag to be used for release creation.", + "loc.input.help.tagPattern": "Specify the git tag pattern using regex(Eg. `release-v1.*`). GitHub release will be created only for commits that have matching git tag. ", "loc.input.label.tag": "Tag", "loc.input.help.tag": "Specify the tag for which to create, edit, or delete a release. You can also use a variable here. E.g. `$(myTagName)`.", "loc.input.label.title": "Release title", @@ -66,7 +66,7 @@ "loc.messages.MissingAssetError": "File not found: %s", "loc.messages.MultipleReleasesFoundError": "Only 1 release was expected but more than 1 release was found for tag: %s. Unable to perform the action.", "loc.messages.MultipleTagFound": "Only 1 tag was expected but more than 1 tag was found for the given commit: %s. Unable to perform the action.", - "loc.messages.NoTagFound": "Release will not be created as no tags could be found for the target commit. For more details check out the ‘Tag Source’ section in documentation: https://aka.ms/AA4f03a.", + "loc.messages.NoTagFound": "Release will not be created as the tags for the target commit do not match with the given tag pattern", "loc.messages.DeleteAllExistingAssets": "Deleting all existing assets...", "loc.messages.DuplicateAssetFound": "Duplicate asset found: %s", "loc.messages.AssetsDeletedSuccessfully": "Assets deleted successfully.", diff --git a/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts b/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts index 638293c568fa..13d3dd5fa774 100644 --- a/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts +++ b/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts @@ -44,7 +44,7 @@ export class ChangeLogL0Tests { public static readonly expectedCommitBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* xyz Fixing issue #56. [ #9 ]\n* abc Fixing issue #2 #3. [ #4, #5 ]\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; public static readonly expectedAllIssuesChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* #1: Incorrect color contrast in control panel\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; - public static readonly expectedIssueBasedChanges = "\n\n## Closed UX Issues/PRs:\n\n\n* #1: Incorrect color contrast in control panel\n\n\n## Open Bugs:\n\n\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; + public static readonly expectedIssueBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n\n### Closed UX Issues/PRs:\n\n\n* #1: Incorrect color contrast in control panel\n\n### Open Bugs:\n\n\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; } diff --git a/Tasks/GitHubReleaseV1/operations/ChangeLog.ts b/Tasks/GitHubReleaseV1/operations/ChangeLog.ts index 83c959407ea7..dd86b2843bc1 100644 --- a/Tasks/GitHubReleaseV1/operations/ChangeLog.ts +++ b/Tasks/GitHubReleaseV1/operations/ChangeLog.ts @@ -132,13 +132,15 @@ export class ChangeLog { tl.debug("Group wise issues : " + JSON.stringify(groupedIssuesDictionary)); Object.keys(groupedIssuesDictionary).forEach((group: string) => { if (groupedIssuesDictionary[group].length === 0) return; - let changeLogGroupTitle = util.format(this._changeLogTitleFormat, group); - if (index >= this._changeLogVisibleLimit) { - seeMoreChangeLog = seeMoreChangeLog + changeLogGroupTitle + Delimiters.newLine; - } - else { - topXChangeLog = topXChangeLog + changeLogGroupTitle + Delimiters.newLine; - index++; + if (index > 0 || group!= this._defaultGroup){ + let changeLogGroupTitle = util.format(this._groupTitleFormat, group); + if (index >= this._changeLogVisibleLimit) { + seeMoreChangeLog = seeMoreChangeLog + changeLogGroupTitle + Delimiters.newLine; + } + else { + topXChangeLog = topXChangeLog + changeLogGroupTitle + Delimiters.newLine; + index++; + } } groupedIssuesDictionary[group].forEach(issueDetails => { let changeLogPerIssue: string = this._getChangeLogPerIssue(issueDetails.id, issueDetails.issue); @@ -151,7 +153,7 @@ export class ChangeLog { } }); }); - changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog, false); + changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog); console.log(tl.loc("ComputingChangeLogSuccess")); return changeLog; } @@ -199,7 +201,7 @@ export class ChangeLog { topXChangeLog = topXChangeLog + changeLogPerIssue + Delimiters.newLine; } }); - changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog, true); + changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog); console.log(tl.loc("ComputingChangeLogSuccess")); return changeLog; } @@ -234,7 +236,7 @@ export class ChangeLog { topXChangeLog = topXChangeLog + changeLogPerCommit + Delimiters.newLine; } }); - changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog, true); + changeLog = this._generateChangeLog(topXChangeLog, seeMoreChangeLog); console.log(tl.loc("ComputingChangeLogSuccess")); return changeLog; } @@ -644,10 +646,10 @@ export class ChangeLog { return ""; } - private _generateChangeLog(topXChangeLog: string, seeMoreChangeLog: string, includeDefaultTitle: boolean): string { + private _generateChangeLog(topXChangeLog: string, seeMoreChangeLog: string): string { let changeLog: string = ""; if (topXChangeLog) { - changeLog = (includeDefaultTitle ? util.format(this._changeLogTitleFormat, this._changeLogTitle) : "") + topXChangeLog; + changeLog = util.format(this._changeLogTitleFormat, this._changeLogTitle) + topXChangeLog; if(!seeMoreChangeLog) { changeLog = changeLog + Delimiters.newLine + this._getAutoGeneratedText(); @@ -691,6 +693,7 @@ export class ChangeLog { private readonly _defaultGroup: string = tl.loc("DefaultCategory"); private readonly _changeLogVisibleLimit: number = 10; private readonly _changeLogTitleFormat: string = "\n\n## %s:\n\n"; + private readonly _groupTitleFormat: string = "\n### %s:\n\n"; private readonly _buildUrlFormat: string = "%s/%s/_build/results?buildId=%s&view=logs"; private readonly _autoGeneratedTextFormat: string = "This list of changes was [auto generated](%s)."; private readonly _seeMoreChangeLogFormat: string = "
%s\n\n%s\n%s
"; // For showing See more button if more than 10 commits message are to be shown to user. diff --git a/Tasks/GitHubReleaseV1/task.json b/Tasks/GitHubReleaseV1/task.json index bf9565e438f8..50a3c2208503 100644 --- a/Tasks/GitHubReleaseV1/task.json +++ b/Tasks/GitHubReleaseV1/task.json @@ -15,7 +15,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -89,7 +89,7 @@ "label": "Tag Pattern", "required": false, "visibleRule": "tagSource = gitTag", - "helpMarkDown": "Specify the regex for tag to be used for release creation." + "helpMarkDown": "Specify the git tag pattern using regex(Eg. `release-v1.*`). GitHub release will be created only for commits that have matching git tag. " }, { "name": "tag", @@ -226,7 +226,7 @@ "type": "radio", "label": "Changelog type", "required": true, - "defaultValue": "issueBased", + "defaultValue": "commitBased", "groupName": "changeLogConfiguration", "visibleRule": "addChangeLog = true", "helpMarkDown": "Changelog can be commit based or issue based . Commit based changelog lists all commits included in a release where as Issue based changelog lists all the issues/pr included in the release. ", @@ -283,7 +283,7 @@ "MissingAssetError": "File not found: %s", "MultipleReleasesFoundError": "Only 1 release was expected but more than 1 release was found for tag: %s. Unable to perform the action.", "MultipleTagFound": "Only 1 tag was expected but more than 1 tag was found for the given commit: %s. Unable to perform the action.", - "NoTagFound": "Release will not be created as no tags could be found for the target commit. For more details check out the ‘Tag Source’ section in documentation: https://aka.ms/AA4f03a.", + "NoTagFound": "Release will not be created as the tags for the target commit do not match with the given tag pattern", "DeleteAllExistingAssets": "Deleting all existing assets...", "DuplicateAssetFound": "Duplicate asset found: %s", "AssetsDeletedSuccessfully": "Assets deleted successfully.", diff --git a/Tasks/GitHubReleaseV1/task.loc.json b/Tasks/GitHubReleaseV1/task.loc.json index 4bb1724861a3..d3444cc94cbf 100644 --- a/Tasks/GitHubReleaseV1/task.loc.json +++ b/Tasks/GitHubReleaseV1/task.loc.json @@ -3,7 +3,7 @@ "name": "GitHubRelease", "friendlyName": "ms-resource:loc.friendlyName", "description": "ms-resource:loc.description", - "helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/github-release", + "helpUrl": "https://aka.ms/AA5vv5o", "helpMarkDown": "ms-resource:loc.helpMarkDown", "category": "Utility", "visibility": [ @@ -15,7 +15,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -225,7 +225,7 @@ "type": "radio", "label": "ms-resource:loc.input.label.changeLogType", "required": true, - "defaultValue": "issueBased", + "defaultValue": "commitBased", "groupName": "changeLogConfiguration", "visibleRule": "addChangeLog = true", "helpMarkDown": "ms-resource:loc.input.help.changeLogType", From 8f996aa6c5d6b8860c83a774c2f146456343b137 Mon Sep 17 00:00:00 2001 From: Georgie Date: Wed, 21 Aug 2019 14:23:27 +0530 Subject: [PATCH 3/5] minor --- Tasks/GitHubReleaseV0/operations/ChangeLog.ts | 1 + Tasks/GitHubReleaseV0/task.json | 2 +- Tasks/GitHubReleaseV0/task.loc.json | 2 +- Tasks/GitHubReleaseV1/operations/ChangeLog.ts | 1 + Tasks/GitHubReleaseV1/task.json | 2 +- Tasks/GitHubReleaseV1/task.loc.json | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Tasks/GitHubReleaseV0/operations/ChangeLog.ts b/Tasks/GitHubReleaseV0/operations/ChangeLog.ts index dd86b2843bc1..0608268b0737 100644 --- a/Tasks/GitHubReleaseV0/operations/ChangeLog.ts +++ b/Tasks/GitHubReleaseV0/operations/ChangeLog.ts @@ -132,6 +132,7 @@ export class ChangeLog { tl.debug("Group wise issues : " + JSON.stringify(groupedIssuesDictionary)); Object.keys(groupedIssuesDictionary).forEach((group: string) => { if (groupedIssuesDictionary[group].length === 0) return; + //If the only category is the default cateogry, don't add the category title. if (index > 0 || group!= this._defaultGroup){ let changeLogGroupTitle = util.format(this._groupTitleFormat, group); if (index >= this._changeLogVisibleLimit) { diff --git a/Tasks/GitHubReleaseV0/task.json b/Tasks/GitHubReleaseV0/task.json index 7e8e49087a4f..3ace589b0299 100644 --- a/Tasks/GitHubReleaseV0/task.json +++ b/Tasks/GitHubReleaseV0/task.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 157, - "Patch": 1 + "Patch": 0 }, "demands": [], "minimumAgentVersion": "2.0.0", diff --git a/Tasks/GitHubReleaseV0/task.loc.json b/Tasks/GitHubReleaseV0/task.loc.json index 3094bff76950..0b01f814ec4b 100644 --- a/Tasks/GitHubReleaseV0/task.loc.json +++ b/Tasks/GitHubReleaseV0/task.loc.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 157, - "Patch": 1 + "Patch": 0 }, "demands": [], "minimumAgentVersion": "2.0.0", diff --git a/Tasks/GitHubReleaseV1/operations/ChangeLog.ts b/Tasks/GitHubReleaseV1/operations/ChangeLog.ts index dd86b2843bc1..0608268b0737 100644 --- a/Tasks/GitHubReleaseV1/operations/ChangeLog.ts +++ b/Tasks/GitHubReleaseV1/operations/ChangeLog.ts @@ -132,6 +132,7 @@ export class ChangeLog { tl.debug("Group wise issues : " + JSON.stringify(groupedIssuesDictionary)); Object.keys(groupedIssuesDictionary).forEach((group: string) => { if (groupedIssuesDictionary[group].length === 0) return; + //If the only category is the default cateogry, don't add the category title. if (index > 0 || group!= this._defaultGroup){ let changeLogGroupTitle = util.format(this._groupTitleFormat, group); if (index >= this._changeLogVisibleLimit) { diff --git a/Tasks/GitHubReleaseV1/task.json b/Tasks/GitHubReleaseV1/task.json index 50a3c2208503..e01b84efd4be 100644 --- a/Tasks/GitHubReleaseV1/task.json +++ b/Tasks/GitHubReleaseV1/task.json @@ -15,7 +15,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 1 + "Patch": 0 }, "demands": [], "minimumAgentVersion": "2.0.0", diff --git a/Tasks/GitHubReleaseV1/task.loc.json b/Tasks/GitHubReleaseV1/task.loc.json index d3444cc94cbf..b650b93f2f5c 100644 --- a/Tasks/GitHubReleaseV1/task.loc.json +++ b/Tasks/GitHubReleaseV1/task.loc.json @@ -15,7 +15,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 1 + "Patch": 0 }, "demands": [], "minimumAgentVersion": "2.0.0", From f06a3d49bebe4fbc42ea7c2f5735fab112da1531 Mon Sep 17 00:00:00 2001 From: Georgie Date: Wed, 21 Aug 2019 14:42:46 +0530 Subject: [PATCH 4/5] added tests --- Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts | 10 ++++++++++ Tasks/GitHubReleaseV0/Tests/L0.ts | 1 + Tasks/GitHubReleaseV0/Tests/TestStrings.ts | 1 + Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts | 10 ++++++++++ Tasks/GitHubReleaseV1/Tests/L0.ts | 1 + Tasks/GitHubReleaseV1/Tests/TestStrings.ts | 1 + 6 files changed, 24 insertions(+) diff --git a/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts b/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts index 13d3dd5fa774..2e6e8057ddde 100644 --- a/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts +++ b/Tasks/GitHubReleaseV0/Tests/ChangeLogL0Tests.ts @@ -9,6 +9,7 @@ export class ChangeLogL0Tests { await this.validateGetChangeLog3(); await this.validateGetChangeLog4(); await this.validateGetChangeLog5(); + await this.validateGetChangeLog6(); } public static async validateGetChangeLog1() { @@ -42,6 +43,15 @@ export class ChangeLogL0Tests { } } + public static async validateGetChangeLog6(){ + let changeLogLabels = `[{"label": "hello", "displayName": "Closed UX Issues/PRs", "state": "CLOSED"}, {"label" : "nope", "displayName": "Open Bugs", "state": "OPEN"}]`; + let changes = await new ChangeLog().getChangeLog("endpoint", "owner/repo", "target", 250, ChangeLogStartCommit.lastFullRelease, "issueBased", null, JSON.parse(changeLogLabels)); + + if (changes === this.expectedAllIssuesChanges) { + console.log(TestString.noCategoryChangeLog); + } + } + public static readonly expectedCommitBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* xyz Fixing issue #56. [ #9 ]\n* abc Fixing issue #2 #3. [ #4, #5 ]\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; public static readonly expectedAllIssuesChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* #1: Incorrect color contrast in control panel\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; public static readonly expectedIssueBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n\n### Closed UX Issues/PRs:\n\n\n* #1: Incorrect color contrast in control panel\n\n### Open Bugs:\n\n\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; diff --git a/Tasks/GitHubReleaseV0/Tests/L0.ts b/Tasks/GitHubReleaseV0/Tests/L0.ts index e491c9597030..2ea85672ddb3 100644 --- a/Tasks/GitHubReleaseV0/Tests/L0.ts +++ b/Tasks/GitHubReleaseV0/Tests/L0.ts @@ -113,6 +113,7 @@ describe('GitHubReleaseTaskTests Suite', function() { assert(tr.stdout.search(TestString.getChangeLogKeyword) >= 0, 'should have printed: ' + TestString.getChangeLogKeyword); assert(tr.stdout.search(TestString.allIssuesChangeLog) >= 0, 'should have printed: ' + TestString.allIssuesChangeLog); assert(tr.stdout.search(TestString.issueBasedChangeLog) >= 0, 'should have printed: ' + TestString.issueBasedChangeLog); + assert(tr.stdout.search(TestString.noCategoryChangeLog) >= 0, 'should have printed: ' + TestString.noCategoryChangeLog); assert(tr.stdout.search("Tag Name: v1.2") >=0, 'should have printed: TagName: v1.2'); assert(tr.stdout.search("Tag Name: pre_rel") >=0, 'should have printed: TagName: pre_rel'); assert(tr.stdout.search("Tag Name: tagName") >=0, 'should have printed: TagName: tagName'); diff --git a/Tasks/GitHubReleaseV0/Tests/TestStrings.ts b/Tasks/GitHubReleaseV0/Tests/TestStrings.ts index 3aad030433f5..afad94c3cd22 100644 --- a/Tasks/GitHubReleaseV0/Tests/TestStrings.ts +++ b/Tasks/GitHubReleaseV0/Tests/TestStrings.ts @@ -25,4 +25,5 @@ export class TestString { public static readonly tagMatchingKeyword: string = "isTagMatching method should work properly"; public static readonly allIssuesChangeLog: string = "getChangeLog should generate All Issues ChangeLog"; public static readonly issueBasedChangeLog: string = "getChangeLog should generate Issue Based ChangeLog"; + public static readonly noCategoryChangeLog: string = "ChangeLog generated should be a flatlist of issues."; } \ No newline at end of file diff --git a/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts b/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts index 13d3dd5fa774..2e6e8057ddde 100644 --- a/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts +++ b/Tasks/GitHubReleaseV1/Tests/ChangeLogL0Tests.ts @@ -9,6 +9,7 @@ export class ChangeLogL0Tests { await this.validateGetChangeLog3(); await this.validateGetChangeLog4(); await this.validateGetChangeLog5(); + await this.validateGetChangeLog6(); } public static async validateGetChangeLog1() { @@ -42,6 +43,15 @@ export class ChangeLogL0Tests { } } + public static async validateGetChangeLog6(){ + let changeLogLabels = `[{"label": "hello", "displayName": "Closed UX Issues/PRs", "state": "CLOSED"}, {"label" : "nope", "displayName": "Open Bugs", "state": "OPEN"}]`; + let changes = await new ChangeLog().getChangeLog("endpoint", "owner/repo", "target", 250, ChangeLogStartCommit.lastFullRelease, "issueBased", null, JSON.parse(changeLogLabels)); + + if (changes === this.expectedAllIssuesChanges) { + console.log(TestString.noCategoryChangeLog); + } + } + public static readonly expectedCommitBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* xyz Fixing issue #56. [ #9 ]\n* abc Fixing issue #2 #3. [ #4, #5 ]\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; public static readonly expectedAllIssuesChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n* #1: Incorrect color contrast in control panel\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; public static readonly expectedIssueBasedChanges = "\n\n## loc_mock_ChangeLogTitle:\n\n\n### Closed UX Issues/PRs:\n\n\n* #1: Incorrect color contrast in control panel\n\n### Open Bugs:\n\n\n* #2: Text alignment confusing in panel\n* #3: Fixed previous minor bugs\n\nThis list of changes was [auto generated](MOCK_RELEASE_URL)."; diff --git a/Tasks/GitHubReleaseV1/Tests/L0.ts b/Tasks/GitHubReleaseV1/Tests/L0.ts index e491c9597030..2ea85672ddb3 100644 --- a/Tasks/GitHubReleaseV1/Tests/L0.ts +++ b/Tasks/GitHubReleaseV1/Tests/L0.ts @@ -113,6 +113,7 @@ describe('GitHubReleaseTaskTests Suite', function() { assert(tr.stdout.search(TestString.getChangeLogKeyword) >= 0, 'should have printed: ' + TestString.getChangeLogKeyword); assert(tr.stdout.search(TestString.allIssuesChangeLog) >= 0, 'should have printed: ' + TestString.allIssuesChangeLog); assert(tr.stdout.search(TestString.issueBasedChangeLog) >= 0, 'should have printed: ' + TestString.issueBasedChangeLog); + assert(tr.stdout.search(TestString.noCategoryChangeLog) >= 0, 'should have printed: ' + TestString.noCategoryChangeLog); assert(tr.stdout.search("Tag Name: v1.2") >=0, 'should have printed: TagName: v1.2'); assert(tr.stdout.search("Tag Name: pre_rel") >=0, 'should have printed: TagName: pre_rel'); assert(tr.stdout.search("Tag Name: tagName") >=0, 'should have printed: TagName: tagName'); diff --git a/Tasks/GitHubReleaseV1/Tests/TestStrings.ts b/Tasks/GitHubReleaseV1/Tests/TestStrings.ts index 3aad030433f5..afad94c3cd22 100644 --- a/Tasks/GitHubReleaseV1/Tests/TestStrings.ts +++ b/Tasks/GitHubReleaseV1/Tests/TestStrings.ts @@ -25,4 +25,5 @@ export class TestString { public static readonly tagMatchingKeyword: string = "isTagMatching method should work properly"; public static readonly allIssuesChangeLog: string = "getChangeLog should generate All Issues ChangeLog"; public static readonly issueBasedChangeLog: string = "getChangeLog should generate Issue Based ChangeLog"; + public static readonly noCategoryChangeLog: string = "ChangeLog generated should be a flatlist of issues."; } \ No newline at end of file From 2b09c3f0f062e8aea421d3085cbf25255c65c923 Mon Sep 17 00:00:00 2001 From: Georgie Date: Wed, 21 Aug 2019 15:27:38 +0530 Subject: [PATCH 5/5] increasing the patch version --- Tasks/GitHubReleaseV0/task.json | 2 +- Tasks/GitHubReleaseV0/task.loc.json | 2 +- Tasks/GitHubReleaseV1/task.json | 2 +- Tasks/GitHubReleaseV1/task.loc.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tasks/GitHubReleaseV0/task.json b/Tasks/GitHubReleaseV0/task.json index 3ace589b0299..7e8e49087a4f 100644 --- a/Tasks/GitHubReleaseV0/task.json +++ b/Tasks/GitHubReleaseV0/task.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 157, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", diff --git a/Tasks/GitHubReleaseV0/task.loc.json b/Tasks/GitHubReleaseV0/task.loc.json index 0b01f814ec4b..3094bff76950 100644 --- a/Tasks/GitHubReleaseV0/task.loc.json +++ b/Tasks/GitHubReleaseV0/task.loc.json @@ -15,7 +15,7 @@ "version": { "Major": 0, "Minor": 157, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", diff --git a/Tasks/GitHubReleaseV1/task.json b/Tasks/GitHubReleaseV1/task.json index e01b84efd4be..50a3c2208503 100644 --- a/Tasks/GitHubReleaseV1/task.json +++ b/Tasks/GitHubReleaseV1/task.json @@ -15,7 +15,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0", diff --git a/Tasks/GitHubReleaseV1/task.loc.json b/Tasks/GitHubReleaseV1/task.loc.json index b650b93f2f5c..d3444cc94cbf 100644 --- a/Tasks/GitHubReleaseV1/task.loc.json +++ b/Tasks/GitHubReleaseV1/task.loc.json @@ -15,7 +15,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 0 + "Patch": 1 }, "demands": [], "minimumAgentVersion": "2.0.0",