From 266a2a812a702b1500fc26287830aaa5cee4af1b Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 17 Jun 2021 12:37:11 -0700 Subject: [PATCH] Fix StagingDeployCash isAutomatedPullRequest check --- .github/actions/checkDeployBlockers/index.js | 1 + .../createOrUpdateStagingDeploy.js | 6 +++--- .../actions/createOrUpdateStagingDeploy/index.js | 7 ++++--- .../actions/getMergeCommitForPullRequest/index.js | 1 + .github/actions/getReleaseBody/index.js | 1 + .github/actions/isPullRequestMergeable/index.js | 1 + .github/actions/isStagingDeployLocked/index.js | 1 + .../actions/markPullRequestsAsDeployed/index.js | 1 + .github/actions/reopenIssueWithComment/index.js | 1 + .github/actions/triggerWorkflowAndWait/index.js | 1 + .github/libs/GithubUtils.js | 1 + tests/unit/createOrUpdateStagingDeployTest.js | 14 +++++++------- 12 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/actions/checkDeployBlockers/index.js b/.github/actions/checkDeployBlockers/index.js index 12c95c8c76f1..b109be49c626 100644 --- a/.github/actions/checkDeployBlockers/index.js +++ b/.github/actions/checkDeployBlockers/index.js @@ -291,6 +291,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js index 75b890934476..9ea8c688b53d 100644 --- a/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js +++ b/.github/actions/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js @@ -80,9 +80,9 @@ const run = function () { console.log('Parsed the following data from the current StagingDeployCash:', currentStagingDeployCashData); currentStagingDeployCashIssueNumber = currentStagingDeployCashData.number; - const newDeployBlockers = _.map(deployBlockerResponse.data, ({url}) => ({ - url, - number: GithubUtils.getIssueOrPullRequestNumberFromURL(url), + const newDeployBlockers = _.map(deployBlockerResponse.data, ({html_url}) => ({ + url: html_url, + number: GithubUtils.getIssueOrPullRequestNumberFromURL(html_url), isResolved: false, })); diff --git a/.github/actions/createOrUpdateStagingDeploy/index.js b/.github/actions/createOrUpdateStagingDeploy/index.js index 4bc71ff41a46..85c791c418c6 100644 --- a/.github/actions/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/createOrUpdateStagingDeploy/index.js @@ -90,9 +90,9 @@ const run = function () { console.log('Parsed the following data from the current StagingDeployCash:', currentStagingDeployCashData); currentStagingDeployCashIssueNumber = currentStagingDeployCashData.number; - const newDeployBlockers = _.map(deployBlockerResponse.data, ({url}) => ({ - url, - number: GithubUtils.getIssueOrPullRequestNumberFromURL(url), + const newDeployBlockers = _.map(deployBlockerResponse.data, ({html_url}) => ({ + url: html_url, + number: GithubUtils.getIssueOrPullRequestNumberFromURL(html_url), isResolved: false, })); @@ -413,6 +413,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/getMergeCommitForPullRequest/index.js b/.github/actions/getMergeCommitForPullRequest/index.js index cbb10320c6a2..6543b49dd7ba 100644 --- a/.github/actions/getMergeCommitForPullRequest/index.js +++ b/.github/actions/getMergeCommitForPullRequest/index.js @@ -319,6 +319,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/getReleaseBody/index.js b/.github/actions/getReleaseBody/index.js index 4321be9b8293..dfcf37b35c43 100644 --- a/.github/actions/getReleaseBody/index.js +++ b/.github/actions/getReleaseBody/index.js @@ -262,6 +262,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/isPullRequestMergeable/index.js b/.github/actions/isPullRequestMergeable/index.js index c1c4c59e8bd9..4b23532cdede 100644 --- a/.github/actions/isPullRequestMergeable/index.js +++ b/.github/actions/isPullRequestMergeable/index.js @@ -265,6 +265,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/isStagingDeployLocked/index.js b/.github/actions/isStagingDeployLocked/index.js index 1808c24b2b7f..41e2bd607145 100644 --- a/.github/actions/isStagingDeployLocked/index.js +++ b/.github/actions/isStagingDeployLocked/index.js @@ -241,6 +241,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 9ce5a031d0d7..5b71719b6e1f 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -315,6 +315,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/reopenIssueWithComment/index.js b/.github/actions/reopenIssueWithComment/index.js index 9e09931d78b3..5ac3d3f1a473 100644 --- a/.github/actions/reopenIssueWithComment/index.js +++ b/.github/actions/reopenIssueWithComment/index.js @@ -254,6 +254,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/actions/triggerWorkflowAndWait/index.js b/.github/actions/triggerWorkflowAndWait/index.js index 559a754eff75..f7b68e5dca7e 100644 --- a/.github/actions/triggerWorkflowAndWait/index.js +++ b/.github/actions/triggerWorkflowAndWait/index.js @@ -405,6 +405,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/.github/libs/GithubUtils.js b/.github/libs/GithubUtils.js index 025a9c9281b2..f57a0576762f 100644 --- a/.github/libs/GithubUtils.js +++ b/.github/libs/GithubUtils.js @@ -203,6 +203,7 @@ class GithubUtils { return this.octokit.pulls.list({ owner: GITHUB_OWNER, repo: EXPENSIFY_CASH_REPO, + state: 'all', per_page: 100, }) .then(({data}) => { diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index fce7a09a9775..e9bd461c5f82 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -144,19 +144,19 @@ describe('createOrUpdateStagingDeployCash', () => { const currentOpenDeployBlockers = [ { - url: 'https://github.com/Expensify/Expensify.cash/pull/6', + html_url: 'https://github.com/Expensify/Expensify.cash/pull/6', number: 6, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/9', + html_url: 'https://github.com/Expensify/Expensify.cash/issues/9', number: 9, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/10', + html_url: 'https://github.com/Expensify/Expensify.cash/issues/10', number: 10, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], @@ -196,13 +196,13 @@ describe('createOrUpdateStagingDeployCash', () => { data: [ ...currentOpenDeployBlockers, { - url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New number: 11, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New number: 12, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], @@ -246,13 +246,13 @@ describe('createOrUpdateStagingDeployCash', () => { data: [ ...currentOpenDeployBlockers, { - url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/11', // New number: 11, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH], }, { - url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New + html_url: 'https://github.com/Expensify/Expensify.cash/issues/12', // New number: 12, state: 'open', labels: [LABELS.DEPLOY_BLOCKER_CASH],