Continuous integration/Workflow

This article describes how we trigger tests on changes being submitted to a project as well as the tools integrated to fulfill the workflow.

Tools

 * Gerrit
 * it hosts the WMF git repository and provides an interface to review the code. Developers send a patchset which is then enqueued in the review queue and is not actually merged until it has been approved. Whenever a patchset is sent or is approved, Gerrit generates an event we react on.


 * Jenkins
 * This is a job control system which can be used to run unit tests, generate tarballs or whatever we can think about. Each job is a set of instructions (such as running a shell script or reporting test result) and can accept parameters to finely tune the job execution.


 * Zulu
 * Is a daemon listening for Gerrit events, according to a workflow specification file, it can trigger Jenkins jobs and pass them various parameters (ex: the Gerrit change number).

Roles
To be described: contributor, reviewer, integrator, releaser.

From patch to merge
Whenever a patch is uploaded, we run basic checks to detect the most trivial errors. Whenever the checks fails, the contributor is shown a list of action to handle and invited to update a new patch.

Once the checks have been completed, Jenkins will flag the change has verified which also mean the change is ready to be reviewed by a human being. Developers, testers or even a non coders will have a look at the code sent, test it and comment about possible issues.

Each person can vote under the code-review with a score varying from -2 (do not submit/merge) to +2 (change approved). Only projects owner and trusted people are able to actually approve a change. Whenever a +2 vote is casted, unit tests are run. For MediaWiki core this include attempting to install MediaWiki and running the full PHPUnit test suite. If the test suite fail, the change is verified and prevented from being submitted (code-review -2). If all tests are successfull, change is ready to be merged.

Basically:
 * linting is done on patch submission
 * unit tests are run once changes are approved (code-review +2)