From 936b2c6696ca3947e0be310b756d818b701ada40 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 25 Oct 2021 12:45:46 -0700 Subject: [PATCH 1/6] Update tests for accessibility checklist --- tests/unit/GithubUtilsTest.js | 24 +++++++++-- tests/unit/createOrUpdateStagingDeployTest.js | 42 +++++++++---------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/tests/unit/GithubUtilsTest.js b/tests/unit/GithubUtilsTest.js index 5c09db85fb8..dd44841d3ee 100644 --- a/tests/unit/GithubUtilsTest.js +++ b/tests/unit/GithubUtilsTest.js @@ -29,24 +29,27 @@ 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: [ { url: 'https://github.com/Expensify/App/pull/21', number: 21, - isVerified: false, + isQAVerified: false, + isAccessibilityVerified: false, }, { url: 'https://github.com/Expensify/App/pull/22', number: 22, - isVerified: true, + isQAVerified: false, + isAccessibilityVerified: false, }, { url: 'https://github.com/Expensify/App/pull/23', number: 23, - isVerified: false, + isQAVerified: false, + isAccessibilityVerified: false, }, ], labels: [ @@ -330,6 +333,19 @@ describe('GithubUtils', () => { }) )); + 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}${openCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[0]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${openCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${ccApplauseLeads}`, + ); + }) + )); + test('Test all verified PRs', () => ( githubUtils.generateStagingDeployCashBody(tag, basePRList, basePRList) .then((issueBody) => { diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index 0cb834a9e8e..8a786439a27 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -116,13 +116,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}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${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}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[3]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + + `${lineBreakDouble}${listStart}${basePRList[4]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${ccApplauseLeads}`, }; @@ -181,13 +181,13 @@ 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[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${openCheckbox}${QA}${lineBreak}${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', }; @@ -273,17 +273,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[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${closedCheckbox}${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}${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}`, }); }); @@ -339,11 +339,11 @@ describe('createOrUpdateStagingDeployCash', () => { + `${lineBreakDouble}${listStart}${basePRList[6]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${openCheckbox}${accessibility}` + `${lineBreakDouble}${listStart}${basePRList[7]}${lineBreak}${openCheckbox}${QA}${lineBreak}${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}`, }); }); From f2849897734c0f14f8be0b84310b3a5ea805fa34 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 25 Oct 2021 13:33:47 -0700 Subject: [PATCH 2/6] Fix code to generate checklist w/ accessibilty checkboxes --- .../createOrUpdateStagingDeploy.js | 4 +- .github/libs/GithubUtils.js | 49 +++++---------- tests/unit/GithubUtilsTest.js | 63 ++++++++++--------- tests/unit/createOrUpdateStagingDeployTest.js | 45 ++++++------- 4 files changed, 71 insertions(+), 90 deletions(-) diff --git a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js index a1ba2cfa5d3..1d2fa72f67d 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, @@ -103,7 +103,7 @@ const run = function () { // Since it is later in the array, it will be truncated by _.unique, // and the original value of isVerified and isAccessible will be preserved. isVerified: false, - isAccessible: false, + isAccessiblityVerified: false, }))), false, item => item.number, diff --git a/.github/libs/GithubUtils.js b/.github/libs/GithubUtils.js index da6209d376c..9d3ee3ae094 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 dd44841d3ee..d702f85941f 100644 --- a/tests/unit/GithubUtilsTest.js +++ b/tests/unit/GithubUtilsTest.js @@ -36,20 +36,20 @@ describe('GithubUtils', () => { { url: 'https://github.com/Expensify/App/pull/21', number: 21, - isQAVerified: false, - isAccessibilityVerified: false, + isVerified: false, + isAccessible: false, }, { url: 'https://github.com/Expensify/App/pull/22', number: 22, - isQAVerified: false, - isAccessibilityVerified: false, + isVerified: true, + isAccessible: false, }, { url: 'https://github.com/Expensify/App/pull/23', number: 23, - isQAVerified: false, - isAccessibilityVerified: false, + isVerified: false, + isAccessible: false, }, ], labels: [ @@ -290,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', () => ( @@ -312,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}`, ); }) @@ -325,9 +326,9 @@ 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}`, ); }) @@ -338,9 +339,9 @@ 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}${closedCheckbox}${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}${closedCheckbox}${accessibility}` + `${lineBreakDouble}${ccApplauseLeads}`, ); }) @@ -361,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}`, ); }) @@ -374,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}`, ); }) @@ -386,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 8a786439a27..d5a44ef4a70 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -97,8 +97,8 @@ 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'; @@ -106,6 +106,7 @@ 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}${closedCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[1]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[2]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${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}${closedCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[3]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${accessibility}` - + `${lineBreakDouble}${listStart}${basePRList[4]}${lineBreak}${closedCheckbox}${QA}${lineBreak}${closedCheckbox}${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,9 +182,9 @@ describe('createOrUpdateStagingDeployCash', () => { labels: [LABELS.STAGING_DEPLOY_CASH], // eslint-disable-next-line max-len body: `${baseExpectedOutput()}` - + `${lineBreakDouble}${listStart}${basePRList[5]}${lineBreak}${openCheckbox}${QA}${lineBreak}${closedCheckbox}${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}` + `${lineBreak}${openCheckbox} ${basePRList[5]}` + `${lineBreak}${openCheckbox} ${basePRList[8]}` @@ -273,11 +274,11 @@ 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}${closedCheckbox}${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}` + `${lineBreak}${openCheckbox} ${basePRList[5]}` + `${lineBreak}${openCheckbox} ${basePRList[8]}` @@ -335,9 +336,9 @@ 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}` + `${lineBreak}${openCheckbox} ${basePRList[5]}` + `${lineBreak}${openCheckbox} ${basePRList[8]}` From 37e6085d72ca2c15103422ccfb4ff9df9fe0fb4c Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 25 Oct 2021 13:38:03 -0700 Subject: [PATCH 3/6] Rebuild GH actions --- .github/actions/checkDeployBlockers/index.js | 49 +++++------------ .../createOrUpdateStagingDeploy/index.js | 53 ++++++------------- .../actions/getPullRequestDetails/index.js | 49 +++++------------ .github/actions/getReleaseBody/index.js | 49 +++++------------ .../actions/isPullRequestMergeable/index.js | 49 +++++------------ .../actions/isStagingDeployLocked/index.js | 49 +++++------------ .../markPullRequestsAsDeployed/index.js | 49 +++++------------ .../actions/reopenIssueWithComment/index.js | 49 +++++------------ .../actions/triggerWorkflowAndWait/index.js | 49 +++++------------ 9 files changed, 128 insertions(+), 317 deletions(-) diff --git a/.github/actions/checkDeployBlockers/index.js b/.github/actions/checkDeployBlockers/index.js index 54b1f2e550e..0b4fd2de93a 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/index.js b/.github/actions/createOrUpdateStagingDeploy/index.js index c4e72f37b81..fdd58e32716 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, @@ -113,7 +113,7 @@ const run = function () { // Since it is later in the array, it will be truncated by _.unique, // and the original value of isVerified and isAccessible will be preserved. isVerified: false, - isAccessible: false, + isAccessiblityVerified: false, }))), false, item => item.number, @@ -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 1af0f147c1c..7231917e17f 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 32502f98978..179b1366edf 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 0debda10036..1e5e7cd8d46 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 b1ab0bb4e61..4931d6be48a 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 56aee6fe89a..8b860e13462 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 83ba1f42b05..cbb9ed8bd4a 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 e0807fa0aa7..759d546013d 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; }); } From b9075fc5133dac9ae32b9e308dac760d01961d18 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 25 Oct 2021 13:45:16 -0700 Subject: [PATCH 4/6] Update tests for preserving DeployBlocker state --- tests/unit/createOrUpdateStagingDeployTest.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index d5a44ef4a70..d0a34cee775 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -193,7 +193,7 @@ describe('createOrUpdateStagingDeployCash', () => { state: 'open', }; - const currentOpenDeployBlockers = [ + const currentDeployBlockers = [ { html_url: 'https://github.com/Expensify/App/pull/6', number: 6, @@ -209,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], }, ]; @@ -245,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, @@ -307,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, From 69cfd23fb10712d52cc8021536af97dc15b77930 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 25 Oct 2021 13:48:29 -0700 Subject: [PATCH 5/6] Clean up checkbox spaces --- tests/unit/createOrUpdateStagingDeployTest.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index d0a34cee775..261d6d862e6 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -97,11 +97,11 @@ 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'; @@ -186,9 +186,9 @@ describe('createOrUpdateStagingDeployCash', () => { + `${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}` - + `${lineBreak}${openCheckbox} ${basePRList[5]}` - + `${lineBreak}${openCheckbox} ${basePRList[8]}` - + `${lineBreak}${closedCheckbox} ${basePRList[9]}` + + `${lineBreak}${openCheckbox}${basePRList[5]}` + + `${lineBreak}${openCheckbox}${basePRList[8]}` + + `${lineBreak}${closedCheckbox}${basePRList[9]}` + `${lineBreakDouble}${ccApplauseLeads}`, state: 'open', }; @@ -280,11 +280,11 @@ describe('createOrUpdateStagingDeployCash', () => { + `${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}` - + `${lineBreak}${openCheckbox} ${basePRList[5]}` - + `${lineBreak}${openCheckbox} ${basePRList[8]}` - + `${lineBreak}${closedCheckbox} ${basePRList[9]}` - + `${lineBreak}${openCheckbox} ${basePRList[10]}` - + `${lineBreak}${openCheckbox} ${basePRList[11]}` + + `${lineBreak}${openCheckbox}${basePRList[5]}` + + `${lineBreak}${openCheckbox}${basePRList[8]}` + + `${lineBreak}${closedCheckbox}${basePRList[9]}` + + `${lineBreak}${openCheckbox}${basePRList[10]}` + + `${lineBreak}${openCheckbox}${basePRList[11]}` + `${lineBreakDouble}${ccApplauseLeads}`, }); }); @@ -340,11 +340,11 @@ describe('createOrUpdateStagingDeployCash', () => { + `${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}` - + `${lineBreak}${openCheckbox} ${basePRList[5]}` - + `${lineBreak}${openCheckbox} ${basePRList[8]}` - + `${lineBreak}${closedCheckbox} ${basePRList[9]}` - + `${lineBreak}${openCheckbox} ${baseIssueList[0]}` - + `${lineBreak}${openCheckbox} ${baseIssueList[1]}` + + `${lineBreak}${openCheckbox}${basePRList[5]}` + + `${lineBreak}${openCheckbox}${basePRList[8]}` + + `${lineBreak}${closedCheckbox}${basePRList[9]}` + + `${lineBreak}${openCheckbox}${baseIssueList[0]}` + + `${lineBreak}${openCheckbox}${baseIssueList[1]}` + `${lineBreakDouble}${ccApplauseLeads}`, }); }); From 74950f6aa46717d7dc7562e12610fef19bc969c5 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 25 Oct 2021 15:04:56 -0700 Subject: [PATCH 6/6] Fix oops --- .../createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js | 2 +- .github/actions/createOrUpdateStagingDeploy/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js index 1d2fa72f67d..209e4b311fb 100644 --- a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js +++ b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js @@ -103,7 +103,7 @@ const run = function () { // Since it is later in the array, it will be truncated by _.unique, // and the original value of isVerified and isAccessible will be preserved. isVerified: false, - isAccessiblityVerified: false, + isAccessible: false, }))), false, item => item.number, diff --git a/.github/actions/createOrUpdateStagingDeploy/index.js b/.github/actions/createOrUpdateStagingDeploy/index.js index fdd58e32716..9d593ea8eff 100644 --- a/.github/actions/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/createOrUpdateStagingDeploy/index.js @@ -113,7 +113,7 @@ const run = function () { // Since it is later in the array, it will be truncated by _.unique, // and the original value of isVerified and isAccessible will be preserved. isVerified: false, - isAccessiblityVerified: false, + isAccessible: false, }))), false, item => item.number,