From 22393897572c02ab4f0f8b3d647082f3aca7a919 Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 15 Nov 2022 13:25:18 -0800 Subject: [PATCH 1/2] Smarter regex for parsing No QA PRs --- .github/libs/GithubUtils.js | 2 +- tests/unit/GithubUtilsTest.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/libs/GithubUtils.js b/.github/libs/GithubUtils.js index fa35239c83b58..e4b88cec0d109 100644 --- a/.github/libs/GithubUtils.js +++ b/.github/libs/GithubUtils.js @@ -271,7 +271,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No(?:\s)?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/tests/unit/GithubUtilsTest.js b/tests/unit/GithubUtilsTest.js index 1c34605c01176..61d2574ad41f1 100644 --- a/tests/unit/GithubUtilsTest.js +++ b/tests/unit/GithubUtilsTest.js @@ -290,14 +290,14 @@ describe('GithubUtils', () => { }, { number: 5, - title: '[No QA] Test No QA PR uppercase', + title: '[NO QA] Test No QA PR uppercase', html_url: 'https://github.com/Expensify/App/pull/5', user: {login: 'testUser'}, labels: [], }, { number: 6, - title: '[No QA] Test No QA PR Title Case', + title: '[NoQa] Test No QA PR Title Case', html_url: 'https://github.com/Expensify/App/pull/6', user: {login: 'testUser'}, labels: [], From c25036c8820d7c2cbae093ec43b840efd5130f55 Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 15 Nov 2022 13:28:41 -0800 Subject: [PATCH 2/2] Rebuild GH actions --- .github/actions/javascript/authorChecklist/index.js | 2 +- .github/actions/javascript/awaitStagingDeploys/index.js | 2 +- .github/actions/javascript/checkDeployBlockers/index.js | 2 +- .github/actions/javascript/createOrUpdateStagingDeploy/index.js | 2 +- .github/actions/javascript/getDeployPullRequestList/index.js | 2 +- .github/actions/javascript/getPullRequestDetails/index.js | 2 +- .github/actions/javascript/getReleaseBody/index.js | 2 +- .github/actions/javascript/isPullRequestMergeable/index.js | 2 +- .github/actions/javascript/isStagingDeployLocked/index.js | 2 +- .github/actions/javascript/markPullRequestsAsDeployed/index.js | 2 +- .github/actions/javascript/reopenIssueWithComment/index.js | 2 +- .github/actions/javascript/reviewerChecklist/index.js | 2 +- .github/actions/javascript/triggerWorkflowAndWait/index.js | 2 +- .github/actions/javascript/verifySignedCommits/index.js | 2 +- .github/libs/GithubUtils.js | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/actions/javascript/authorChecklist/index.js b/.github/actions/javascript/authorChecklist/index.js index a73b4db5673a3..1ca5748f92f2b 100644 --- a/.github/actions/javascript/authorChecklist/index.js +++ b/.github/actions/javascript/authorChecklist/index.js @@ -355,7 +355,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/awaitStagingDeploys/index.js b/.github/actions/javascript/awaitStagingDeploys/index.js index 6ddacc8d9d4c1..911df2ed8debe 100644 --- a/.github/actions/javascript/awaitStagingDeploys/index.js +++ b/.github/actions/javascript/awaitStagingDeploys/index.js @@ -388,7 +388,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/checkDeployBlockers/index.js b/.github/actions/javascript/checkDeployBlockers/index.js index d323bdbe41044..60656b6b3bad0 100644 --- a/.github/actions/javascript/checkDeployBlockers/index.js +++ b/.github/actions/javascript/checkDeployBlockers/index.js @@ -358,7 +358,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/createOrUpdateStagingDeploy/index.js b/.github/actions/javascript/createOrUpdateStagingDeploy/index.js index 4465caa9b1ec1..a0f2f1d9880e3 100644 --- a/.github/actions/javascript/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/javascript/createOrUpdateStagingDeploy/index.js @@ -585,7 +585,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/getDeployPullRequestList/index.js b/.github/actions/javascript/getDeployPullRequestList/index.js index 3776b7136c4e8..b62a9df9ba189 100644 --- a/.github/actions/javascript/getDeployPullRequestList/index.js +++ b/.github/actions/javascript/getDeployPullRequestList/index.js @@ -518,7 +518,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/getPullRequestDetails/index.js b/.github/actions/javascript/getPullRequestDetails/index.js index 2fa9ade150047..9001790a2f72d 100644 --- a/.github/actions/javascript/getPullRequestDetails/index.js +++ b/.github/actions/javascript/getPullRequestDetails/index.js @@ -433,7 +433,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/getReleaseBody/index.js b/.github/actions/javascript/getReleaseBody/index.js index cd53631fc8475..d97a13e312b3a 100644 --- a/.github/actions/javascript/getReleaseBody/index.js +++ b/.github/actions/javascript/getReleaseBody/index.js @@ -347,7 +347,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/isPullRequestMergeable/index.js b/.github/actions/javascript/isPullRequestMergeable/index.js index 05b5db117353f..bc2ba093780a0 100644 --- a/.github/actions/javascript/isPullRequestMergeable/index.js +++ b/.github/actions/javascript/isPullRequestMergeable/index.js @@ -379,7 +379,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/isStagingDeployLocked/index.js b/.github/actions/javascript/isStagingDeployLocked/index.js index 672da33c8977b..269d34c040097 100644 --- a/.github/actions/javascript/isStagingDeployLocked/index.js +++ b/.github/actions/javascript/isStagingDeployLocked/index.js @@ -311,7 +311,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/markPullRequestsAsDeployed/index.js b/.github/actions/javascript/markPullRequestsAsDeployed/index.js index e055065629603..85e2903cb3b6f 100644 --- a/.github/actions/javascript/markPullRequestsAsDeployed/index.js +++ b/.github/actions/javascript/markPullRequestsAsDeployed/index.js @@ -480,7 +480,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/reopenIssueWithComment/index.js b/.github/actions/javascript/reopenIssueWithComment/index.js index d52c4e72deb20..79fbd049fcdb3 100644 --- a/.github/actions/javascript/reopenIssueWithComment/index.js +++ b/.github/actions/javascript/reopenIssueWithComment/index.js @@ -322,7 +322,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/reviewerChecklist/index.js b/.github/actions/javascript/reviewerChecklist/index.js index 0b9cf1f1dc48f..71850e3624444 100644 --- a/.github/actions/javascript/reviewerChecklist/index.js +++ b/.github/actions/javascript/reviewerChecklist/index.js @@ -369,7 +369,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/triggerWorkflowAndWait/index.js b/.github/actions/javascript/triggerWorkflowAndWait/index.js index 0ad516a43fcef..5c225c3ee8ee4 100644 --- a/.github/actions/javascript/triggerWorkflowAndWait/index.js +++ b/.github/actions/javascript/triggerWorkflowAndWait/index.js @@ -491,7 +491,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/actions/javascript/verifySignedCommits/index.js b/.github/actions/javascript/verifySignedCommits/index.js index 8406bec365c7f..d74280e4becab 100644 --- a/.github/actions/javascript/verifySignedCommits/index.js +++ b/.github/actions/javascript/verifySignedCommits/index.js @@ -311,7 +311,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => (PR.title || '').toUpperCase().startsWith('[NO QA]')), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs); diff --git a/.github/libs/GithubUtils.js b/.github/libs/GithubUtils.js index e4b88cec0d109..d3f419258f042 100644 --- a/.github/libs/GithubUtils.js +++ b/.github/libs/GithubUtils.js @@ -271,7 +271,7 @@ class GithubUtils { console.log('Found the following Internal QA PRs:', internalQAPRMap); const noQAPRs = _.pluck( - _.filter(data, PR => /\[No(?:\s)?QA]/i.test(PR.title)), + _.filter(data, PR => /\[No\s?QA]/i.test(PR.title)), 'html_url', ); console.log('Found the following NO QA PRs:', noQAPRs);