stylix icon indicating copy to clipboard operation
stylix copied to clipboard

ci: review request maintainers

Open 0xda157 opened this issue 9 months ago • 11 comments

Still WIP, waiting for move to nix-community

0xda157 avatar Mar 24 '25 18:03 0xda157

When this is complete we can also remove the "Maintainer CC" section from the pull request template

danth avatar Mar 26 '25 10:03 danth

anyone know why this error is happening?

 error:
       … in the condition of the assert statement
         at /nix/store/g4ppspdl4fy7hnp4jgjl4ll03v7i08w3-source/pkgs/build-support/trivial-builders/default.nix:136:5:
          135|     # TODO: To fully deprecate, replace the assertion with `lib.isString` and remove the warning
          136|     assert lib.assertMsg (lib.strings.isConvertibleWithToString text) ''
             |     ^
          137|       pkgs.writeText ${lib.strings.escapeNixString name}: The second argument should be a string, but it's a ${builtins.typeOf text} instead.'';

       … in the left operand of the OR (||) operator
         at /nix/store/g4ppspdl4fy7hnp4jgjl4ll03v7i08w3-source/lib/asserts.nix:39:31:
           38|   # TODO(Profpatsch): add tests that check stderr
           39|   assertMsg = pred: msg: pred || builtins.throw msg;
             |                               ^
           40|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'name' missing

0xda157 avatar Mar 27 '25 19:03 0xda157

FYI: I believe you can only request review for people who have some rights on the repo (triage I believe).

That's the main reason the NixOS org has a "NixOS/nixpkgs-maintainers" team, see RFC-39.

If maintainers don't join that team (or at least join the org), ofborg can't request their review on PRs.

The github docs hint at the requirements to request and/or be requested, but the phrasing is kinda vague in places.

MattSturgeon avatar May 15 '25 03:05 MattSturgeon

FYI: I believe you can only request review for people who have some rights on the repo (triage I believe).

That's the main reason the NixOS org has a "NixOS/nixpkgs-maintainers" team, see RFC-39.

If maintainers don't join that team (or at least join the org), ofborg can't request their review on PRs.

The github docs hint at the requirements to request and/or be requested, but the phrasing is kinda vague in places.

hmmm if/when when move to nix-community (me and danth have agreed on this, waiting for response from @trueNAHO) we could make a stylix maintainers team, not sure if it would make sense to add people as triagers on the current repo.

0xda157 avatar May 15 '25 15:05 0xda157

not sure if it would make sense to add people as triagers on the current repo

Triage only gives non-critical perms, like managing issues, assigning people, requesting reviews, being requestable, etc (OTTOMH).

Generally, if you trust someone to maintain a target module, you should trust them with that level of perm. If someone abuses triage perms then they shouldn't be a maintainer in the first place 🤠

You'd probably want two teams; core-maintainers and target-maintainers. Ideally core-maintainers and/or a bot would have perms to add people to the target-maintainers team, so the nix-comnunity admins don't need constant involvement.

That should be straightforward to set up.

MattSturgeon avatar May 15 '25 15:05 MattSturgeon

sounds like continuing with this requires @danth who has been busy recently, so this pr will await his return.


@trueNAHO if you could respond to that email from danth about the nix-communtiy that would be great

0xda157 avatar May 17 '25 00:05 0xda157

do you think the current MAX_MAINTAINERS=5 approach is a reasonable heuristic to avoid accidental pings?

Yes, this seems reasonable. A single module having more than 5 active maintainers seems unlikely, and pinging people for many-module changes is what we want to avoid.

I believe you can only request review for people who have some rights on the repo

From the UI, I believe this is the case (it only gives me core maintainers and Copilot as possible choices).

We could either:

  • Wait until we migrate to nix-community, and create a target maintainers team (if the nix-community admins agree to this)
  • Or, change the script to just ping people in a comment rather than formally requesting a review

danth avatar May 17 '25 21:05 danth

Wait until we migrate to nix-community, and create a target maintainers team

@zowoq is working on automatically adding our maintainers to a team in nix-community, see https://github.com/nix-community/infra/pull/1837

danth avatar May 21 '25 07:05 danth

Generally, if you trust someone to maintain a target module, you should trust them with that level of perm. If someone abuses triage perms then they shouldn't be a maintainer in the first place 🤠

Generally, our module maintainers are supposed to be the first people we ask for help when working on their module, like for testing their module. Consequently, we are basically adding anyone as module maintainer that is willing to help us out. I don't think we should carelessly give permissions away.

Instead, the following might be better:

  • Or, change the script to just ping people in a comment rather than formally requesting a review

trueNAHO avatar May 23 '25 17:05 trueNAHO

Consequently, we are basically adding anyone as module maintainer that is willing to help us out.

This is no different from nixpkgs maintainers, which operate in the same way.

