summaryrefslogtreecommitdiff
path: root/_posts/2023-07-23-reconfig-buildbot.md
blob: 7a33df70589e0e1d4780d05658e716b45034ed1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
layout: post
title: Reconfiguring Buildbot
date: 2023-07-23 14:49 +0200
lang: en
categories: tech
---

Recently, I started moving my repositories from [Gitea](https://gitea.io/)
to [Gitolite](https://gitolite.com/). Main reason was that I forgot to
regularly update my Gitea instance, it's a program that constantly runs
in the background, and I wasn't using the Issues / Wiki / etc. features
anyway. Technically, a very simple bare repo would do the trick as well,
since I'm the only user. But why not try something out while I'm at it?

(Gitea is a project / source management system, think of a self-hosted version
of Github.  
Gitolite is a small program that gets called when you
`git fetch` or `git push` and determines if your ssh public key has
the permissions to perform the operation. It manages the repositories
and allows for pretty fine-grained access control.)

Because I didn't look properly, I didn't find the `git_buildbot.py` script
anymore. (It's in the
[buildbot-contrib](https://github.com/buildbot/buildbot-contrib/blob/master/master/contrib/git_buildbot.py)
repo btw). Also, it annoyed me that buildbot created a build for every
single change (commit), even though I had the `collapseRequests`
config option set to `True`. (Spoiler alert. Turns out I had
the `treeStableTimer` of the `SingleBranchScheduler` set to `None`.)

So I actually went through the documentation headings, noticed "Change Hooks" and
thought "Oh, surely this is the solution!". I only enabled the `base`
dialect and tried various curl requests, which resulted in changes being
submitted, but no builds being triggered. Clarification set in when I re-read
my `master.cfg` again and saw that the `SingleBranchScheduler` had
a filter set to only build on the master branch. After facepalming at myself,
the curl request

    curl -v "http://localhost:8010/change_hook?comments=force_build&author=uvok&branch=master"

indeed triggered a build! Since I don't care about the actual
commit messages being shown in buildbot, this would be the perfect
solution!

However, at this point I also discovered that the `treeStableTimer` was
set to `None` (see above), so I decided to keep using the provided
`git_buildbot.py` script. - Even though that means I have to install
`python3-twisted` globally on the system (since I don't wanna figure
out how to activate a venv from a git hook).

Anyway, here's a very simplified diagram of the buildbot architecture:

![Buildbot architecture](/assets/buildbot.svg)

Note that the [Buildbot documentation](https://docs.buildbot.net/latest/manual/introduction.html)
has a far more detailed diagram.

Morale of the story: Read the manual, even if it's frustrating if you just want to
get a single small thing done. ;)