In NixOS/nixpkgs#378214, there is discussion around how to better integrate nixpkgs-merge-bot in GitHub Actions CI with the main focus on advertising to maintainers that they can use the bot.
This requires one of two things:
- The ability of nixpkgs-merge-bot itself to go through PRs on its own, without reacting to a comment, or
- The ability of nixpkgs GHA to tell which PRs are eligible for the merge bot.
The first option potentially requires a lot of additional architecture in the merge bot itself.
The second option requires us to re-implement the different merge-strategies in nixpkgs-ci to accurately determine when the bot is eligible.
In NixOS/nixpkgs#378214 (comment), I also had an idea to give the merge bot a CLI interface, so that it could be called from within GHA, essentially asking it to evaluate this one specific PR right on the spot, without firing up a server or so.
Here, I'd like to bring up a different idea: Why don't we re-implement nixpkgs-merge-bot directly in nixpkgs-ci as a GHA workflow?
This could significantly reduce the overall complexity.
There is a downside, though: The issue_comment, pull_request_review and pull_request_review_comment events always trigger without permissions or secrets. This means that CI could not merge directly in reaction to that event.
Instead, we'd have to go through all PRs periodically, look for comments and then act on them. We already do this for labeling, updated PRs will be reacted to within 10 minutes. If we're OK with "I'll post a comment and the first reaction from the bot might be up to 10 minutes later", then this should make things significantly simpler to implement. We could potentially bring this 10 minute interval down to 5 minutes, too, if we thought this was worth it.
Imho, this is only doable, because we now have auto-merge enabled. This allows us to enable auto-merge at the time of going through the comments - and when CI passes, it will be done. Without auto-merge, we would have to keep coming back to a PR that was not recently updated (CI success doesn't count as update). We would have to figure out how to nicely integrate OfBorg into that, but given that it's currently not checked anyway, that shouldn't be a blocker.
One upside I see: We can more easily go towards actually auto-merging stuff via CI. For example these could be enabled for automated updates via a meta/passthru attribute for certain conditions (enough tests, ofborg passing, etc.). I think these things are also ideas discussed in the RFC. Doing this in GHA should be simpler than here, when dealing with all the events etc.
cc @NixOS/nixpkgs-ci
In NixOS/nixpkgs#378214, there is discussion around how to better integrate nixpkgs-merge-bot in GitHub Actions CI with the main focus on advertising to maintainers that they can use the bot.
This requires one of two things:
The first option potentially requires a lot of additional architecture in the merge bot itself.
The second option requires us to re-implement the different merge-strategies in nixpkgs-ci to accurately determine when the bot is eligible.
In NixOS/nixpkgs#378214 (comment), I also had an idea to give the merge bot a CLI interface, so that it could be called from within GHA, essentially asking it to evaluate this one specific PR right on the spot, without firing up a server or so.
Here, I'd like to bring up a different idea: Why don't we re-implement nixpkgs-merge-bot directly in nixpkgs-ci as a GHA workflow?
This could significantly reduce the overall complexity.
There is a downside, though: The
issue_comment,pull_request_reviewandpull_request_review_commentevents always trigger without permissions or secrets. This means that CI could not merge directly in reaction to that event.Instead, we'd have to go through all PRs periodically, look for comments and then act on them. We already do this for labeling, updated PRs will be reacted to within 10 minutes. If we're OK with "I'll post a comment and the first reaction from the bot might be up to 10 minutes later", then this should make things significantly simpler to implement. We could potentially bring this 10 minute interval down to 5 minutes, too, if we thought this was worth it.
Imho, this is only doable, because we now have auto-merge enabled. This allows us to enable auto-merge at the time of going through the comments - and when CI passes, it will be done. Without auto-merge, we would have to keep coming back to a PR that was not recently updated (CI success doesn't count as update). We would have to figure out how to nicely integrate OfBorg into that, but given that it's currently not checked anyway, that shouldn't be a blocker.
One upside I see: We can more easily go towards actually auto-merging stuff via CI. For example these could be enabled for automated updates via a meta/passthru attribute for certain conditions (enough tests, ofborg passing, etc.). I think these things are also ideas discussed in the RFC. Doing this in GHA should be simpler than here, when dealing with all the events etc.
cc @NixOS/nixpkgs-ci