Bot.io: Keep pull requests from breaking your master
Bot.io is a fully flexible build/test bot for Github projects. It is similar to Travis-CI in purpose, but most of the action happens at the pull request level. (And you have to run your own test/build servers).
Bot.io has been guarding the master branch of Mozilla's pdf.js since late 2011.
How it works
The bot then reports back to the pull request with the result of the tests run by the script. Other commands are possible. For example, to listen for
/botio publish simply create a new script
Bot.io depends on Node.js and
git. To get started, create a new directory for your Botio files. In this directory, bootstrap Github hooks/configuration files, and start the server:
$ npm install -g botio $ botio bootstrap --repo user/repo_name --user repo_admin_name --pwd password123 --port 8877 $ botio start --user maybe_someone_else --pwd password123
You can then go to your Github repo and trigger the first Bot.io job by leaving the following comment on any pull request:
The bot should write back a hello world response in the PR discussion. See
on_test.js in your bot files directory for how this is done. You will want to modify that script to fire up your own builds/tests.
What's a typical Bot.io workflow?
- User submits pull request
- Reviewers think the code is desirable, so they fire up the bot by leaving a special comment like
- Bot runs the tests/builds and writes back to PR with results
Reviewers can then either merge or ask for further revision based on bot results.
I don't want to use Bot.io anymore. How do I uninstall the Github hooks installed by Bot.io?
On Github, go to Account Settings > Service Hooks > Post-Receive URLs and disable the URL corresponding to the IP of your machine. (Don't forget to save it).
How many concurrent tests can I run?
At the moment Bot.io uses a simple queueing system, so only one test can be run at a time. This might change in the future.
How does the bot handle security?
Bot.io only responds to white-listed users.