Treeherder: GSoC’20

Suyash Salampuria
5 min readAug 24, 2020

--

Treeherder is a reporting dashboard for Mozilla checkins. It allows users to see the results of automatic builds and their respective tests. The Treeherder service manages the etl layer for data ingestion, web services, and the data model behind Treeherder. Push Health is a dashboard inside treeherder to determine if a push is “good” based on calculations of Tasks and Tests success rate within the push and historically.

For the last three months, I’ve been working with Mozilla as a part of the Google Summer of Code program. It has been an amazing experience and I’ve learned a lot over the summers under the mentorship of Joel Maher, Cameron Dawson, and Sarah Clements. Before the GSoC phase, I had some patches with Armen Zambrano in the Treeherder developer experience project too. I really enjoyed learning under all of them.

This blog is going to be a very brief report of all the things implemented, goals accomplished, some stuff that’s left to do, and future plans.

InfraStructure Compare View [BUG]
It is a dashboard in Treeherder which has been implemented from scratch. Under the mentorship of Joel, I had built this dashboard in nearly a month’s time. It is basically a tool to provide parity. There could be different machines and large changes to OS which one needs to verify and monitor the changes well. The changes could be mainly in the time duration of the failing jobs on that revision or the number of failures on that revision. It involved creating a new Django viewset and a React page to calculate and display results. More info on it can be found here.

UX Improvements to the Log Viewer [BUG]
After the Treeherder folks had a few interviews with the regular users of Log Viewer, we got many ideas about the UX issues existing in the Treeherder. This required working with the other users and thinking from the perspective of a user and it involved changes the UI and also adding proper accessibility for the users.

Login Improvements [BUG]
Mozilla uses auth0 for authentication. Treeherder, at that time, used implicit flow, which has a few drawbacks of storing cookies for a max of two hours. So, we wanted to move to the authorization flow. Although this task was not completed by me, I learned and helped in understanding how auth0 is used and how it should be properly integrated.

Add the number of retriggers to the Push Health Dashboard [BUG]
Push health has a dashboard which shows us a list of revisions along with some details. We discussed what extra details. The number of times a revision has been retriggered seemed to be an essential thing to be present on the dashboard.

Add Tests for Fuze and upgrade the Fuze version [BUG]
Treeherder uses Fuze.js to search from a list of jobs. We were using fuze3.4.6 which had become slow and outdated.I added the corresponding tests for them in the React-testing library and then successfully upgraded the version to 6.0.4 . The best part of it being the version can automatically be upgraded by the renovate bot without breaking it.

Changed the Push Information UI on the Push Health page [BUG]
We have fully changed the design of Push Health in almost a month’s time. I gave the new look to the Push Header Information. Some of the key tasks done were:
1. Replaced the simple progress bar with a donut chart(Victory Pie Chart) with proper tooltips.
2. Designed and coded the new UI of information related to the Push and the revisions.

Create a centralized list of Jobs of the failing tests so that they can be used to reference throughout in the UI [BUG]
This was a major change to increase the efficiency of push health. The jobs which are failing may be actually present on several test failure lines and hence several tests, thereby increasing the download size and making the API slower to load. I created a list of centralized jobs in the API and used wherever it was needed- both in backend and frontend code

Persist Changes in the URL in Push Health [BUG]
The failing tests have grouped and ordered in optimal ways in Push Health.

We have implemented this feature such that at category we click, the changes will be persisted in the URL overriding the previous params and removing the lower level changes

Bulk action handling [BUG]
This feature would allow users to keep track of what tests have been investigated by him and what has to be investigated yet. So, we created a new model for it and would store in it what tests have been investigated along with their jobType Name and the push to which the test is related. This would help us in getting the tests that have been investigated.

Pre GSoC phase

During the pre-GSoC period, I worked on the Treeherder developer experience project. I was mentored by Armen Zambrano. I worked on several bugs to make developer experience on Treeherder better. Some of the bugs I worked were:

Add black as a pre-commit hook to treeherder [BUG]
Earlier, we used isort as a pre-commit hook. It did not auto-format the python code automatically and we got the errors on pushing to Travis one by one. So, I integrated Black as a pre-commit hook into the repo and it does not allow us to commit until the code is formatted properly. Also, it autoformats the code automatically when we commit.

Running all pre-commit hooks automatically
As of now, we use 5 pre-commit hooks in our repo — flake8, shellcheck, prettier, markdownlint, black. We want to run each of these automatically on Travis before all the tests pass. So, all the pre-commit hooks are run automatically.

Auto delete Pulse queues [BUG]
Since we started using shared credentials with random queue names, every time a developer started ingesting data locally it would leave some queues behind in Pulse. When the local consumers stopped, these queues would overgrow and send the Treeherder maintainers alerts about it. With this change, the queues would automatically be destroyed when the consumers ceased to consume.

Merge Ingest push to ingest Management command
Earlier, we used commands for ingesting pushes into our local system. I merged the two commands into one so that we have just one command for local ingestion now.

More than an internship

I would like to thank all my mentors for being awesome mentors who were always very encouraging and understanding. In spite of their busy schedule, they were really responsive which helped to get me my doubts cleared as soon as possible.

It was a great summer working on this project and since I am familiar with a large part of the project, I would continue to contribute and keep adding new features or solving bugs in the Treeherder. GSoC is not the end!

Thank you!

--

--