They have an order of magnitude more maintainers with triage permission (3'708 currently). Have they ran into (major) issues caused by it?

I don't think we should carelessly give permissions away.

I agree, you shouldn't carelessly dish out permissions. Instead, you should consider what damage these permissions can actually do in practice.

Triage: Recommended for contributors who need to proactively manage issues, discussions, and pull requests without write access

What they can do is close issues, PRs, and discussions; request reviews; submit reviews...

However, they cannot merge PRs; approve PRs; push to unprotected branches; "hide" comments; etc.

See Permissions for each role.

If someone abuses any of those permissions, it will be fairly obvious; issues closed when they shouldn't be; etc. In such a case it'll be easy to a) re-open the issue and b) tell the maintainer not to close issues in that particular scenario.

If someone continues to abuse the permission, they can be kicked from the team and/or removed as a maintainer.

On the flip side, empowering maintainers to manage issues may actually be helpful; you'll not need to spend as much time triaging target-specific issues, as you'll have "more hands" available to help out.

MattSturgeon avatar May 23 '25 19:05 MattSturgeon

Consequently, we are basically adding anyone as module maintainer that is willing to help us out.

This is no different from nixpkgs maintainers, which operate in the same way.

They have an order of magnitude more maintainers with triage permission (3'708 currently). Have they ran into (major) issues caused by it?

I don't think we should carelessly give permissions away.

I agree, you shouldn't carelessly dish out permissions. Instead, you should consider what damage these permissions can actually do in practice.

Triage: Recommended for contributors who need to proactively manage issues, discussions, and pull requests without write access

What they can do is close issues, PRs, and discussions; request reviews; submit reviews...

However, they cannot merge PRs; approve PRs; push to unprotected branches; "hide" comments; etc.

See Permissions for each role.

If someone abuses any of those permissions, it will be fairly obvious; issues closed when they shouldn't be; etc. In such a case it'll be easy to a) re-open the issue and b) tell the maintainer not to close issues in that particular scenario.

If someone continues to abuse the permission, they can be kicked from the team and/or removed as a maintainer.

On the flip side, empowering maintainers to manage issues may actually be helpful; you'll not need to spend as much time triaging target-specific issues, as you'll have "more hands" available to help out.

Good point. In that case, are waiting on https://github.com/nix-community/infra/pull/1837:

Wait until we migrate to nix-community, and create a target maintainers team

[zowoq] is working on automatically adding our maintainers to a team in nix-community, see https://github.com/nix-community/infra/pull/1837

Or should we

change the script to just ping people in a comment rather than formally requesting a review

in the meantime? I don't think this PR has a high priority, which means we can just wait on https://github.com/nix-community/infra/pull/1837.

trueNAHO avatar Jun 04 '25 15:06 trueNAHO

@trueNAHO made some changes to the nix side but don't really understand jq, could you help me update the bash/jq part of this pr?

0xda157 avatar Jul 23 '25 18:07 0xda157

The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
Error: HttpError: You do not have permission to create labels on this repository.: {"resource":"Repository","field":"label","code":"unauthorized"}
Error: You do not have permission to create labels on this repository.: {"resource":"Repository","field":"label","code":"unauthorized"}

-- Label PR, "Run actions/[email protected]"

This error seems unrelated to this PR and might have been somehow introduced by commit c4f87ef ("ci: add more top-level labels to provide better overview (#1755)"). Maybe git rebase master resolves the issue?

Weird that the third CI attempt was successful. Maybe it has something to do with the fact that I added and adjusted the descriptions of the new labels in the meantime... Either way, LGTM.

The problem was I forgot to add the new labels after merging #1755. I did add them when I was working on testbed stuff last night, but the failing labeling ci needs to be manually rerun.

0xda157 avatar Jul 27 '25 17:07 0xda157

This shouldn't be merged until @danth has confirmed he made the required changes to https://github.com/apps/stylix-automation (or makes it possible for NAHO or me to make those changes ourself).

0xda157 avatar Jul 27 '25 18:07 0xda157

I've updated the permissions on the app, sounds like @zowoq needs to approve the changes before it takes effect.

danth avatar Jul 28 '25 14:07 danth

or makes it possible for NAHO or me to make those changes ourself

Would transferring ownership of the app to nix-community help with this? I can't see any other way to grant other people access to it.

danth avatar Jul 28 '25 14:07 danth

sounds like @zowoq needs to approve the changes before it takes effect.

Done.

Would transferring ownership of the app to nix-community help with this? I can't see any other way to grant other people access to it.

I think transferring the app would allow access to other people but changes still need to be approved by by an org owner anyway.

zowoq avatar Jul 28 '25 23:07 zowoq

Successfully created backport PR for release-25.05:

  • #1808

stylix-automation[bot] avatar Jul 30 '25 14:07 stylix-automation[bot]