nblock's ~

Snolla

From time to time it is necessary to write some glue code in order to connect software products with each other. At work, we use GitLab to manage our git repositories and Bugzilla as our bug tracker. One thing that bothered me, was that the information buried in a git commit message does not necessarily make its way to the bug tracker. If one looks at the history of a bug, one might have no clue where the actual fix to a bug is. That was the main reason to create Snolla, a very minimalist project to connect GitLab with Bugzilla. It is written in Python 3 using Flask and python-bugzilla. Since Snolla worked for several months without any problems, I decided to release it as free software (AGPLv3). You can find it on github.

How does it work?

Snolla extracts some of the information found in GitLab webhooks in order to execute certain tasks on a Bugzilla instance. Currently, it can create comments on a referenced bug. In the default configuration, it searches for one of the following keywords followed by a »#« and a numeric bug id:

  • comment
  • comments
  • mention
  • mentions
  • see
  • seealso

For example, the commit message »Fix off-by-one error in foo (see #42).« in the master branch of the project foobar creates the following comment in bug 42 within Bugzilla:

author: John Doe <johndoe@example.com>
url: <The url the commit in gitlab>
branch: master
message: Fix off-by-one error in foo (see #42).

Features

Restrict to certain branches
Snolla can be configured to limit the keyword search to specific branches or group of branches (e.g. »master«, »bugfix/«, …).
Easily extendable
Snolla has been designed to be easily extendable. One may add support for new frontends (GitHub, BitBucket, …), new backends (Redmine, Jira, …) or new tasks (close a bug, …).
Highly customizable
Snolla ships a fairly well documented example configuration. Just copy the configuration to /etc/snolla.conf and adjust it to suit your needs.
Free software
Snolla is licensed under the AGPLv3 license.

Requirements

In order to use Snolla, you need to:

  • Add a webhook to the project configuration in your GitLab instance pointing to Snolla.
  • Create a user in Bugzilla that is allowed to comment on bugs.
  • Setup a WSGI server to run Snolla on. In the project's README file, a sample setup using nginx and uwsgi is described.
  • Copy the file snolla.conf.example to /etc/snolla.conf and change it to suit your needs.

For more information on how to setup Snolla, refer to the README at its github page.

Feedback? Contact me!


permalink

tagged bugzilla, gitlab, gluecode and snolla