Speed up your GitLab CI

GNOME GitLab has AWS runners, but they are used only when pushing code into a GNOME upstream repository, not when you push into your personal fork. For personal forks there is only one (AFAIK) shared runner and you could be waiting for hours before it picks your job.

But did you know you can register your own PC, or a spare laptop collecting dust in a drawer, to get instant continuous integration (CI) going? It’s really easy to setup!

1. Install docker

apt install docker.io

2. Install gitlab-runner

Follow the instructions here:
https://gitlab.com/gitlab-org/gitlab-runner/blob/master/docs/install/linux-repository.md#installing-the-runner

(Note: The Ubuntu 18.04 package doesn’t seem to work.)

3. Install & start the GitLab runner service

sudo gitlab-runner install
sudo gitlab-runner start

4. Find the registration token

Go to your gitlab project page, settings -> CI/CD -> expand “runners”

5. Register your runner

sudo gitlab-runner register --non-interactive --url https://gitlab.gnome.org --executor docker --docker-image fedora:27 --registration-token **

You can repeat step 5 with the registration token of all your personal forks in the same GitLab instance. To make this easier, here’s a snippet I wrote in my ~/.bashrc to register my “builder.local” machine on a new project. Use it as gitlab-register .

function gitlab-register {
  host=$1
  token=$2

  case "$host" in
    gnome)
      host=https://gitlab.gnome.org
      ;;
    fdo)
      host=https://gitlab.freedesktop.org
      ;;
    collabora)
      host=https://gitlab.collabora.com
      ;;
    *)
      host=https://gitlab.gnome.org
      token=$1
  esac

  cmd="sudo gitlab-runner register --non-interactive --url $host --executor docker --docker-image fedora:27 --registration-token $token"

  #$cmd

  ssh builder.local -t "$cmd"
}

Not only will you now get faster CI, but you’ll also reduce the queue on the shared runner for others!

Catch leaks in your unit tests

Let’s blog about my little trick that should be useful to everyone: Not everyone runs unit tests in valgrind, and even if they do it’s hard to see leaks from false-positive. Fortunately there is an easy way to catch GObject leaks in a unit test without using valgrind:

foo = my_object_new ();
g_object_add_weak_pointer (G_OBJECT (foo), (gpointer) &foo);
...
g_object_unref (foo);
g_assert (foo == NULL);

Do that on every object in your unit tests, it’s amazing what you can find…

SSH your N9 over 3G even with private IP

Thanks to Collabora, I’ve received an N9. So I’ve build ssh-contact package for it. It was easy since the N9 already has all its dependencies. I’ve simply taken debian’s package and rebuild it in scratchbox with the harmattan SDK.

Here are the packages:
ssh-contact_0.6-1_all.deb
ssh-contact-client_0.6-1_armel.deb
ssh-contact-service_0.6-1_armel.deb

To install them, you can follow the steps from here for example.

ssh-contact has a new home

Thanks to fd.org admin, Tollef Fog Heen, SSH-Contact now has a bugzilla (product=”Telepathy” and Component=”ssh-contact”) on bugs.freedesktop.org. The new place for release tarballs is here.

Debian unstable and Ubuntu maverick already has it packaged, Ubuntu lucid users can get it from our telepathy ppa. I don’t know for other distributions, but if you are packager and love ssh-contact, please push it to your favourite distro 😀

Various plugins for your N900 addressbook

Marco Barisione and myself worked on some plugins to extend the N900’s Contacts application. I grouped them in the fremantle-contacts project on gitorious. You can find on the project wiki page a short description of what we have already. Here is an overview:

Contacts Merger

Plugin to find probable duplicate contacts and allow the user to easily merge them.

Available in extra-devel maemo repository, package name: “contacts-merger”

Extended Contacts Search

Plugin to extend the live search feature on addressbook’s main view. It will also search in contacts phone numbers, nickname, emails and IM usernames.

Available in extra-devel maemo repository, package name: “extended-contacts-search”

Contact Zoom

Plugin to add a Contact Zoom menu option it Contact starter view. The Contact Zoom opens a window with all information about that contact displayed in bigger font, to make it much more readable.

Available in extra-devel maemo repository, package name: “contact-zoom”

Looking for a job

On September I finish my studies of computer science, so I start to search a job. I really enjoyed my current job at Collabora maintaining Empathy, I learned lots of things about the Free Software world and I would like to keep working on free software related projects if possible. My CV is available online here.

Do you guys know any company around the free software and GNOME looking for new employees? You can contact me by email to xclaesse@gmail.com