status-github-bot/index.js

27 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-02-06 12:47:21 +00:00
const MemCache = require('mem-cache')
const SlackGitHubCacheBuilder = require('./lib/retrieve-slack-github-users')
module.exports = async (robot) => {
2018-01-22 13:48:57 +00:00
console.log('Yay, the app was loaded!')
2018-02-06 12:47:21 +00:00
const slackGitHubCache = new MemCache({ timeoutDisabled: true })
const slackCachePromise = SlackGitHubCacheBuilder.build(robot, slackGitHubCache)
require('./bot_scripts/assign-new-pr-to-review')(robot)
require('./bot_scripts/assign-approved-pr-to-test')(robot)
require('./bot_scripts/assign-to-bounty-awaiting-for-approval')(robot)
require('./bot_scripts/greet-new-contributor')(robot)
2018-01-22 13:48:57 +00:00
await slackCachePromise
2018-02-06 12:47:21 +00:00
robot.log.info('Slack user ID cache populated, loading remainder of scripts')
// Add scripts which require using the Slack/GitHub cache after this comment
require('./bot_scripts/bounty-awaiting-approval-slack-ping')(robot, SlackGitHubCacheBuilder.getSlackUsernameFromGitHubId)
2018-01-22 13:48:57 +00:00
// For more information on building apps:
// https://probot.github.io/docs/
// To get your app running against GitHub, see:
// https://probot.github.io/docs/development/
}