From fa12f52e9d197bcae5075b99e9a558a5c86578a3 Mon Sep 17 00:00:00 2001 From: Mathieu Pillard Date: Wed, 11 Jan 2023 13:25:51 +0100 Subject: [PATCH] Use labels without spaces (#1036) --- components/AMODashCount.js | 14 ++++++------ lib/const.js | 8 +++---- pages/api/gh-contrib-welcome.js | 2 +- pages/api/gh-good-first-bugs.js | 2 +- pages/api/gh-issue-counts.js | 18 +++++++-------- pages/api/gh-maybe-good-first-bugs.js | 2 +- tests/fixtures/gh-contrib-welcome.js | 6 ++--- tests/fixtures/gh-good-first-bugs.js | 6 ++--- tests/fixtures/gh-maybe-good-first-bugs.js | 2 +- tests/fixtures/gh-milestone-issues.js | 26 +++++++++++----------- tests/lib/utils/contrib.test.js | 4 ++-- tests/lib/utils/milestones.test.js | 12 +++++----- 12 files changed, 51 insertions(+), 51 deletions(-) diff --git a/components/AMODashCount.js b/components/AMODashCount.js index ae9119e..ddd8905 100644 --- a/components/AMODashCount.js +++ b/components/AMODashCount.js @@ -10,29 +10,29 @@ export default function AMODashCount(props) { if (props.title.includes('untriaged')) { issuesLink = oneLineTrim`https://github.com/mozilla/${repo}/issues? - utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20-label%3A%22priority%3A%20p1%22%20 - -label%3A%22priority%3A%20p2%22%20-label%3A%22priority%3A%20p3%22%20 - -label%3A%22priority%3A%20p4%22%20-label%3A%22priority%3A%20p5%22`; + utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20-label%3A%22priority%3Ap1%22%20 + -label%3A%22priority%3Ap2%22%20-label%3A%22priority%3Ap3%22%20 + -label%3A%22priority%3Ap4%22%20-label%3A%22priority%3Ap5%22`; warningLimit = 15; } if (props.title.includes('prod_bug')) { issuesLink = oneLineTrim`https://github.com/mozilla/${repo}/issues? - utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22type%3A%20prod_bug%22`; + utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22type%3Aprod_bug%22`; warningLimit = 1; } if (props.title.includes('p1')) { issuesLink = oneLineTrim`https://github.com/mozilla/${repo}/issues? - utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22priority:%20p1%22`; + utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22priority:p1%22`; warningLimit = 1; } if (props.title.includes('p2')) { issuesLink = oneLineTrim`https://github.com/mozilla/${repo}/issues? - utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22priority:%20p2%22`; + utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22priority:p2%22`; warningLimit = 1; } if (props.title.includes('p3')) { issuesLink = oneLineTrim`https://github.com/mozilla/${repo}/issues? - utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22priority:%20p3%22`; + utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22priority:p3%22`; warningLimit = undefined; } if (props.title.includes('open prs')) { diff --git a/lib/const.js b/lib/const.js index 74aa91c..db8b86a 100644 --- a/lib/const.js +++ b/lib/const.js @@ -37,10 +37,10 @@ module.exports = { p5: '#3e0200', }, invalidStates: [ - 'state: invalid', - 'state: duplicate', - 'state: works for me', - 'state: wontfix', + 'state:invalid', + 'state:duplicate', + 'state:works_for_me', + 'state:wontfix', ], priorities: ['p1', 'p2', 'p3', 'p4', 'p5'], contribRepos: [ diff --git a/pages/api/gh-contrib-welcome.js b/pages/api/gh-contrib-welcome.js index 2785313..5838e53 100644 --- a/pages/api/gh-contrib-welcome.js +++ b/pages/api/gh-contrib-welcome.js @@ -33,7 +33,7 @@ export default async (req, res) => { const client = createClient(); const variables = { query: oneLine`${contribRepos.map((n) => `repo:${n}`).join('\n')} - label:"contrib: welcome" + label:"contrib:welcome" is:open sort:updated-desc type:issues`, diff --git a/pages/api/gh-good-first-bugs.js b/pages/api/gh-good-first-bugs.js index 0e014ee..bb8f962 100644 --- a/pages/api/gh-good-first-bugs.js +++ b/pages/api/gh-good-first-bugs.js @@ -33,7 +33,7 @@ export default async (req, res) => { const client = createClient(); const variables = { query: oneLine`${contribRepos.map((n) => `repo:${n}`).join('\n')} - label:"contrib: good first bug" + label:"contrib:good_first_bug" is:open sort:updated-desc type:issues`, diff --git a/pages/api/gh-issue-counts.js b/pages/api/gh-issue-counts.js index 0ad938f..5f8bd89 100644 --- a/pages/api/gh-issue-counts.js +++ b/pages/api/gh-issue-counts.js @@ -10,25 +10,25 @@ const query = gql` triaged: issues( states: OPEN labels: [ - "priority: p1" - "priority: p2" - "priority: p3" - "priority: p4" - "priority: p5" + "priority:p1" + "priority:p2" + "priority:p3" + "priority:p4" + "priority:p5" ] ) { totalCount } - open_prod_bugs: issues(states: OPEN, labels: "type: prod_bug") { + open_prod_bugs: issues(states: OPEN, labels: "type:prod_bug") { totalCount } - open_p1s: issues(states: OPEN, labels: "priority: p1") { + open_p1s: issues(states: OPEN, labels: "priority:p1") { totalCount } - open_p2s: issues(states: OPEN, labels: "priority: p2") { + open_p2s: issues(states: OPEN, labels: "priority:p2") { totalCount } - open_p3s: issues(states: OPEN, labels: "priority: p3") { + open_p3s: issues(states: OPEN, labels: "priority:p3") { totalCount } open_prs: pullRequests(states: OPEN) { diff --git a/pages/api/gh-maybe-good-first-bugs.js b/pages/api/gh-maybe-good-first-bugs.js index 8f97310..357253b 100644 --- a/pages/api/gh-maybe-good-first-bugs.js +++ b/pages/api/gh-maybe-good-first-bugs.js @@ -33,7 +33,7 @@ export default async (req, res) => { const client = createClient(); const variables = { query: oneLine`${contribRepos.map((n) => `repo:${n}`).join('\n')} - label:"contrib: maybe good first bug" + label:"contrib:maybe_good_first_bug" is:open sort:updated-desc type:issues`, diff --git a/tests/fixtures/gh-contrib-welcome.js b/tests/fixtures/gh-contrib-welcome.js index 7a03086..fca68e3 100644 --- a/tests/fixtures/gh-contrib-welcome.js +++ b/tests/fixtures/gh-contrib-welcome.js @@ -29,7 +29,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p5', + name: 'priority:p5', __typename: 'Label', }, ], @@ -60,7 +60,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -103,7 +103,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p4', + name: 'priority:p4', __typename: 'Label', }, { diff --git a/tests/fixtures/gh-good-first-bugs.js b/tests/fixtures/gh-good-first-bugs.js index 77794b4..927c90d 100644 --- a/tests/fixtures/gh-good-first-bugs.js +++ b/tests/fixtures/gh-good-first-bugs.js @@ -29,7 +29,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p5', + name: 'priority:p5', __typename: 'Label', }, ], @@ -60,7 +60,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -103,7 +103,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p4', + name: 'priority:p4', __typename: 'Label', }, { diff --git a/tests/fixtures/gh-maybe-good-first-bugs.js b/tests/fixtures/gh-maybe-good-first-bugs.js index 989f36c..d9e1db9 100644 --- a/tests/fixtures/gh-maybe-good-first-bugs.js +++ b/tests/fixtures/gh-maybe-good-first-bugs.js @@ -20,7 +20,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p4', + name: 'priority:p4', __typename: 'Label', }, { diff --git a/tests/fixtures/gh-milestone-issues.js b/tests/fixtures/gh-milestone-issues.js index 4ace5f5..70df048 100644 --- a/tests/fixtures/gh-milestone-issues.js +++ b/tests/fixtures/gh-milestone-issues.js @@ -42,7 +42,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p4', + name: 'priority:p4', __typename: 'Label', }, { @@ -139,7 +139,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -223,7 +223,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -316,7 +316,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p2', + name: 'priority:p2', __typename: 'Label', }, { @@ -401,7 +401,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -489,7 +489,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, ], @@ -566,7 +566,7 @@ export default { labels: { nodes: [ { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -664,7 +664,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p4', + name: 'priority:p4', __typename: 'Label', }, { @@ -753,7 +753,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -856,7 +856,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p2', + name: 'priority:p2', __typename: 'Label', }, { @@ -966,7 +966,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -1117,7 +1117,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p3', + name: 'priority:p3', __typename: 'Label', }, { @@ -1230,7 +1230,7 @@ export default { __typename: 'Label', }, { - name: 'priority: p5', + name: 'priority:p5', __typename: 'Label', }, { diff --git a/tests/lib/utils/contrib.test.js b/tests/lib/utils/contrib.test.js index 16789e4..fb754ec 100644 --- a/tests/lib/utils/contrib.test.js +++ b/tests/lib/utils/contrib.test.js @@ -16,7 +16,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p1', + name: 'priority:p1', }, { name: 'contrib: assigned', @@ -48,7 +48,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p2', + name: 'priority:p2', }, { name: 'contrib: mentor assigned', diff --git a/tests/lib/utils/milestones.test.js b/tests/lib/utils/milestones.test.js index 64c1fb2..1554d06 100644 --- a/tests/lib/utils/milestones.test.js +++ b/tests/lib/utils/milestones.test.js @@ -86,7 +86,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p1', + name: 'priority:p1', }, ], }, @@ -143,7 +143,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p1', + name: 'priority:p1', }, ], }, @@ -319,7 +319,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p1', + name: 'priority:p1', }, ], }, @@ -335,7 +335,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p1', + name: 'priority:p1', }, ], }, @@ -428,7 +428,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p1', + name: 'priority:p1', }, ], }, @@ -467,7 +467,7 @@ describe(__filename, () => { labels: { nodes: [ { - name: 'priority: p2', + name: 'priority:p2', }, ], },