The automatic gatekeeper workflow

The automatic gatekeeper workflow is a variant of the human gatekeeper workflow, except that the role of the gatekeeper is implemented by a program or script performing automated tasks instead of a human. This setup has some interesting advantages:

  • It provides a mainline branch that is always up-to-date automatically, giving the illusion of a central branch, even though collaborators still work independently in a distributed manner
  • It automates repetitive tasks, such as running non-regression tests and other validations of the common guidelines, automatically rejecting merge proposals that don't pass

Naturally, unlike a human gatekeeper, an automated process cannot evaluate the merge proposals from a strategic perspective. Any change that passes the automated test will be merged into the mainline even if it is not a good idea from a functional point of view.

Having an automated gatekeeper is probably better than not having one at all. Basically, it allows for an up-to-date mainline branch without human interaction, much like in a centralized workflow, but while still enjoying all the benefits of distributed version control.

Patch Queue Manager (PQM)

PQM is a software tool that implements the role of an automatic gatekeeper of Bazaar branches. It is implemented in Python and it uses Bazaar's libraries and API to perform the necessary branch operations.

PQM must be configured with write access to a dedicated branch, where it can push accepted merge proposals. PQM performs the following operations when processing a merge proposal:

  1. Branch from the mainline.
  2. Merge from the proposed branch.
  3. Commit the merge.
  4. Push to the mainline.

If any of these steps fail, the branch is rejected with an e-mail notification to the author.

Ideally, automated non-regression tests should be configured in a pre-commit hook of the branch, which is triggered when PQM tries to commit. The implementation of such a hook is specific to the project, and thus not a part of PQM itself.

PQM is merely the framework for automating the often repetitive tasks of accepting and rejecting merge proposals. It is the responsibility of the maintainers of the project to implement thorough non-regression tests triggered by a pre-commit hook.

The PQM project is hosted on Launchpad, and used extensively by Ubuntu projects (https://launchpad.net/pqm).

See the project website for more information and detailed setup instructions.

Revision history graph

The end result of the revision history graph is essentially the same as in the human gatekeeper workflow—the mainline has only merge commits, and all other branches should be feature branches. For a realistic example, get the source code of Bazaar itself and view its revision history:

$ bzr init-repo /tmp/bazaar
$ cd /tmp/bazaar
$ bzr branch lp:bzr  # will take some time!
$ bzr qlog bzr
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.44.229