Project: shipit-pulse-listener

contact:Bastien Abadie, (backup Release Management)

This is a monitoring component that reacts to Pulse messages, like:

It also polls for new things to do:

When it has captured a new event, it triggers tasks:

  • shipit_code_coverage: triggered after builds finished, to gather and upload coverage data;
  • shipit_static_analysis: triggered on review requests, to provide linting and static analysis reports through a comment made by a bot.

This project is hosted on Heroku, as a worker dyno. We use several instances of this service for production, staging and testing.

The hooks

The functionality described above is implemented in a few classes defined in shipit_code_coverage/listener.py:

  • HookPhabricator: Taskcluster hook handling the static analysis for Phabricator differentials. This polls the Phabricator API (the differential.diff.search endpoint) every minute for new revisions.
  • HookStaticAnalysis: Taskcluster hook handling the static analysis for MozReview. This handles Pulse messages with route mozreview.commits.published by extracting the new commits from the message payload.
  • HookCodeCoverage: Taskcluster hook handling code coverage. This listens for task-group-resolved pulse messages and filters for mozilla-central code coverage build tasks. When one suitable task is found, it uses the hg.mozilla.org revision hash to trigger a code coverage upload task.

When these listeners run successfully, they will call back to Taskcluster to create new tasks. As an example, see the shipit code coverage production hook and shipit static analysis production hook on the Taskcluster Hooks Manager.