Breaking Bot is a chat bot for coordinating responses to "breaking incidents". It is built on RDBMS-backed data flows, a clean business core, and, at present, chat responsiveness through the Hubot framework.
Tumblr built the bot as bb8
many moons ago. WordPress VIP retuned the bot. And Automattic open sourced it.
Breaking Bot is composed of the following major pieces:
data
core
boundary
We use RDBMS backing because it's great. We use finite state machines in our core to contain the inherent, non-trivial, stateful complexity in incidents. We isolate business logic as much as we can into functions without side effects in the core. And we push our I/O concerns to the boundary layer.
Comm Platform, at present, is entwined with Hubot and Slack specifically. But we likely detangle all that in the long run. Issue Trackers and Report Platforms are simply interfaces. Anything implemented to their requirements will work in those roles.
.env
fileCopy .env.example
file to .env
. This file will be read by docker-compose-yml
and will override the defaults there.
cp .env.example .env
You will need to be an owner of this workspace so that you have the required permissions. A workspace dedicated to bot development is ideal so that you aren't worried about noise or things going wrong.
#breaking-test
.devConfig
file as breakingMainRoom
.breakingNotifyRoom
if you would like Breaking Bot to drop important notifications somewhere other than the breakingMainRoom
.FYI, the workspace's dashboard is available via Settings & administration > Workspace settings.
connections:write
scope in the App-Level Tokens section. Provide it to your .env
file as SLACK_APP_TOKEN
..env
file as SLACK_BOT_TOKEN
. Make sure the app is installed to your workspace in this section too.Install dependencies:
npm ci
Start the local environment with:
docker-compose up
If your configuration is correct, you will see INFO
level logging of Now connected to Slack
when the bot is ready to accept commands in your test Slack instance.
When you make changes to code, the bot will restart automatically (via ts-watch
). Note that changes to .env
or docker-compose.yml
are an exception and will require you to docker-compose stop
and start
.
To see all the HTTP requests being made, and crank up logger level with the following environment variables in .env
and restart docker-compose
.
HUBOT_LOG_LEVEL=debug
NODE_DEBUG=request
Iterative:
npm run test:watch
Single run:
npm test