[Nix-dev] Nixbot - a little helper for pull requests

Louis Taylor louis at kragniz.eu
Fri May 6 06:27:39 CEST 2016


Hi all,

Due to a certain dissertation being submitted, I've had a bit of free time over
the last day or two. I hacked up a quick prototype of a bot to help with
maintainers getting pull requests merged for the packages they maintain.

There's previously been talk about related topics. I've some opinion on what
this should look like, but code talks a lot louder than words:

    https://github.com/kragniz/nixbot

The basic gist of this implementation is that data about maintainers and a list
of patterns of files they should have access to is stored (right now it's in a
simple JSON file) e.g.

	{
      ...
		"goibhniu": [
			"pkgs/applications/audio/synthv1/*",
			"pkgs/os-specific/linux/xf86-input-wacom/*",
			"pkgs/development/libraries/frei0r/*",
			"pkgs/applications/audio/fluidsynth/*",
			"pkgs/development/libraries/aubio/*",
      ...

If a pull request is submitted that contains changes for a package, the
maintainer for that package may comment "@nixbot merge this please" to have it
merged without that maintainer needing to have commit rights for the entirety
of nixpkgs. Merging is not permitted via this method to contributors who are
not maintainers of the package being modified.

You can see it doing its thing here:

    https://github.com/nixbot/nixpkgs-sandbox/pull/9

in this example, the package being modified (openttd, a good game in case
anyone was wondering) does not list joachifm as a maintainer. This means his
polite request to merge falls upon deaf ears. fpletz is a maintainer, however,
which allows him to request a merge. If you'd also like to play with a live
version of the bot, open pull requests against
https://github.com/nixbot/nixpkgs-sandbox and comment on them. (This repository
was created for testing and will likely be removed before long)

While this is a simple implementation currently, more complex things such as
hydra or travis integration and requiring more than one vote to merge are
possible in the future if this is a direction people want to take.

So, thoughts and comments on this approach?

Cheers,
Louis


More information about the nix-dev mailing list