The Emacs package zuul.el provides functionality to conveniently browse Zuul build logs from within Emacs. It utilizes Zuul’s REST API to query for builds and buildsets. The idea behind using Emacs, instead of a browser, is that we have alot of built in functionality available to enhance the experience.

The package essentially transform the build log into a compilation buffer, which has run remotely, but now acts as if it would have been run locally. In this blog post there are gifs showing the capabilities of the package. Some of its content have been obfuscated using functionality from alphapapa’s unpackaged.

Selecting a build

The function zuul-open-build-log can be called with either a query list, or a function which returns a query list. The user can either chose to construct a query for builds or for buildsets. The latter is a collection of builds for a specific patchset.

Build query

Build query

For the build query the user can select a build among a list of candidates. The candidates are presented with metadata to show relevant information such as state, pipeline and duration. Upon selecting a build the package switches to a buffer with the build’s log.

Buildset query

Buildset query

For the buildset query the user gets to select a patchset from a list of candidates. Additional metadata like state, duration and a summary are shown. When a buildset is selected list of the buildset’s builds are shown, which is the result of a build query.

Zuul log mode

In a build log the major mode zuul-log-mode is activated. The log is represented as a shell buffer, consisting of prompts, commands and outputs.

Prompt navigation

Prompt navigation

The user can navigate between the prompts in the buffer with zuul-next-command and zuul-previous-prompt. There is also support for imenu in the buffer.

Imenu navigation

Imenu navigation

The minor mode compilation-minor-mode is enabled in the buffer, which provides the possibility to navigate between errors in the log with the commands next-error and previous-error.

Error navigation

Error navigation

Because the build logs originates from remote machines, the absolute paths to source files might differ compared to the local host. The zuul.el package therefore implements its own function to locate the source code on the local machine. The user needs to configure a mapping between the name of a project and the path to the repository.

Open source code referenced in error

Open source code referenced in error

Once the user has understood the root cause of the error, and come up with a solution for it, it can be a good idea to make sure it solves the issue. The package therefore provides the zuul-run-build-command to run any command from the build log from the root of the project.

Rerun command

Rerun command

The package is available on GNU ELPA at the time of writing and should be easy to install and configure. So if you are an Emacs user who interact with Zuul, give it a try.