trigger-automation-test-build: Keep checking PR while android build is failing and trigger once build is passing

This commit is contained in:
Pedro Pombeiro 2019-02-25 21:54:43 +01:00
parent be11124f17
commit ee082627c4
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
1 changed files with 6 additions and 1 deletions

View File

@ -115,17 +115,22 @@ async function processPullRequest (context, robot, prInfo, fullJobName) {
robot.log.warn(`${botName} - Could not find PR`, prInfo)
return
}
if (pullRequest.state === 'closed') {
robot.log.info(`${botName} - PR is closed, discarded`, prInfo)
return
}
const statusContext = 'jenkins/prs/android-e2e'
const currentStatus = await gitHubHelpers.getPullRequestCurrentStatusForContext(context, statusContext, pullRequest)
switch (currentStatus) {
case undefined:
case 'pending':
case 'failure':
pendingPullRequests.set(prInfo.number, { github: github, prInfo, fullJobName: fullJobName })
robot.log.debug(`${botName} - Status for ${statusContext} is '${currentStatus}', adding to backlog to check periodically`, prInfo)
return
case 'error':
case 'failure':
robot.log.debug(`${botName} - Status for ${statusContext} is '${currentStatus}', exiting`, prInfo)
return
case 'success':