--- layout: post title: Reconfiguring Buildbot / Buildbot short intro 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. ;)