diff --git a/bot_scripts/assign-approved-pr-to-test.js b/bot_scripts/assign-approved-pr-to-test.js index 4a6af69..003fcd3 100644 --- a/bot_scripts/assign-approved-pr-to-test.js +++ b/bot_scripts/assign-approved-pr-to-test.js @@ -20,7 +20,7 @@ const slackHelper = require('../lib/slack') const botName = 'assign-approved-pr-to-test' module.exports = robot => { - createScheduler(robot, { interval: 10 * 60 * 1000 }) + createScheduler(robot, { interval: 10 * 60 * 1000, delay: !process.env.DISABLE_DELAY }) robot.on('schedule.repository', context => checkOpenPullRequests(robot, context)) } @@ -100,6 +100,7 @@ async function assignPullRequestToCorrectColumn (github, robot, repo, pullReques const { srcColumns, dstColumn } = getColumns(state, columns) if (!dstColumn) { + robot.log.debug(`${botName} - No dstColumn, state=${state}, columns=${JSON.stringify(columns)}, srcColumns=${srcColumns}`) return } diff --git a/lib/github-helpers.js b/lib/github-helpers.js index c3af7ff..63615ce 100644 --- a/lib/github-helpers.js +++ b/lib/github-helpers.js @@ -72,12 +72,15 @@ async function _getReviewApprovalState (github, robot, prInfo, testedPullRequest if (approvedReviews.length >= threshold) { const reviewsWithChangesRequested = finalReviews.filter(reviewState => reviewState === 'CHANGES_REQUESTED') if (reviewsWithChangesRequested.length === 0) { + robot.log.debug(`No changes requested, considering state as approved`) return 'approved' } + robot.log.debug(`${reviewsWithChangesRequested.length} changes requested, considering state as changes_requested`) return 'changes_requested' } + robot.log.debug(`Not enough reviewers yet, considering state as awaiting_reviewers`) return 'awaiting_reviewers' }