Skip to content

Commit afb4c9b

Browse files
Merge pull request #4425 from MicrosoftEdge/victorhuang/add-update-low-priority-workflow
Add workflow to tag low priority items
2 parents 375cab4 + 7da9624 commit afb4c9b

File tree

2 files changed

+82
-8
lines changed

2 files changed

+82
-8
lines changed

.github/workflows/tagPriorityLow.yml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
name: update low priority items based on ADO query
1+
name: tag low priority issues
22

33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
issues: write
8+
69
jobs:
7-
update-low-priority-items:
10+
tag-low-priority-issues:
811
runs-on: ubuntu-latest
912
steps:
10-
- uses: actions/setup-node@v3
13+
- uses: actions/setup-node@v4
1114
with:
1215
node-version: '20.x'
1316
- run: npm install azure-devops-node-api
1417
- uses: actions/github-script@v7
1518
env:
1619
ado_token: '${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}'
17-
query_id: '${{ secrets.ADO_QUERY_ID }}'
20+
query_id: '6777cf01-7065-42ca-99ca-ba0d7b77d8fd'
1821
with:
1922
script: |
2023
const azdev = require('azure-devops-node-api')
21-
24+
25+
// Get the ADO client
2226
try {
2327
const orgUrl = "https://dev.azure.com/microsoft";
2428
const adoAuthHandler = azdev.getPersonalAccessTokenHandler(process.env.ado_token);
@@ -30,5 +34,53 @@ jobs:
3034
return;
3135
}
3236
37+
// Querying Lastest Work Items
3338
const queryResult = await adoClient.queryById(process.env.query_id);
34-
console.log(queryResult);
39+
40+
// Iterate over work items, including relations
41+
// https://github.com/microsoft/azure-devops-node-api/blob/master/api/interfaces/WorkItemTrackingInterfaces.ts#L1485
42+
const workItemsDetails = await adoClient.getWorkItems(queryResult.workItems.map(wi => wi.id), null, null, 1);
43+
44+
// Obtain GitHub Issue Number
45+
function getGitHubIssueNumber(workItem) {
46+
47+
// Try using relations
48+
const relation = workItem.relations.find(r => r.rel === 'Hyperlink' && r.url.includes('github.com'));
49+
if (relation) {
50+
const match = relation.url.match(/github.com\/[^/]+\/[^/]+\/issues\/(\d+)/);
51+
if (match) {
52+
return match[1];
53+
}
54+
}
55+
56+
// Try using the title, which includes [GitHub #123]
57+
const match = workItem.fields['System.Title'].match(/\[GitHub #(\d+)\]/);
58+
if (match) {
59+
return match[1];
60+
}
61+
62+
return null;
63+
}
64+
65+
// Map ADO work items to GitHub number, remove nulls
66+
const ghIssueNumbers = workItemsDetails.map(wi => getGitHubIssueNumber(wi)).filter(n => n !== null);
67+
68+
// Add priority-low label to GitHub issues
69+
const addLowPriorityLabel = async (issueNumber) => {
70+
await github.rest.issues.addLabels({
71+
issue_number: issueNumber,
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
labels: ['priority-low']
75+
});
76+
}
77+
78+
ghIssueNumbers.forEach(async (issueNumber) => {
79+
await addLowPriorityLabel(issueNumber);
80+
});
81+
82+
core.setOutput('Tagged Issues', ghIssueNumbers.join(','));
83+
84+
85+
86+

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<style>
2+
.label {
3+
border: none;
4+
color: white;
5+
padding: 1px 6px;
6+
text-align: center;
7+
display: inline-block;
8+
cursor: pointer;
9+
font-size: 11px;
10+
border-radius: 12px; /* Add rounded corners */
11+
}
12+
</style>
13+
114
# Microsoft Edge WebView2
215

316
Welcome to Microsoft Edge WebView2 feedback repository.
@@ -20,14 +33,23 @@ This is a place for all developers of the [Microsoft Edge WebView2](https://aka.
2033
1. [Search for existing open bugs](https://github.com/MicrosoftEdge/WebView2Feedback/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to avoid duplicates.
2134
1. If you find that your bug is already reported, give it a 👍 reaction, and add a comment with additional details that may help us investigate.
2235
1. If the issue is not already reported, [open a new issue](https://github.com/MicrosoftEdge/WebView2Feedback/issues/new/choose).
23-
1. Tracked issues will be labeled with the `tracked` label. If you see this label, we are aware of the issue and tracking it on our internal backlog.
36+
1. Tracked issues will be labeled with the <span class="label" style="background-color: #008800"> tracked </span> label. If you see this label, we are aware of the issue and tracking it on our internal backlog.
2437

2538
### 💡 How to request a feature
2639

2740
1. [Search for existing feature request](https://github.com/MicrosoftEdge/WebView2Feedback/issues?q=is%3Aissue+is%3Aopen+label%3A%22feature+request%22) to avoid duplicates.
2841
1. If you find a similar feature request, give it a 👍 reaction, and provide additional context into how you would use the feature.
2942
2. If the feature is not already requested, [open a new issue](https://github.com/MicrosoftEdge/WebView2Feedback/issues/new/choose).
30-
1. Tracked issues will be labeled with the `tracked` label. If you see this label, we are aware of the issue and tracking it on our internal backlog.
43+
1. Tracked issues will be labeled with the <span class="label" style="background-color: #008800"> tracked </span> label. If you see this label, we are aware of the issue and tracking it on our internal backlog.
44+
45+
46+
### What do the labels on the issues mean?
47+
48+
- <span class="label" style="background-color: #008800"> tracked </span> We have acknowledged the issue and are tracking it on our internal backlog. We will consider and investigate them in the near future.
49+
- For bugs, it means we think this is an actual product issue.
50+
- For feature requests, it means we consider it to be a valid request.
51+
- <span class="label" style="background-color: #B60205"> regression </span> A behavior that used to work in a previous version of WebView2, but no longer works as expected. We will prioritize this issue higher.
52+
- <span class="label" style="background-color: #006B75"> priority-low </span> We have considered this issue and decided that we will not be able to address it in the near future. Developers are welcomed to provide justifications on this issue for us to revisit the prioritization.
3153

3254
## Code of Conduct
3355
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

0 commit comments

Comments
 (0)