First-class GitHub team reviews (reverted)#456481
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
eba5e54 to
7e4ef3c
Compare
wolfgangwalther
left a comment
There was a problem hiding this comment.
I just skimmed the code quickly, the two biggest issues we need to sort out:
- This introduces a lot of new bash code, which is against our policy on new CI code.
- We will need to see how to deal with #450864, which currently changes the social contract of Nixpkgs massively, imho.
Also found a specific change that would currently break the labeler.
Blocking this PR, so that it's not accidentally merged.
I guess you mean #450864 (comment) (I suggest opening a new issue), but this PR just depends on the fact that GitHub teams have the same members as the linked
I already complained in #456341 (comment), but I concur that it makes sense for the policy as worded to apply here. I'm not very happy about it because most of the code was already written before the policy existed, and I assumed it wouldn't apply because no new scripts are created and all the review requesting code is written in bash right now. How about this as a compromise: I'll try to rewrite the |
|
@wolfgangwalther I now committed a working JS version of the script as mentioned above, but can you help me integrate it? In particular I'd just like to have a buildable derivation for |
f8f8963 to
3839545
Compare
I believe that a "runnable github-script" thing is fundamentally the wrong thing. We'll want to run this with I didn't look at the script you wrote in full detail, yet, but two notes:
|
780112a to
d53c754
Compare
d53c754 to
e9c544a
Compare
|
@MattSturgeon Thanks for the review and pointers! I knew how code could be run locally, though was originally set on testing it in a real repo (like I've done before on CI changes). However it turns out this isn't easily possible anymore due to the merge queue and maintainer maps. Anyways, I now just tested the code locally to cover as many paths as possible. In particular I used #471082 to test the "PR reviews on behalf of a team" thing. I fixed some minor problems while doing so, and refactored the code a bit for clarity. I'm 95% confident this is going to work in practice now and am ready to do follow-ups if it doesn't. @MattSturgeon want to take another look or give an approve/merge? :D |
|
Matt (or any other member of CI team) is free to merge without this, but I plan to review/test and merge today or tomorrow, personal and family bandwidth permitting. |
There was a problem hiding this comment.
Thanks for working on this! The approach looks good, but I found a few bugs while reviewing.
I ran TypeScript with --checkJs on the JS files and it caught these issues. I will be looking into setting up automatic type checking for ci/github-script/ since it catches problems like this quickly.
e9c544a to
d40dd99
Compare
|
@philiptaron Thank you very much, fixed now! |
ci/github-script/bot.js
Outdated
| .request({ | ||
| method: 'GET', | ||
| url: '/organizations/{orgId}/team/{id}', | ||
| orgId: github.repository_owner_id, |
There was a problem hiding this comment.
I can't find this anywhere. Is this context.payload.repository.owner.id?
There was a problem hiding this comment.
Ohh nice catch, yeah I took this from https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context, but right, that github variable is different from this one.
While context.payload.repository.owner.id doesn't exist, context.payload.pull_request.base.user.id does, now using that! Tested locally
philiptaron
left a comment
There was a problem hiding this comment.
Requesting changes for the github.repository_owner_id thing. I didn't test this locally yet, but I can't find anything in Octokit that would set this.
d40dd99 to
a26b6e7
Compare
Co-Authored-By: Alexander Bantyev <[email protected]>
a26b6e7 to
193deb8
Compare
|
Successfully created backport PR for |
|
We had to revert in #487507, unfortunately. Please see there for details. |
|
Unfortunate, reopened with the fix as #487955 |
This changes automation to request reviews from listed GitHub teams instead of their individual members when possible, allowing the team maintainers to make use of GitHub's advanced code review settings and making the
team-review-requested:NixOS/someTeamPR filter more useful.This applies for:
lib.teamsthat are listed as a package maintainer using the newmeta.teams(thanks to check-meta: add a teams attribute #394797), withlib.teams.*.githubbeing set to the matching GitHub team:ci/OWNERS:This pretty much implements #447514 after the preparatory work of #449986 and #450864.
Things done
Add a 👍 reaction to pull requests you find important.