How it works
worker.pyreads exchange and topic from
run_time_config.json. It then uses
HANDLERS_BY_EXCHANGE, a dictionary defined in
config.pyto decide what function it will use to handle incoming messages.
- The functions to deal with every case are defined in the
- When multiple topics are passed, we use the
route_functions.pyto decide which function to call
- manual_backfill: listens to
buildbot.#.backfill. It calls mozci's
manual_backfillwith the appropriate input.
- backfilling: listens to
unittest.mozilla-inbound.#. It automatically backfills failed jobs. Progress in being tracked on bug 1180732
- resulset_actions: listens to
exchange/treeherder/v1/resultset-actions. It calls mozci's
trigger_all_talos_jobsdepending on the message.
git clone https://github.com/mozilla/pulse_actions.git cd pulse_actions python setup.py develop
pip install pulse-actions
Replaying sample data
You can have re-process sample data from real requests to re-test any new changes:
python pulse_actions/worker.py --replay-file data/sample_queue.json
First you'll have to create a pulse user in https://pulseguardian.mozilla.org . After that, you should set the PULSE_USER and PULSE_PW environment variables accordingly.
If you installed with Pypi:
If you installed inside a virtualenv (called venv in this example):
If you installed globally (not recommended):
If you cloned the repo:
From the base folder of repository, run:
python pulse_actions/worker.py --topic-base MODE
Where MODE is a comma-separated list of the modes you in which you wish to run. You can see some commands in Procfile.
Adding more functionality
Pulse Actions can be expanded to add more functionality. Here is a step-by-step guide for creating a "Hello World" client with pulse_actions.