diff --git a/.github/actions/checkDeployBlockers/index.js b/.github/actions/checkDeployBlockers/index.js index 54b1f2e550e9..0b4fd2de93a2 100644 --- a/.github/actions/checkDeployBlockers/index.js +++ b/.github/actions/checkDeployBlockers/index.js @@ -213,26 +213,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -249,26 +239,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -325,8 +304,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js index a1ba2cfa5d32..209e4b311fba 100644 --- a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js +++ b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js @@ -95,7 +95,7 @@ const run = function () { const PRList = _.sortBy( _.unique( _.union(currentStagingDeployCashData.PRList, _.map(mergedPRs, number => ({ - number, + number: Number.parseInt(number, 10), url: GithubUtils.getPullRequestURLFromNumber(number), // Since this is the second argument to _.union, diff --git a/.github/actions/createOrUpdateStagingDeploy/index.js b/.github/actions/createOrUpdateStagingDeploy/index.js index c4e72f37b810..9d593ea8eff3 100644 --- a/.github/actions/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/createOrUpdateStagingDeploy/index.js @@ -105,7 +105,7 @@ const run = function () { const PRList = _.sortBy( _.unique( _.union(currentStagingDeployCashData.PRList, _.map(mergedPRs, number => ({ - number, + number: Number.parseInt(number, 10), url: GithubUtils.getPullRequestURLFromNumber(number), // Since this is the second argument to _.union, @@ -342,26 +342,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -378,26 +368,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, - }), - ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -454,8 +433,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/getPullRequestDetails/index.js b/.github/actions/getPullRequestDetails/index.js index 1af0f147c1c3..7231917e17fd 100644 --- a/.github/actions/getPullRequestDetails/index.js +++ b/.github/actions/getPullRequestDetails/index.js @@ -266,26 +266,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -302,26 +292,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -378,8 +357,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/getReleaseBody/index.js b/.github/actions/getReleaseBody/index.js index 32502f989788..179b1366edf9 100644 --- a/.github/actions/getReleaseBody/index.js +++ b/.github/actions/getReleaseBody/index.js @@ -184,26 +184,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -220,26 +210,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -296,8 +275,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/isPullRequestMergeable/index.js b/.github/actions/isPullRequestMergeable/index.js index 0debda100368..1e5e7cd8d462 100644 --- a/.github/actions/isPullRequestMergeable/index.js +++ b/.github/actions/isPullRequestMergeable/index.js @@ -187,26 +187,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -223,26 +213,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -299,8 +278,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/isStagingDeployLocked/index.js b/.github/actions/isStagingDeployLocked/index.js index b1ab0bb4e616..4931d6be48a0 100644 --- a/.github/actions/isStagingDeployLocked/index.js +++ b/.github/actions/isStagingDeployLocked/index.js @@ -165,26 +165,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -201,26 +191,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -277,8 +256,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 56aee6fe89a7..8b860e134621 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -317,26 +317,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -353,26 +343,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -429,8 +408,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/reopenIssueWithComment/index.js b/.github/actions/reopenIssueWithComment/index.js index 83ba1f42b05d..cbb9ed8bd4a5 100644 --- a/.github/actions/reopenIssueWithComment/index.js +++ b/.github/actions/reopenIssueWithComment/index.js @@ -176,26 +176,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -212,26 +202,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -288,8 +267,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/actions/triggerWorkflowAndWait/index.js b/.github/actions/triggerWorkflowAndWait/index.js index e0807fa0aa71..759d546013d5 100644 --- a/.github/actions/triggerWorkflowAndWait/index.js +++ b/.github/actions/triggerWorkflowAndWait/index.js @@ -327,26 +327,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -363,26 +353,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -439,8 +418,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/.github/libs/GithubUtils.js b/.github/libs/GithubUtils.js index da6209d376c3..9d3ee3ae094c 100644 --- a/.github/libs/GithubUtils.js +++ b/.github/libs/GithubUtils.js @@ -125,26 +125,16 @@ class GithubUtils { return []; } PRListSection = PRListSection[1]; - const unverifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], + const PRList = _.map( + [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[([ x])] QA\\s+- \\[([ x])] Accessibility`, 'g'))], match => ({ url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: false, + number: Number.parseInt(match[2], 10), + isVerified: match[3] === 'x', + isAccessible: match[4] === 'x', }), ); - const verifiedPRs = _.map( - [...PRListSection.matchAll(new RegExp(`- (${PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getPullRequestNumberFromURL(match[1]), - isVerified: true, - }), - ); - return _.sortBy( - _.union(unverifiedPRs, verifiedPRs), - 'number', - ); + return _.sortBy(PRList, 'number'); } /** @@ -161,26 +151,15 @@ class GithubUtils { return []; } deployBlockerSection = deployBlockerSection[1]; - const unresolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[ \\] QA`, 'g'))], - match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: false, - }), - ); - const resolvedDeployBlockers = _.map( - [...deployBlockerSection.matchAll(new RegExp(`- (${ISSUE_OR_PULL_REQUEST_REGEX.source})\\s+- \\[x\\] QA`, 'g'))], + const deployBlockers = _.map( + [...deployBlockerSection.matchAll(new RegExp(`- \\[([ x])]\\s(${ISSUE_OR_PULL_REQUEST_REGEX.source})`, 'g'))], match => ({ - url: match[1], - number: GithubUtils.getIssueOrPullRequestNumberFromURL(match[1]), - isResolved: true, + url: match[2], + number: Number.parseInt(match[3], 10), + isResolved: match[1] === 'x', }), ); - return _.sortBy( - _.union(unresolvedDeployBlockers, resolvedDeployBlockers), - 'number', - ); + return _.sortBy(deployBlockers, 'number'); } /** @@ -237,8 +216,8 @@ class GithubUtils { if (!_.isEmpty(deployBlockers)) { issueBody += '\r\n\r\n\r\n**Deploy Blockers:**'; _.each(sortedDeployBlockers, (URL) => { - issueBody += `\r\n\r\n- ${URL}`; - issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n - [x] QA' : '\r\n - [ ] QA'; + issueBody += _.contains(resolvedDeployBlockers, URL) ? '\r\n- [x] ' : '\r\n- [ ] '; + issueBody += URL; }); } diff --git a/tests/unit/GithubUtilsTest.js b/tests/unit/GithubUtilsTest.js index 5c09db85fb87..d702f85941fa 100644 --- a/tests/unit/GithubUtilsTest.js +++ b/tests/unit/GithubUtilsTest.js @@ -29,7 +29,7 @@ describe('GithubUtils', () => { }; const issueWithDeployBlockers = {...baseIssue}; // eslint-disable-next-line max-len - issueWithDeployBlockers.body += '\r\n**Deploy Blockers:**\r\n- https://github.com/Expensify/App/issues/1\r\n - [ ] QA\r\n - [ ] Accessibility\r\n\r\n- https://github.com/Expensify/App/issues/2\r\n - [x] QA\r\n - [ ] Accessibility\r\n\r\n- https://github.com/Expensify/App/pull/1234\r\n - [ ] QA\r\n - [ ] Accessibility\r\n\r\n'; + issueWithDeployBlockers.body += '\r\n**Deploy Blockers:**\r\n- [ ] https://github.com/Expensify/App/issues/1\r\n- [x] https://github.com/Expensify/App/issues/2\r\n- [ ] https://github.com/Expensify/App/pull/1234\r\n'; const baseExpectedResponse = { PRList: [ @@ -37,16 +37,19 @@ describe('GithubUtils', () => { url: 'https://github.com/Expensify/App/pull/21', number: 21, isVerified: false, + isAccessible: false, }, { url: 'https://github.com/Expensify/App/pull/22', number: 22, isVerified: true, + isAccessible: false, }, { url: 'https://github.com/Expensify/App/pull/23', number: 23, isVerified: false, + isAccessible: false, }, ], labels: [ @@ -287,21 +290,22 @@ describe('GithubUtils', () => { // eslint-disable-next-line max-len const baseExpectedOutput = `**Release Version:** \`${tag}\`\r\n**Compare Changes:** https://github.com/Expensify/App/compare/production...staging\r\n\r\n**This release contains changes from the following pull requests:**`; - const openCheckbox = ' - [ ]'; - const closedCheckbox = ' - [x]'; + const openCheckbox = '- [ ] '; + const closedCheckbox = '- [x] '; const listStart = '- '; - const QA = ' QA'; - const accessibility = ' Accessibility'; + const QA = 'QA'; + const accessibility = 'Accessibility'; const ccApplauseLeads = 'cc @Expensify/applauseleads\r\n'; const deployBlockerHeader = '\r\n**Deploy Blockers:**'; const lineBreak = '\r\n'; const lineBreakDouble = '\r\n\r\n'; + const indent = ' '; // Valid output which will be reused in the deploy blocker tests const allVerifiedExpectedOutput = `${baseExpectedOutput}` - + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}`; + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}`; test('Test no verified PRs', () => ( @@ -309,9 +313,9 @@ describe('GithubUtils', () => { .then((issueBody) => { expect(issueBody).toBe( `${baseExpectedOutput}` - + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + `${lineBreakDouble}${ccApplauseLeads}`, ); }) @@ -322,9 +326,22 @@ describe('GithubUtils', () => { .then((issueBody) => { expect(issueBody).toBe( `${baseExpectedOutput}` - + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${ccApplauseLeads}`, + ); + }) + )); + + test('Test some accessibility verified PRs', () => ( + githubUtils.generateStagingDeployCashBody(tag, basePRList, [basePRList[0]], [basePRList[1]]) + .then((issueBody) => { + expect(issueBody).toBe( + `${baseExpectedOutput}` + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${ccApplauseLeads}`, ); }) @@ -345,8 +362,8 @@ describe('GithubUtils', () => { expect(issueBody).toBe( `${allVerifiedExpectedOutput}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${baseDeployBlockerList[0]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${baseDeployBlockerList[1]}${lineBreak}${openCheckbox}${QA}` + + `${lineBreak}${openCheckbox}${baseDeployBlockerList[0]}` + + `${lineBreak}${openCheckbox}${baseDeployBlockerList[1]}` + `${lineBreakDouble}${ccApplauseLeads}`, ); }) @@ -358,8 +375,8 @@ describe('GithubUtils', () => { expect(issueBody).toBe( `${allVerifiedExpectedOutput}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${baseDeployBlockerList[0]}${lineBreak}${closedCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${baseDeployBlockerList[1]}${lineBreak}${openCheckbox}${QA}` + + `${lineBreak}${closedCheckbox}${baseDeployBlockerList[0]}` + + `${lineBreak}${openCheckbox}${baseDeployBlockerList[1]}` + `${lineBreakDouble}${ccApplauseLeads}`, ); }) @@ -370,12 +387,12 @@ describe('GithubUtils', () => { .then((issueBody) => { expect(issueBody).toBe( `${baseExpectedOutput}` - + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${baseDeployBlockerList[0]}${lineBreak}${closedCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${baseDeployBlockerList[1]}${lineBreak}${closedCheckbox}${QA}` + + `${lineBreak}${closedCheckbox}${baseDeployBlockerList[0]}` + + `${lineBreak}${closedCheckbox}${baseDeployBlockerList[1]}` + `${lineBreakDouble}${ccApplauseLeads}`, ); }) diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index 0cb834a9e8ef..261d6d862e62 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -97,15 +97,16 @@ const baseIssueList = [ ]; // eslint-disable-next-line max-len const baseExpectedOutput = (tag = '1.0.2-1') => `**Release Version:** \`${tag}\`\r\n**Compare Changes:** https://github.com/Expensify/App/compare/production...staging\r\n\r\n**This release contains changes from the following pull requests:**`; -const openCheckbox = ' - [ ]'; -const closedCheckbox = ' - [x]'; +const openCheckbox = '- [ ] '; +const closedCheckbox = '- [x] '; const listStart = '- '; -const QA = ' QA'; -const accessibility = ' Accessibility'; +const QA = 'QA'; +const accessibility = 'Accessibility'; const ccApplauseLeads = 'cc @Expensify/applauseleads\r\n'; const deployBlockerHeader = '\r\n**Deploy Blockers:**'; const lineBreak = '\r\n'; const lineBreakDouble = '\r\n\r\n'; +const indent = ' '; describe('createOrUpdateStagingDeployCash', () => { const closedStagingDeployCash = { @@ -116,13 +117,13 @@ describe('createOrUpdateStagingDeployCash', () => { html_url: 'https://github.com/Expensify/App/issues/29', // eslint-disable-next-line max-len body: `${baseExpectedOutput('1.0.1-0')}` - + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[3]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[4]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[3]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[4]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${ccApplauseLeads}`, }; @@ -165,9 +166,9 @@ describe('createOrUpdateStagingDeployCash', () => { html_url: 'https://github.com/Expensify/App/issues/29', assignees: [GithubUtils.APPLAUSE_BOT], body: `${baseExpectedOutput()}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + `${lineBreakDouble}${ccApplauseLeads}`, }); }); @@ -181,18 +182,18 @@ describe('createOrUpdateStagingDeployCash', () => { labels: [LABELS.STAGING_DEPLOY_CASH], // eslint-disable-next-line max-len body: `${baseExpectedOutput()}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[8]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[9]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreak}${openCheckbox}${basePRList[5]}` + + `${lineBreak}${openCheckbox}${basePRList[8]}` + + `${lineBreak}${closedCheckbox}${basePRList[9]}` + `${lineBreakDouble}${ccApplauseLeads}`, state: 'open', }; - const currentOpenDeployBlockers = [ + const currentDeployBlockers = [ { html_url: 'https://github.com/Expensify/App/pull/6', number: 6, @@ -208,7 +209,7 @@ describe('createOrUpdateStagingDeployCash', () => { { html_url: 'https://github.com/Expensify/App/issues/10', number: 10, - state: 'open', + state: 'closed', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, ]; @@ -244,7 +245,7 @@ describe('createOrUpdateStagingDeployCash', () => { if (args.labels === GithubUtils.DEPLOY_BLOCKER_CASH_LABEL) { return { data: [ - ...currentOpenDeployBlockers, + ...currentDeployBlockers, { html_url: 'https://github.com/Expensify/App/issues/11', // New number: 11, @@ -273,17 +274,17 @@ describe('createOrUpdateStagingDeployCash', () => { html_url: `https://github.com/Expensify/App/issues/${openStagingDeployCashBefore.number}`, // eslint-disable-next-line max-len body: `${baseExpectedOutput('1.0.2-2')}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[8]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[9]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[8]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[9]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${basePRList[8]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${basePRList[9]}${lineBreak}${closedCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${basePRList[10]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${basePRList[11]}${lineBreak}${openCheckbox}${QA}` + + `${lineBreak}${openCheckbox}${basePRList[5]}` + + `${lineBreak}${openCheckbox}${basePRList[8]}` + + `${lineBreak}${closedCheckbox}${basePRList[9]}` + + `${lineBreak}${openCheckbox}${basePRList[10]}` + + `${lineBreak}${openCheckbox}${basePRList[11]}` + `${lineBreakDouble}${ccApplauseLeads}`, }); }); @@ -306,7 +307,7 @@ describe('createOrUpdateStagingDeployCash', () => { if (args.labels === GithubUtils.DEPLOY_BLOCKER_CASH_LABEL) { return { data: [ - ...currentOpenDeployBlockers, + ...currentDeployBlockers, { html_url: 'https://github.com/Expensify/App/issues/11', // New number: 11, @@ -335,15 +336,15 @@ describe('createOrUpdateStagingDeployCash', () => { html_url: `https://github.com/Expensify/App/issues/${openStagingDeployCashBefore.number}`, // eslint-disable-next-line max-len body: `${baseExpectedOutput('1.0.2-2')}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${indent}${closedCheckbox}${QA}${lineBreak}${indent}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${indent}${openCheckbox}${QA}${lineBreak}${indent}${openCheckbox}${accessibility}` + `${lineBreakDouble}${deployBlockerHeader}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${basePRList[8]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${basePRList[9]}${lineBreak}${closedCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${baseIssueList[0]}${lineBreak}${openCheckbox}${QA}` - + `${lineBreakDouble}${listStart}${baseIssueList[1]}${lineBreak}${openCheckbox}${QA}` + + `${lineBreak}${openCheckbox}${basePRList[5]}` + + `${lineBreak}${openCheckbox}${basePRList[8]}` + + `${lineBreak}${closedCheckbox}${basePRList[9]}` + + `${lineBreak}${openCheckbox}${baseIssueList[0]}` + + `${lineBreak}${openCheckbox}${baseIssueList[1]}` + `${lineBreakDouble}${ccApplauseLeads}`, }); });