How the 4 trunk branches and buildbot work together
This page aims to explain the mechanisms that make the wonderful diagrams on the "where is trunk?" page work.
There are three main components:
- PQM -- this is how changes get into the devel and db-devel branches
- buildbot -- this is what runs the tests.
- buildbot-poll.py -- this script monitors the branches and builds on buildbot and implements much of our policy.
There is a (currently private) branch on launchpad that contains the buildbot config and the buildbot-poll.py script.
The buildbot UI is currently also private, but this will change, hopefully soon.
PQM
PQM is a robot that processes requests to merge branches into either devel or db-devel.
For devel, all the requests come from developers.
For db-devel, many requests are generated by buildbot-poll.py merging stable into db-devel.
PQM checks that the commit message matches the required regexp, that the branch merges cleanly into the target branch, and, for devel only, that the change does not introduce any database changes.
PQM has two configs: the default config and the 'testfix' config. The buildbot-poll.py script is responsible for switching between the configs.
Buildbot
Buildbot is our continuous integration tool of choice.
At one level, it's fairly simple: when a change is detected on the devel or db-devel branches on launchpad, the tests are run on that branch and their success or failure noted.
Buildbot also runs some non-trunk builds -- for example, testing devel against bzr.dev -- but these are ignored for the purposes of this page.
In general in buildbot, a "change source" produces "changes" which are fed to a "scheduler" which can examines the change to determine whether to trigger a build.
The change source we use is the "BzrPoller" in bzrbuildbot/poller.py in the lpbuildbot branch. It is configured with a list of URLs to watch and when it sees a new revision in one of these branches, it feeds it to buildbot.
The scheduler we use for the two trunk builders is "AggregatingTestfix"
Buildbot
buildbot-poll.py
This script checks the status of the builds on buildbot and does two main things depending on what it finds:
- it swaps PQM in and out of 'testfix' mode.
- it makes sure the stable and db-stable branches are up to date with the last known good revision.