Go to file
Pedro Pombeiro 808ba87cc1
Avoid moving PR back and forth between REVIEW and IN TEST columns just because a build was started
2018-01-25 16:53:55 +01:00
.github Fix assign-to-bounty-awaiting-for-approval.js to only care about the right label, and to also delete a card if issue is unlabeled 2018-01-24 14:49:37 +01:00
__tests__ Port from Hubot to Probot 2018-01-22 14:48:57 +01:00
lib Make the functionality to move a PR to test a scheduled task, instead of an event handler 2018-01-24 01:04:49 +01:00
scripts Avoid moving PR back and forth between REVIEW and IN TEST columns just because a build was started 2018-01-25 16:53:55 +01:00
.env.example Add .env.example 2018-01-22 16:16:23 +01:00
.gitignore Port from Hubot to Probot 2018-01-22 14:48:57 +01:00
.travis.yml Port from Hubot to Probot 2018-01-22 14:48:57 +01:00
CODE_OF_CONDUCT.md Port from Hubot to Probot 2018-01-22 14:48:57 +01:00
CONTRIBUTING.md Port from Hubot to Probot 2018-01-22 14:48:57 +01:00
LICENSE Port from Hubot to Probot 2018-01-22 14:48:57 +01:00
README.md Add reference to wiki page 2018-01-24 13:32:45 +01:00
index.js Add script to move PR to IN TEST column when two reviewers approve, and back to REVIEW otherwise 2018-01-23 17:00:37 +01:00
package-lock.json Make the functionality to move a PR to test a scheduled task, instead of an event handler 2018-01-24 01:04:49 +01:00
package.json Make the functionality to move a PR to test a scheduled task, instead of an event handler 2018-01-24 01:04:49 +01:00

README.md

statusbot

statusbot is a chat bot built on the Probot framework. There's a wiki available [here][https://wiki.status.im/GitHub_bot].

This README is intended to help get you started. Definitely update and improve to talk about your own instance, how to use and deploy, what functionality is available, etc!

What does the bot do?

Right now the bot has two sets of capabilities:

  • Doing background management in GitHub:
    • Assign new PRs to the Pipeline for QA project board (REVIEW column).
    • Assign issues that are labeled bounty-awaiting-approval to the Status SOB Swarm project board (bounty-awaiting-approval column).
    • Welcome users who post their first PR in a project.
    • Checks if all commits are GPG-signed and sets the PR status accordingly.
    • Unfurls links on Issues and Pull Request discussions.
    • Disallows merging of PRs containing WIP in the title.
    • New functionality will be added in the future (wishlist is being tracked here)

The project board names, column names, welcome message and other values are stored in the .github/github-bot.yml file. It can be overriden for each specific repository by adding a file in the same path on the respective repository (see probot-config).

Creating the bot GitHub App

This bot is meant to be packaged as a GitHub App. There are two steps to it: creating the app, and installing the app. Creating a GitHub App only needs to be done once and the app can be made public to be reused for any number of repositories and organizations.

See the official docs for deployment.

  1. Create the GitHub App:
    1. In GitHub, go to Settings/Developer settings/GitHub Apps and click on New GitHub App
    2. Enter the bot name in GitHub App name, e.g. Status GitHub Bot
    3. In Homepage URL, enter the /ping endpoint of the service, e.g. https://5e63b0ab.ngrok.io/ping
    4. In Webhook URL, enter the root endpoint of the service, e.g. https://5e63b0ab.ngrok.io/
    5. In Webhook secret (optional), enter a string of characters that matches the value passed in the in the WEBHOOK_SECRET environment variable.
    6. This app requires these Permissions & events for the GitHub App:
      • Commit statuses - Read & write
      • Issues - Read & Write
        • Check the box for Issue comment events
        • Check the box for Issues events
      • Pull requests - Read & Write
        • Check the box for Pull request events
        • Check the box for Pull request review events
        • Check the box for Pull request review comment events
      • Repository contents - Read-only
        • Check the box for Push events
      • Repository projects - Read & Write
      • Single File - Read-only
        • Path: .github/github-bot.yml
    7. Generate a private key pass and save it.
  2. Installing the bot service:
    1. Deploy the bot to the cloud.
    2. Set the APP_ID environment variable to value reported when the GitHub App was created.
    3. Set the WEBHOOK_SECRET environment variable to the value configured in the GitHub App.
    4. Set the PRIVATE_KEY environment variable to the contents of the .pem file.
    5. Set the SLACK_BOT_TOKEN environment variable to the value reported for the bot in Slack.
  3. Install the GitHub App in an account:
    1. Select the repositories where the bot should work (e.g. status-react).

Restart the bot

You may want to get comfortable with heroku logs and heroku restart if you're having issues.