After receiving a lot of concerned feedback in a previous attempt, it’s time to clear things up and give it another chance.
Starting today, the Nixpkgs merge bot will be enabled in dry-run mode.
This means that it is not privileged to actually merge anything at all just yet, and instead only prints a comment explaining what it would’ve done if merges were enabled.
The people behind this effort are @Lassulus and @Mic92.
This announcement was written with @infinisil’s help, who’s also in favor of going ahead with this plan.
It got new wind during Thaigersprint with the help from @Scriptkiddi and @Luis-Hebendanz.
How does it work?
This bot will allow Nixpkgs PRs to be merged automatically if they fulfill these main requirements:
-
The PR is created by @r-ryantm, which is @ryantm’s bot that automatically creates PRs using nixpkgs-update.
This relies on various heuristics to update packages, the most notable of which beingupdateScript
.
Check out the manual how to define it for your package.
Currently this bot doesn’t run on official infrastructure, but there are plans to change that. -
The PR only changes files in
pkgs/by-name
, the new way to declare top-level packages.
While most packages aren’t defined there yet, @infinisil is working on an automated migration that is expected to happen soon and will avoid a lot of manual labor.
Restricting topkgs/by-name
is necessary because it’s the only way to reliably determine the updated package from the changed files. -
A maintainer of the updated package posts a comment containing:
@NixOS/nixpkgs-merge-bot merge
This means that if you want to be able to merge automatic updates to the packages you maintain, you need to add yourself to the
lib.maintainers
field of the package.
This also has the effect that you’ll automatically get a review request for new PRs.
The bot will then either merge the PR, or reply with a reason why it can’t be merged.
Since it’s only running in dry-run mode right now, instead of merging, it will reply saying that it can’t be merged because it’s running in dry-run mode.
The reason behind these strict requirements is to both keep it reasonably secure, but also to encourage improving package update automation, which is a key part in making Nixpkgs sustainable in the long-term.
Enabling automated merges
Unless any major problems with this approach are brought up, we plan to start allowing automated PR merging starting 2024-02-23T00:00:00Z.
If you have any feedback, please either reply in this thread, come chat on Matrix, or directly open issues or pull requests in the repository.
Future
The previous announcement has shown that it’s not easy to design such a bot in a secure way.
Because of this, we will not make substantial changes to the merge requirements without getting broader community consensus, such as via an RFC.