paritytech/highfive

Name: highfive

Owner: Parity Technologies

Description: Github hooks to provide an encouraging atmosphere for new contributors

Forked from: servo/highfive

Created: 2016-10-12 12:55:08.0

Updated: 2016-10-12 12:55:09.0

Pushed: 2016-09-29 11:05:43.0

Homepage: null

Size: 320

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Highfive

GitHub hooks to provide an encouraging atmosphere for new contributors.

Docs for the highfive instance for servo/servo repository live on the Servo wiki.

Design

Highfive is built as a modular, loosely-coupled set of handlers for Github API events. Each time an API event is processed, each handler is given the opportunity to respond to it, either by making direct API calls (such as manipulating PR labels) or using cross-handler features such as logging a warning (which are aggregated at the end and posted as a single comment).

Testing

Per-handler tests can be run using python test.py. These consist of a set of JSON documents collected from the tests/ subdirectory of each handler, using the following format:


nitial": {
// Initial state of the PR before any handlers process the payload.
"labels": [],
"diff": "",
"new_contributor": false,
"assignee": null

xpected": {
// Expected state of the PR after all the handlers process the following payload.
// Only fields in this object will be checked. Example fields are shown below.
"comments": 5,
"labels": ["S-awaiting-review"],
"assignee": "jdm"

ayload": {
// Github API event payload in JSON format.


Each test runs with a mock Github API provider, so no account information or network connection is required to run the test suite.

Enabling a repo

Visit the repo's webhook settings page at https://github.com/org/repo/settings/hooks.

Create a new webhook, pointing at your highfive instance's location:

Payload URL: http://99.88.777.666/highfive/newpr.py Content type: application/x-www-form-urlencoded Leave the 'secret' field blank. Let me select individual events: Issue Comment, Pull Request, Status Check the box by 'Active'

Configuring a Highfive

Copy config.sample to config. Add the username of the account that will be commenting as highfive. When logged into that account, visit https://github.com/settings/tokens and create a token with the public_repo permission.

Add that access token's value to the token field of the config.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.