Skip to content

Commit

Permalink
File better bugs (#11955)
Browse files Browse the repository at this point in the history
* File better bugs

* Better error message
  • Loading branch information
Danny McCormick authored Dec 11, 2019
1 parent 4ba942b commit 3a650e6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ci/file-bugs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const githubPAT = process.env['GITHUB_PAT'];
const azpPAT = process.env['AZP_PAT'];

// Number of bugs an area is allowed to have before a P0 AzDevOps bug is filed.
const bugTolerance = 100;
const bugTolerance = 50;
// Number of stale bugs an area is allowed to have before a P0 AzDevOps bug is filed.
const staleBugTolerance = 10;
// Number of untouched bugs an area is allowed to have before a P0 AzDevOps bug is filed. An untouched bug is one that is both stale and has never been responded to.
Expand Down Expand Up @@ -105,7 +105,7 @@ function getIssuesByLabel(issues, issueType) {
function getIssueUrls(labels) {
var urls = '';
labels.forEach(label => {
urls += `<div>https://github.com/microsoft/azure-pipelines-tasks/issues?q=is%3Aissue+is%3Aopen+label%3Abug+label%3A%22Area%3A+Release%22+label%3A%22${label.replace(': ', '%3A+')}%22</div>`
urls += `<div>https://github.com/microsoft/azure-pipelines-tasks/issues?q=is%3Aissue+is%3Aopen+label%3Abug+label%3A%22${label.replace(': ', '%3A+')}%22</div>`
});

return urls;
Expand Down Expand Up @@ -135,6 +135,16 @@ async function createBug(nodeApi, path, title, message) {
"op": "add",
"path": "/fields/System.AreaPath",
"value": path
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.Common.Priority",
"value": "1"
},
{
"op": "add",
"path": "/fields/System.Tags",
"value": "azure-pipelines-tasks"
}
], 'AzureDevOps', 'Bug');

Expand Down Expand Up @@ -192,7 +202,7 @@ async function fileBugs(bugsByLabel, staleBugsByLabel, untouchedBugsByLabel) {
let bugTitle = `Too many bugs in https://github.com/microsoft/azure-pipelines-tasks`;
// Format message as html so it renders correctly.
let bugMessage =
`<div>The number of bugs assigned to the labels owned by this area path in https://github.com/microsoft/azure-pipelines-tasks has exceeded the number of allowable bugs.</div>
`<div>The number of bugs, stale bugs, and/or untouched stale bugs assigned to the labels owned by this area path in https://github.com/microsoft/azure-pipelines-tasks has exceeded the allowable threshold.</div>
<div><br></div>
<div>Labels owned by this area: ${JSON.stringify(labels)}</div>
<div><br></div>
Expand Down

0 comments on commit 3a650e6

Please sign in to comment.