buildbot/buildbot — pull request #635 by adiroiban (2013-02-13 14:43:54+00:00)
Title: Add status receiver for GitHub

Problem description
===================

GitHub provides a simple API for publishing build status for a revision from a repo.

It would be nice is Buildbot could work with GitHub to publish status for builders.

Here is my try.

Please let me know if this is on the right track and what needs to be changed.

This tried to do the same think as: #516

Changes description
===================

This depend on Python GitHub binding from http://vincent-jacques.net/PyGithub/
The calls are blocking.
I used a cached the reduce github API usage.

It uses a token for authentication. Maybe we need a utility tool/script to obtain a token.

No testes are present. If everything is ok I will try to write the tests.

It depends on an external package but I tried to avoid reinventing the wheel.

How to try and test the changes
===============================

Install GitHub Python binding:

pip install pygithub

Get an GitHub token

```
from github import Github

github = Github(username, password)
user = github.get_user()
authorization = user.create_authorization(
scopes=['repo'],
note='Buildbot Status',
note_url='http://buildbot.com/')
print authorization.token
```

Define github status

```
from buildbot.status.github_status import GitHubStatus
github_status = GitHubStatus(
token="GITHUB_TOKEN",
)
```

Configure a builder with the following properties:

```
c['builders'].append(BuilderConfig(
properties={
"github_repo_name": "buildbot",
"github_repo_owner": "buildbot",
},
))
```

Watch a pull request in GitHub.