Previous: WebStatus Configuration Parameters, Up: WebStatus


4.14.1.3 Change Hooks

The /change_hook url is a magic URL which will accept HTTP requests and translate them into changes for buildbot. Implementations (such as a trivial json-based endpoint and a github implementation) can be found in master/buildbot/status/web/hooks. The format of the url is /change_hook/DIALECT where DIALECT is a package within the hooks directory. Change_hook is disabled by default and each DIALECT has to be enabled separately, for security reasons

An example WebStatus configuration line which enables change_hook and two DIALECTS:

     c['status'].append(html.WebStatus(http_port=8010,allowForce=True,
                             change_hook_dialects={
                                     'base': True,
                                     'somehook': {'option1':True,
                                                 'option2':False}}))

Within the WebStatus arguments, the change_hook key enables/disables the module and change_hook_dialects whitelists DIALECTs where the keys are the module names and the values are optional arguments which will be passed to the hooks.

The post_build_request.py script in master/contrib allows for the submission of an arbitrary change request. Run post_build_request.py --help for more information. The 'base' dialect must be enabled for this to work.

github hook

The github hook is simple and takes no options.

     c['status'].append(html.WebStatus(..
                         change_hook_dialects={ 'github' : True }))

With this set up, add a Post-Receive URL for the project in the Github administrative interface, pointing to /change_hook/github relative to the root of the web status. For example, if the grid URL is http://builds.mycompany.com/bbot/grid, then point Github to http://builds.mycompany.com/bbot/change_hook/github. To specify a project assoicated to the repository, append ?project=name to the URL.

Note that there is a standalone HTTP server available for receiving github notifications, as well: contrib/github_buildbot.py. This script may be useful in cases where you cannot expose the WebStatus for public consumption.