Name: prbuildbot
Owner: World Wide Web Consortium
Description: null
Created: 2017-01-19 13:55:17.0
Updated: 2017-12-17 07:13:30.0
Pushed: 2017-08-03 12:19:07.0
Homepage: null
Size: 41
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
The PR Build Bot is a Python web application that listens to Travis CI webhooks and posts selections from the build logs as comments on the GitHub PR. This allows commenting on PRs from both trusted and untrusted branches of the main repository without exposing the GitHub Personal Access Token of the commenting user.
This bot can be installed in any number of Python server environments. wptserve and Flask options are described below.
wptserve is a server used throughout the W3C testing infrastructure. There is currently no Ansible configuration for this installation type. The following general instructions should get you running.
requests
and pyOpenSSL
modules into your Python environment.libssl-dev
)sudo python setup.py install
from the cloned directory.cd
into the cloned directory.python wptserve_app.py
sudo
if you receive a “Permission Denied” error.This installation process uses Ansible to configure the server to use nginx and uWSGI to serve a Flask application. It expects nginx to be able to use port 80.
pip
, not apt
.This is how to install the dependencies and application on a base Ubuntu 16.04 box. Git should come out of the box.
adduser prbuildbot
as rootsudo
.adduser prbuildbot sudo
as rootsudo apt-get update
sudo apt install python-pip
sudo -H pip install --upgrade pip
sudo apt install libssl-dev
sudo -H pip install ansible
git clone https://github.com/<your user name>/prbuildbot.git
ansible
directory and run the provisioning script.cd prbuildbot/ansible
ansible-playbook provision.yml
prbuildbot/ansible
directory, or it
will fail.You will need to set up a user on GitHub, get a personal access token for them, and set up the configuration file for the application.
public_repo
and user:email
permissions.cp config.sample.txt config.txt
log_parser.py
to parse the Travis CI job logs in whatever way you
require.log_parser.py
includes the logic for parsing log files for
w3c/web-platform-tests
as an example..travis.yml
file:fications:
bhooks: http://<your-server-here>/prbuildbot/travis
.travis.yml
file is in your project, you should start
receiving comments on pull requests from this bot.| Property | Description |
|—————–|—————————————————————————————————————————————————–|
| TRAVIS_DOMAIN | The Travis CI domain that applies to your application (either travis-ci.com
or travis-ci.org
) |
| COMMENT_ENV_VAR | An environment variable used in your Travis CI build matrix that serves as a flag for whether or not the job's log should be parsed as a PR comment |
| GH_TOKEN | The Personal Access Token created in Configuration Step 2, above |
| ORG | The GitHub organization/owner of the main repository (this project's ORG would be “bobholt”) |
| REPO | The main repository (this project's REPO would be “prbuildbot”) |
In the application root run python test
. If you have changed the log_parser,
you will have to update the log_parser.parse_logs
tests for your own
application.