Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for github checks #161

Closed
wants to merge 175 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
65a3f47
reorder columns to make most important info first
May 20, 2015
e59dd83
Make r+ remove try bit
Manishearth Nov 7, 2015
8eea2eb
Merge pull request #1 from barosl/master
Manishearth Dec 10, 2015
25e370d
Incorporate 'flake8' linting via Travis CI
frewsxcv Oct 31, 2015
625a68a
Merge pull request #2 from frewsxcv/flake8
frewsxcv Jan 12, 2016
dd6bc68
Register Travis webhooks with Homu
frewsxcv Jan 13, 2016
d62cd9c
Merge pull request #3 from servo/homu-notifications
frewsxcv Jan 13, 2016
ef32b42
Merge upstream master branch and fix merge conflicts
KiChjang Jan 25, 2016
e07f74e
Merge pull request #11 from servo/upstream-update
Manishearth Jan 31, 2016
e9c2a1e
Allow for multiple types of builders
Manishearth Mar 5, 2016
7fa3965
Fix exemption
Manishearth Mar 5, 2016
6ef9a76
Merge pull request #13 from servo/multiple_build
larsbergstrom Mar 5, 2016
d76ebef
Fix for repos not using status
Manishearth Mar 6, 2016
86b4f40
Merge pull request #14 from servo/fix-for-nonstatus
Manishearth Mar 6, 2016
b63ade9
Fix for status
Manishearth Mar 9, 2016
f5f2f8a
Only ping buildbot if it exists
Manishearth Mar 11, 2016
1475689
Merge pull request #16 from Manishearth/fx-force-nobuildbot
Manishearth Mar 11, 2016
56c341c
Merge pull request #15 from servo/fix-status
Manishearth Mar 11, 2016
5321632
When test passes and we're preparing to merge, note that
cgwalters Mar 16, 2016
2b5b692
Adds try/except around requests calls
ashcrow Mar 18, 2016
efae02d
fixup! Adds try/except around requests calls
ashcrow Mar 29, 2016
389084f
Merge pull request #22 from ashcrow/servo-requests-exceptions
Manishearth Mar 29, 2016
78b83a1
Add a link to the GitHub repository for queue
ashcrow Apr 2, 2016
0ed9f8a
Try builds should be able to use a different branch than auto
larsbergstrom Apr 4, 2016
a26486e
Merge pull request #26 from larsbergstrom/use_try_branch
larsbergstrom Apr 4, 2016
1f2e33f
Fix travis exemption code again for status-only context
cgwalters Apr 4, 2016
4de69d4
Merge pull request #29 from cgwalters/status-travis-exemption
Manishearth Apr 5, 2016
4660368
Change `linear` to use Closes: instead of force-pushing to master
cgwalters Mar 15, 2016
89243bb
Merge pull request #7 from Manishearth/tryfix
larsbergstrom Apr 21, 2016
72693bb
Merge pull request #19 from cgwalters/linear-improvements
Manishearth Apr 27, 2016
268d541
Merge pull request #25 from ashcrow/servo-link-to-repo-from-queue
Manishearth Apr 29, 2016
9658f7e
Support overriding git username+email in config
cgwalters May 13, 2016
042d05b
Merge pull request #38 from cgwalters/override-git-useremail
larsbergstrom May 13, 2016
c62396e
Merge pull request #20 from cgwalters/test-status-and-merge-status
Manishearth May 14, 2016
85f7a48
README: mention also subscribe to "Status" event
Jun 30, 2016
b7a9c29
Merge pull request #51 from ignatenkobrain/patch-1
Manishearth Jun 30, 2016
fa42122
server.py: fix flake8 errors
jlebon Aug 8, 2016
03555a5
main.py: refactor git cmd shell outs
jlebon Aug 7, 2016
a859127
main.py: refactor Travis CI exception
jlebon Aug 7, 2016
f36186b
main.py: add status-based exemptions
jlebon Aug 7, 2016
cc44482
fixup! server.py: fix flake8 errors
jlebon Aug 12, 2016
2be7023
fixup! main.py: add status-based exemptions
jlebon Aug 12, 2016
c813839
Merge pull request #54 from jlebon/pr/status-exemptions
Manishearth Aug 15, 2016
297cbd9
Merge pull request #10 from Gankro/columnar
Manishearth Aug 17, 2016
fa9d5f7
Allow configuring database location
hayd Aug 20, 2016
513e928
Merge pull request #58 from hayd/db_filename
Manishearth Aug 20, 2016
00cd678
main.py: check for equivalence before exempting test
jlebon Aug 23, 2016
0c9b5ed
Merge pull request #57 from jlebon/pr/tune-down-status-exemption
Manishearth Aug 30, 2016
1187df0
Ignore PRs which are WIP or TODO
aneeshusa Sep 23, 2016
178c9e2
Merge pull request #62 from aneeshusa/ignore-wip-prs
Manishearth Sep 24, 2016
a6af973
Reset success state on r+
Manishearth Oct 9, 2016
8ab2bf9
add retry with exponential backoff to repo sync
indirect Nov 1, 2016
9cddd52
synchronize all PR data on startup
indirect Nov 3, 2016
2a2ab51
Make startup sync configurable
indirect Nov 7, 2016
fdf8864
add sync_on_start to sample config
indirect Nov 15, 2016
e85c356
blank lines for flake8
indirect Nov 15, 2016
ff3f43f
Merge pull request #66 from bundler/sync-on-startup
Manishearth Nov 15, 2016
a08c10e
Pass --no-ff for local merge
alexcrichton Nov 30, 2016
97f76f0
Merge pull request #68 from alexcrichton/no-ff
Manishearth Nov 30, 2016
b0c0626
main: Support a -c/--config argument
cgwalters Dec 19, 2016
b82e98b
Merge pull request #73 from cgwalters/config-while-you-config-yo
Manishearth Dec 21, 2016
74cab76
server: Fix minor flake8 issues
cgwalters Dec 22, 2016
1c8d4ea
Merge pull request #74 from cgwalters/flake8
Manishearth Dec 22, 2016
03386cd
utils: Print stderr from child processes by default
cgwalters Dec 22, 2016
7ba4fa2
main: Refactor auth processing
cgwalters Dec 23, 2016
a81056a
main: Do authorization per-command
cgwalters Dec 23, 2016
9501d30
main: Support auth_collaborators
cgwalters Dec 23, 2016
19c16ed
Merge pull request #77 from cgwalters/auth-collaborators
Manishearth Dec 23, 2016
dd3593d
add homu ping command (fixes #83)
Manishearth Jan 23, 2017
612d2b2
the easter egg is a lie
Manishearth Jan 23, 2017
d59f9f5
Merge pull request #84 from servo/ping
Manishearth Jan 23, 2017
2067c37
Refactor repos to hold more state than just the GH object, store tree…
Manishearth Jan 24, 2017
1f2399f
Support tree closure (fixes #85)
Manishearth Jan 24, 2017
0c619eb
Fix bug where homu stops working with r+ shorthands (fixes #86)
Manishearth Jan 24, 2017
a9ac157
Add tree closure message
Manishearth Jan 24, 2017
35bdcf6
make flake gods happy
Manishearth Jan 25, 2017
a7355eb
Auto merge of #87 - servo:treeclosed, r=edunham
Jan 26, 2017
0bfd0aa
Use default host 0.0.0.0
Manishearth Feb 2, 2017
3d2e2bb
Auto merge of #88 - servo:host, r=aneeshusa
Feb 2, 2017
8b1f895
Auto merge of #63 - servo:try-reset-state, r=cgwalters
Feb 2, 2017
288757f
Auto merge of #75 - cgwalters:subprocess-stderr, r=Manishearth
Feb 2, 2017
9f56ee5
yes we know you're awake
Manishearth Feb 8, 2017
d3f1351
Auto merge of #89 - servo:shutup, r=KiChjang
Feb 8, 2017
0030254
dont slice sha
Eh2406 Mar 1, 2017
0806216
Don't slice sha here too
Eh2406 Mar 1, 2017
232b6b1
Merge pull request #93 from Eh2406/patch-3
Manishearth Mar 1, 2017
7256ba2
Handle mergeability errors more gracefully
Eh2406 Mar 1, 2017
7c5eb5b
log if locale is not compatible with unicode
Eh2406 Mar 1, 2017
0b955c8
Auto merge of #92 - Eh2406:patch-2, r=edunham
Mar 7, 2017
83689f0
Auto merge of #91 - Eh2406:patch-1, r=edunham
Mar 13, 2017
434b1c2
Add custom hook support
Manishearth Mar 14, 2017
8623182
Auto merge of #104 - servo:hooks, r=edunham
Mar 20, 2017
377bed7
Begin pep8 fixups
edunham Mar 14, 2017
ff4fc10
obvious fixups
edunham Mar 22, 2017
a56a69c
type noqa prettier
edunham Mar 22, 2017
9a54608
Conform to flake8 and refactor where my brain hurt
edunham Mar 22, 2017
1be4acb
pep8 utils
edunham Mar 22, 2017
6868caf
Flip actually-linting-stuff switch
edunham Mar 22, 2017
8d56510
Auto merge of #103 - edunham:pep8, r=larsbergstrom,aneeshusa
Mar 24, 2017
968f91a
Fix privieleges check
coldnight Mar 28, 2017
ee914e6
implement maximum priority
edunham May 8, 2017
607c5f5
bump minor version with new config addition
edunham May 8, 2017
7ac3136
Auto merge of #108 - coldnight:fix-verify-auth, r=edunham
May 12, 2017
f601b6f
Don't stop processing the queue when tree is closed (fixes #120)
Manishearth May 25, 2017
36f0f8d
Fix hooks
Manishearth May 26, 2017
aa02cf4
Auto merge of #114 - edunham:maxpriority, r=jdm
May 29, 2017
62f0c9e
Auto merge of #122 - servo:fxhook, r=edunham
May 31, 2017
b8c5817
Allow a limited set of build statuses for try builds.
tomprince Jun 10, 2017
39c40e0
Auto merge of #124 - tomprince:limited-try-statuses, r=jdm
Jun 12, 2017
49a8cc3
Removing broken Travis webhook integration
Valloric May 13, 2017
0dfb10c
Auto merge of #117 - Valloric:cleanup, r=Manishearth
Jun 15, 2017
d081ae0
Auto merge of #121 - servo:continue, r=edunham
Jul 20, 2017
56bbccd
Clarify need to accept the collaborator invitation
Valloric Aug 19, 2017
d4c34de
Merge pull request #131 from Valloric/patch-1
Manishearth Aug 19, 2017
6788bdb
Stop mentioning user "9001" when priority limit is reached.
kennytm Aug 27, 2017
4424aed
Merge pull request #132 from kennytm/master
Manishearth Aug 27, 2017
c5e274e
More logging in debug mode
aidanhs Sep 21, 2017
119b116
retry if github error is 422
Eh2406 Sep 29, 2017
878e02e
fix line length
Eh2406 Oct 2, 2017
387c218
Auto merge of #134 - Eh2406:master, r=Manishearth
Oct 2, 2017
9679cd3
Tweak error message
aidanhs Oct 24, 2017
6e177cb
remove bare excepts for flake8
edunham Oct 26, 2017
f34e399
Auto merge of #138 - edunham:newflake8, r=jdm
Oct 26, 2017
b996b9d
Auto merge of #133 - aidanhs:aphs-logging, r=manishearth
Oct 26, 2017
ac85e34
Refactor: Replaced the `check_timeout` loop by a per-state Timer.
kennytm Jan 16, 2018
e29e074
Allow the test timeout be configured, instead of hardcoding 10 hours.
kennytm Jan 16, 2018
11ef946
Auto merge of #142 - kennytm:stop-hardcoding-timeout, r=jdm
Jan 17, 2018
9527a80
Support relabeling when some event happens
kennytm Jan 12, 2018
0979fe7
Auto merge of #141 - kennytm:master, r=jdm
Feb 3, 2018
7840629
Refactor parse_commands to add tests.
alexrs Feb 19, 2018
54df015
remove functools import
alexrs Mar 13, 2018
15a5825
Execute tests in Travis
alexrs Mar 13, 2018
a654e0f
Fix tests
alexrs Mar 14, 2018
a6daeb0
Limit github.py version to be lower than 1
alexrs Mar 14, 2018
c341d1a
Move install command.
jdm Mar 14, 2018
c1476c6
Install dependencies using pip
alexrs Mar 14, 2018
3fe9223
Add python 3.6
alexrs Mar 14, 2018
cd5b1b5
Replace assert_called_once by assert_called_once_with
alexrs Mar 14, 2018
2467053
Auto merge of #149 - alexrs:testability, r=jdm
Mar 15, 2018
e5a9d90
Fix bug #150
alexrs Mar 20, 2018
fea6702
Auto merge of #151 - alexrs:fix-auth, r=jdm
Mar 20, 2018
991bbf7
Refactor parse_commands to add tests.
alexrs Feb 19, 2018
606f136
Fix typo in test name
alexrs Mar 23, 2018
f9486b3
Remove useless words from tests
alexrs Mar 23, 2018
5c0c315
Add helper method to call parse_commands with default values
alexrs Mar 23, 2018
12b4be0
Remove Action class
alexrs Mar 23, 2018
e4b2fc0
Auto merge of #152 - alexrs:remove-global-cfg, r=jdm
Mar 24, 2018
7772009
Add cfg to parse_commands calls in server.py
alexrs Mar 27, 2018
0383eea
Merge pull request #155 from alexrs/fix-cfg
Manishearth Mar 27, 2018
be8baaa
Replaced slicing text from set_treeclosed method to its caller for is…
dtchanpura Mar 27, 2018
68e4dd9
Auto merge of #158 - dtchanpura:master, r=jdm
Mar 28, 2018
f8ba09f
pin github3.py version
Manishearth Jul 26, 2018
992e774
Auto merge of #164 - servo:github-pin, r=jdm
Jul 27, 2018
d357f0e
Mention how to make it update
Jul 27, 2018
ff23f69
Auto merge of #165 - servo:edunham-patch-1, r=jdm
Jul 27, 2018
3546a69
max_priority should be toplevel
Manishearth Jul 27, 2018
7b47549
Auto merge of #168 - Manishearth:max, r=jdm
Jul 27, 2018
f628621
Add support for try=chooser syntax
Manishearth Jul 27, 2018
d42c1c1
Push to appropriate branch
Manishearth Jul 31, 2018
b26895f
Add tests for try choosers
Manishearth Jul 31, 2018
ca6ba96
Auto merge of #167 - Manishearth:trychooser, r=jdm
Aug 7, 2018
9aef11b
Add support for build results page
Manishearth Aug 13, 2018
58d952a
Fix link
atouchet Aug 14, 2018
75e714c
Auto merge of #170 - atouchet:link, r=jdm
Aug 14, 2018
461e9ac
Auto merge of #169 - Manishearth:build-res, r=jdm
Aug 14, 2018
755c02c
Quick fix for homu timeout on try (fixes #903)
Manishearth Oct 15, 2018
ce2048f
Auto merge of #174 - Manishearth:timeout-fix, r=jdm
Oct 15, 2018
f786798
Use None, not False, for try_choose default value
Manishearth Nov 9, 2018
9088cef
Remove python 3.3 tests.
jdm Nov 9, 2018
3b4f966
Suppress spurious flake errors.
jdm Nov 9, 2018
cbbfe97
Auto merge of #179 - servo:jdm-patch-2, r=Manishearth
Nov 9, 2018
d2b0d20
Auto merge of #177 - Manishearth:try-fix, r=jdm
Nov 9, 2018
bd5bcc1
Revert "Quick fix for homu timeout on try (fixes #903)"
SimonSapin Dec 11, 2018
2f2d1b8
Auto merge of #184 - servo:tc-choosers, r=Manishearth
Dec 12, 2018
43c7666
dd support for GitHub Checks
jdm Jan 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/homu/__pycache__/
/tests/__pycache__/
/.venv/
/cfg.toml
/cfg.json
/homu.egg-info/
/main.db
/cache
**/*.pyc
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sudo: false
language: python
python:
- 3.4
- 3.5
- 3.6
install:
- pip install flake8
- pip install 'github3.py<1.0'
- pip install 'toml'
- pip install 'Jinja2'
- pip install 'requests'
- pip install 'bottle'
- pip install 'waitress'
- pip install 'retrying'
script:
- flake8 homu
- python -m unittest discover tests
notifications:
webhooks: http://build.servo.org:54856/travis
128 changes: 68 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
[![Hommando]][Akemi Homura]

Homu is a bot that integrates with GitHub and your favorite continuous
integration service, such as [Buildbot] or [Travis CI].
integration service such as [Travis CI], [Appveyor] or [Buildbot].

[Hommando]: https://i.imgur.com/j0jNvHF.png
[Akemi Homura]: https://wiki.puella-magi.net/Homura_Akemi
[Buildbot]: http://buildbot.net/
[Travis CI]: https://travis-ci.org/
[Appveyor]: https://www.appveyor.com/

## Why is it needed?

Expand All @@ -31,8 +32,9 @@ approval comment from one of the configured reviewers. When the pull request is
approved, Homu tests it using your favorite continuous integration service, and
only when it passes all the tests, it is merged into `master`.

Note that Homu is **not** a replacement of Travis CI or Buildbot. It works on
top of them. Homu itself doesn't have the ability to test pull requests.
Note that Homu is **not** a replacement of Travis CI, Buildbot or Appveyor. It
works on top of them. Homu itself doesn't have the ability to test pull
requests.

## Influences of bors

Expand All @@ -50,86 +52,92 @@ before the merge" came from bors. However, there are also some differences:
feature. This approach improves the overall performance and the response
time, because the bot is informed about the status changes immediately.

And also, Homu has more features, such as `rollup`, `try`, and the Travis CI
support.
And also, Homu has more features, such as `rollup`, `try`, and the Travis CI &
Appveyor support.

[bors]: https://github.com/graydon/bors
[Webhooks]: https://developer.github.com/webhooks/
[HttpStatusPush]: http://docs.buildbot.net/current/manual/cfg-statustargets.html#httpstatuspush
[HttpStatusPush]: http://docs.buildbot.net/0.8.12/manual/cfg-statustargets.html#httpstatuspush

## Usage

### How to install

```sh
sudo apt-get install python3-venv

pyvenv .venv
. .venv/bin/activate

# Stable version

pip install homu

# Development version

git clone https://github.com/barosl/homu.git
pip install -e homu
$ sudo apt-get install python3-venv
$ pyvenv .venv
$ . .venv/bin/activate
$ git clone https://github.com/servo/homu.git
$ pip install -e homu
```

### How to configure

1. Copy `cfg.sample.toml` to `cfg.toml`, and edit it accordingly.

2. Create a GitHub account that will be used by Homu. You can also use an
existing account. In the [account settings][settings], register a new
application and generate a new access token (with the `repo` permission).
The OAuth Callback URL should be `http://HOST:PORT/callback`, the homepage URL
isn't needed and can be anything, for example `http://HOST:PORT/`.

3. Add a Webhook to your repository:

- Payload URL: `http://HOST:PORT/github`
- Content type: `application/json`
- Secret: The same as `repo.NAME.github.secret` in cfg.toml
- Events: Issue Comment, Pull Request, Push

4. Add a Webhook to your continuous integration service:
In the following instructions, `HOST` refers to the hostname (or IP address)
where you are running your custom homu instance. `PORT` is the port the service
is listening to and is configured in `web.port` in `cfg.toml`. `NAME` refers to
the name of the repository you are configuring homu for.

- Buildbot
1. Copy `cfg.sample.toml` to `cfg.toml`. You'll need to edit this file to set up
your configuration. The following steps explain where you can find important
config values.

Insert the following code to the `master.cfg` file:

```python
from buildbot.status.status_push import HttpStatusPush

c['status'].append(HttpStatusPush(
2. Create a GitHub account that will be used by Homu. You can also use an
existing account. In the [account settings][settings], go to "OAuth
applications" and create a new application:
- Make note of the "Client ID" and "Client Secret"; you will need to put them in
your `cgf.toml`.
- The OAuth Callback URL should be `http://HOST:PORT/callback`.
- The homepage URL isn't necessary; you could set `http://HOST:PORT/`.

3. Go to the user settings of the GitHub account you created/used in the
previous step. Go to "Personal access tokens". Click "Generate new token" and
choose the "repo" and "user" scopes. Put the token value in your `cfg.toml`.

4. Add your new GitHub account as a Collaborator to the GitHub repo you are
setting up homu for. This can be done in repo (NOT user) "Settings", then
"Collaborators".

4.1. Make sure you login as the new GitHub account and that you **accept
the collaborator invitation** you just sent!

5. Add a Webhook to your repository. This is done under repo (NOT user)
"Settings", then "Webhooks". Click "Add webhook", the set:
- Payload URL: `http://HOST:PORT/github`
- Content type: `application/json`
- Secret: The same as `repo.NAME.github.secret` in `cfg.toml`
- Events: `Issue Comment`, `Pull Request`, `Push`, `Status`, `Check runs`

6. Add a Webhook to your continuous integration service, if necessary. You don't
need this if using Travis/Appveyor.
- Buildbot

Insert the following code to the `master.cfg` file:

```python
from buildbot.status.status_push import HttpStatusPush

c['status'].append(HttpStatusPush(
serverUrl='http://HOST:PORT/buildbot',
extra_post_params={'secret': 'repo.NAME.buildbot.secret in cfg.toml'},
))
```

- Travis CI

Add [your Travis token][travis] as `repo.NAME.travis.token` in cfg.toml.
Insert the following code to the `.travis.yml` file:
))
```

```yaml
notifications:
webhooks: http://HOST:PORT/travis

branches:
only:
- auto
```
7. Go through the rest of your `cfg.toml` and uncomment (and change, if needed)
parts of the config you'll need.

[settings]: https://github.com/settings/applications
[travis]: https://travis-ci.org/profile/info

### How to run

```sh
. .venv/bin/activate

homu
$ . .venv/bin/activate
$ homu
```

## Deploying Servo's Homu

After merging a change to this repo, updated the pinned hash in [Salt].

[Salt]: https://github.com/servo/saltfs/blob/master/homu/map.jinja
Loading