This project is a Pulse listener that listens to Treeherder's job cancellation and retrigger actions in exchange/treeherder/v1/job-actions
and acts upon them.
worker.py
listens toexchange/treeherder/v1/job-actions
in an infinite loop.- When it sees a retrigger actions it makes a retrigger request in buildapi self-serve using
make_retrigger_request
from mozci. - When it sees a cancel action it makes a cancel request in buildapi self-serve using
make_cancel_request
from mozci. - Currently everything is run with
dry_run=True
, so instead of doing requests the script just logs the requests it would have made.
worker.py
reads exchange and topic fromrun_time_config.json
. It then usesHANDLERS_BY_EXCHANGE
, a dictionary defined inconfig.py
to decide what function it will use to handle incoming messages.- Only buildbot topics (e.g.
buildbot.#.#
orbuildbot.try.retrigger
) inexchange/treeherder/v1/job-actions
are supported for now. - The functions to deal with Treeherder's job-actions are defined in the module
treeherderactions.py
From GitHub:
git clone https://github.com/adusca/pulse_actions.git
cd pulse_actions
python setup.py develop
From Pypi:
pip install pulse-actions
First you'll have to create a pulse user in https://pulse.mozilla.org . After that, you should set the PULSE_USER and PULSE_PW environment variables accordingly.
If you installed inside a virtualenv (called venv in this example):
venv/bin/run-pulse-actions
If you installed globally (not recommended):
run-pulse-actions
From the base folder of repository, run: :
python pulse_actions/worker.py
The main goal of this project is to act upon messages from exchange/treeherder/v1/job-actions
, but it can be expanded to add more functionality. Here is a step-by-step guide for creating a "Hello World" client with pulse_actions.
- mozci
- mozillapulse
See bug 1168148 for more details.