servo/etc/taskcluster/treeherder.md

5.2 KiB
Raw Blame History

Treeherder for Servo

Treeherder is tool for visualizing the status of “trees”, meaning branches in various source repositories. It shows each push to the repository with the corresponding commits as well as the CI jobs that were started for that push. While it is possible to write other tools that submit job data, CI integration is easiest with Taskcluster.

Trees / repositories / branches

Treeherders knows a about a number of repostories. Mercurial on Mozillas servers and git on GitHub are supported. Despite the name, in the GitHub case each Treeherder repository maps to one branch in a git repository. They are configured in the repository.json file. As of this writing there are four for github.com/servo/servo, named after the corresponding branch:

In the UI, the “Repos” button near the top right corner allows switching.

servo-auto is the relevant one when a pull request is approved with Homu for landing, since the auto branch is where it pushes a merge commit for testing.

Data flow / how it all works

(This section is mostly useful for future changes or troubleshooting.)

Changes to the Treeherder repository are deployed to Staging soon (minutes) after they are merged on GitHub, and to Production manually at some point later. See current deployment status.

Once a configuration change with a new repository/branch is deployed, Treeherder will show it in its UI and start recording push and job data in its database. This data comes from Pulse, Mozillas shared message queue that coordinates separate services. The Pulse Inspector shows messages as they come (though not in the past), which can be useful for debugging. Note that you need to add at least one “Binding”, or the “Start Listening” button wont do anything.

Push data

When taskcluster-github is enabled on a repository, it recieves webhooks from GitHub for various events such as a push to a branch of the repository.

In addition to starting Taskcluster tasks based on .taskcluster.yml in the repository, in api.js it creates Pulse messages corresponding to those events. Treeherder consumes messages from the exchange/taskcluster-github/v1/push exchange (among others) in push_loader.py. In Pulse Inspector, these messages for the Servo repository can be seen by specifying the primary.servo.servo routing key pattern.

(Taskcluster) job data

The Taskcluster Queue generates a number of Pulse messages about tasks. Each value of the routes array in the task definition, with a route. prefix prepended, is additional routing key for those messages.

Treeherder reads those messages if they have an appropriate route (see in Pulse inspector), However, it will drop an incoming message if the extra.treeherder object in the task definition doesnt conform to the schema. Such schema validation errors are logged, but those logs are not easy to access. Ask on IRC on #taskcluster.

Finally, Treeherder reads that latter kind of message in job_loader.py.