• Stars
    star
    661
  • Rank 68,192 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bot that integrates with GitHub and your favorite continuous integration service

Homu

Hommando

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

Why is it needed?

Let's take Travis CI as an example. If you send a pull request to a repository, Travis CI instantly shows you the test result, which is great. However, after several other pull requests are merged into the master branch, your pull request can still break things after being merged into master. The traditional continuous integration solutions don't protect you from this.

In fact, that's why they provide the build status badges. If anything pushed to master is completely free from any breakage, those badges will not be necessary, as they will always be green. The badges themselves prove that there can still be some breakages, even when continuous integration services are used.

To solve this problem, the test procedure should be executed just before the merge, not just after the pull request is received. You can manually click the "restart build" button each time before you merge a pull request, but Homu can automate this process. It listens to the pull request comments, waiting for an 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.

Influences of bors

Homu is largely inspired by bors. The concept of "tests should be done just before the merge" came from bors. However, there are also some differences:

  1. Stateful: Unlike bors, which intends to be stateless, Homu is stateful. It means that Homu does not need to retrieve all the information again and again from GitHub at every run. This is essential because of the GitHub's rate limiting. Once it downloads the initial state, the following changes are delivered with the Webhooks API.
  2. Pushing over polling: Homu prefers pushing wherever possible. The pull requests from GitHub are retrieved using Webhooks, as stated above. The test results from Buildbot are pushed back to Homu with the HttpStatusPush 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.

Usage

How to install

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

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, 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
  1. Add a Webhook to your continuous integration service:
  • Buildbot

    Insert the following code to the master.cfg file:

    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 as repo.NAME.travis.token in cfg.toml. Insert the following code to the .travis.yml file:

    notifications:
        webhooks: http://HOST:PORT/travis
    
    branches:
        only:
            - auto

How to run

. .venv/bin/activate

homu

More Repositories

1

flickr-music-player

A music player with Flickr backend.
CoffeeScript
17
star
2

letsencrypt-simple

A simple single-file ACME client that is compatible with Let's Encrypt.
Python
17
star
3

jvm-monitor

jvm-monitor is a lightweight monitoring tool that logs all the local variables whenever exceptions occur.
C
13
star
4

ws-bench

Scientificโ„ข WebSocket server benchmark
Python
8
star
5

inspircd-m_websocket

WebSocket backend for InspIRCd
C++
8
star
6

baroslized-settings

Configuration files, mostly for Linux, used by Barosl.
CSS
7
star
7

kong

A Kong expression generator that is dedicated to YellOw, Hong Jin-ho.
Rust
4
star
8

baroslized-scripts

Simple yet useful scripts written in Python.
Python
3
star
9

lr-parser

LR Parser coded in Python.
Python
2
star
10

inkulator

A simple computer architecture written in Verilog, based on Altera DE2-70.
Verilog
2
star
11

course-wish-list

A simple script that retrieves the "wish list" of the course registration.
Python
2
star
12

merge.py

Combine several directories to one big directory, using symbolic links.
Python
2
star
13

disk-sort

Disk-based heapsort implementation.
C
1
star
14

ark.py

Backup script based on rsync, preparing for disk failures.
Python
1
star
15

math-opti

Algorithms used to solve mathematical optimization problem.
C
1
star
16

encode.py

A simple but useful scripts for encoding videos.
Python
1
star
17

openwrt-scripts

Additional scripts for OpenWRT.
Lua
1
star
18

ana-hier-proc

Analytic Hierarchy Process (AHP) implementation in Python.
Python
1
star
19

imap-dups

Duplicate mail scanner using IMAP interface.
Python
1
star
20

baroslized-sdk

Simple makefiles to code in some environments.
1
star
21

nine_pm

"Our 9 p.m." is an article-sharing service managed by Chiliphant Project.
Python
1
star
22

depth-first-srch

Depth-first-search implementation for traversing a graph.
C
1
star
23

lr-tabler

Drawing graph of item sets used in LR parsing.
Python
1
star
24

ll-parser

LL Parser written in JavaScript and WebGL.
JavaScript
1
star
25

linked-list

Linked list implementation in C.
C
1
star
26

reflector

Packet relay server suitable for line-based protocol.
Python
1
star
27

chat-server

WebSocket-based chat server which utilizes asyncio
Python
1
star
28

inklos

A hobby operating system.
C
1
star
29

opti-chara-reco

Optical character recognition using artificial neural network.
Python
1
star
30

web-irc

Web-based IRC client using WebSocket
CoffeeScript
1
star
31

speller

Spell checker using trie.
Python
1
star
32

echoer

Simple echo client and server using TCP and UDP.
C
1
star
33

barosl.github.com

The default github pages.
1
star
34

a1tv-betting

Sports betting service for A1 Broadcasting.
Python
1
star
35

bin-srch-tree

Binary search tree implementation.
C
1
star
36

hash-table

A messy implementation of coalesced hashing written in Python and C.
C
1
star
37

a-star

A* search algorithm used to find a path between points.
Python
1
star
38

pgr21-online-server

WebSocket-based server implementation of the PGR21 Online (a.k.a. MMOPGR)
Rust
1
star
39

b-tree

A messy B-tree implementation written in Haskell, Python, and C.
C
1
star