Skip to content

lib.teams: Sync from GitHub (members/shortName/scope)#450864

Merged
infinisil merged 11 commits intoNixOS:masterfrom
tweag:github-team-sync
Oct 27, 2025
Merged

lib.teams: Sync from GitHub (members/shortName/scope)#450864
infinisil merged 11 commits intoNixOS:masterfrom
tweag:github-team-sync

Conversation

@infinisil
Copy link
Member

@infinisil infinisil commented Oct 11, 2025

This implements the basis of #447514 (comment) by:

  • Adding a workflow that runs weekly to synchronise all teams with Nixpkgs access to the maintainers/github-teams.json file
  • Populating the .members, .shortName and .description of lib.teams that have .github set based on github-teams.json
  • Adding an automatically populated .githubMaintainer field containing contact information of the GitHub team maintainers, making it easier to know who to ask to join such a team

In order to bring the state of lib.teams in sync with GitHub, I compared the outputs of the two and made two commits to update either lib.teams or github-teams.json, see commit messages for details.

TODO

  • Test the workflow: maintainers/github-teams.json: Automated sync infinisil-test-org/nixpkgs#47
  • Make all the changes listed in the "maintainers/github-teams.json: Manual adjustment of necessary changes" commit subject
  • Make sure lib/tests/teams.nix works
  • Code owners (especially for maintainers/github-teams.json, somebody needs to merge the updates)
  • Docs
  • Check performance
  • Test that CI fails when a GitHub user part of a team doesn't have a maintainers entry

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 6.topic: lib The Nixpkgs function library 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: teams Relating to team creation, updates, other management actions 6.topic: policy discussion Discuss policies to work in and around Nixpkgs backport release-25.05 labels Oct 11, 2025
@Eveeifyeve
Copy link
Member

Eveeifyeve commented Oct 11, 2025

Also good point, would this be able to make specifying teams on the website better at https://nixos.org/community/#governance-teams?

@infinisil infinisil force-pushed the github-team-sync branch 3 times, most recently from 7f154c8 to 14cc579 Compare October 20, 2025 17:24
@infinisil infinisil marked this pull request as ready for review October 20, 2025 17:27
@infinisil
Copy link
Member Author

After some minor changes, I consider this ready!

wolfgangwalther

This comment was marked as resolved.

@wolfgangwalther

This comment was marked as resolved.

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 21, 2025
@infinisil infinisil force-pushed the github-team-sync branch 3 times, most recently from 3d8e834 to e913853 Compare October 21, 2025 16:29
@infinisil
Copy link
Member Author

@wolfgangwalther
Copy link
Contributor

Backport not needed because the workflow runs on a schedule, which only trigger on the default branch.

No, that's the wrong conclusion. We backport every change to CI, otherwise we will hit merge conflicts later, for example for automated dependabot PRs etc.

This should be backported as well.

@nixpkgs-ci

This comment was marked as resolved.

@wolfgangwalther
Copy link
Contributor

We could consider whether the team sync and the weekly PRs should all get backported though.

And yes, I think we should do that, too. That's because requesting reviewers always works with the target branch's data, so we want up2date data on the stable branches, too. That means we need to backport the sync, which in turn means we need to backport everything leading up to it.

@infinisil are you working on the backport or should i?

@infinisil
Copy link
Member Author

@wolfgangwalther Not working on the backport right now, but I could later today

@wolfgangwalther
Copy link
Contributor

I'm working on the backport right now. Need to backport a few maintainer additions, too...

@wolfgangwalther
Copy link
Contributor

Backport in #456422.

@wolfgangwalther wolfgangwalther added the 8.has: port to stable This PR already has a backport to the stable release. label Oct 28, 2025
@infinisil
Copy link
Member Author

After fixing #450864 (comment) and manually triggering it, we've got the first automated sync PR: #456477 :D

infinisil added a commit to wolfgangwalther/nixpkgs that referenced this pull request Oct 28, 2025
This makes `lib.teams` be in sync with the GitHub state.

Add the marketing-team so that all teams in `lib.teams` can be requested for reviews.

Add these members to the respective teams:
- beam: minijackson (53e70ab)
- beam: savtrip (f9ff37c)
- cuda: prusnak (748896a)
- geospatial: autra (7de303b)
- geospatial: l0b0 (510eb51)
- gnome: bobby285271 (066634e)
- gnome: dasj19 (c57c936)
- k3s: heywoodlh (2ca18a8)
- k3s: rorosen (b9f397d)
- php: piotrkwiecinski (148e322)
- qt-kde: mjm (f6bb8a9)
- qt-kde: NickCao (f6bb8a9)
- qt-kde: ilya-fedin (f6bb8a9)
- qt-kde: K900 (f6bb8a9)
- qt-kde: SuperSandro2000 (f6bb8a9)
- qt-kde: LunNova (f6bb8a9)

Remove these members from the respective teams:
- geospatial: das-g (b93d987)
- haskell: expipiplus1 (e134422)
- haskell: peti (NixOS#450864 (comment))
- k3s: yajo (8b23811)
- k3s: superherointj (7354bda)
- ocaml: superherointj (7354bda)
- php: drupol (cabc16d)
- php: globin (e5d552f)
- documentation-team: fricklerhandwerk (https://discourse.nixos.org/t/the-next-chapter-in-nix-documentation/68425)

Copy these team descriptions from `lib.teams.*.scope` to the GitHub team description:
- nixpkgs-ci: Maintain Nixpkgs' in-tree Continuous Integration, including GitHub Actions
- cuda: Maintain CUDA-enabled packages
- darwin: Maintain core platform support and packages for macOS and other Apple platforms
- documentation-team: Maintain nixpkgs/NixOS documentation and tools for building it. https://nixos.org/community/teams/documentation
- enlightenment: Maintain Enlightenment desktop environment and related packages
- flutter: Maintain Flutter and Dart-related packages and build tools
- geospatial: Maintain geospatial, remote sensing and OpenStreetMap software
- golang: Maintain Golang compilers
- haskell: Maintain Haskell packages and infrastructure
- k3s: Maintain K3s package, NixOS module, NixOS tests, update script
- lisp: Maintain the Lisp ecosystem
- lua: Maintain the lua ecosystem
- lumina: Maintain lumina desktop environment and related packages
- lxqt: Maintain LXQt desktop environment and related packages
- neovim: Maintain the vim and neovim text editors and related packages
- ocaml: Maintain the OCaml compiler and package set
- pantheon: Maintain Pantheon desktop environment and platform
- qt-kde: Maintain the Qt framework, KDE application suite, Plasma desktop environment and related projects
- nixos-release-managers: Manage the current nixpkgs/NixOS release
- rocm: Maintain ROCm and related packages
- rust: Maintain the Rust compiler toolchain and nixpkgs integration
- systemd: Maintain systemd for NixOS
- xen-project: Maintain the Xen Project Hypervisor and the related tooling ecosystem

(cherry picked from commit 6d89dcd)
@mdaniels5757
Copy link
Member

This makes CI fail for me in #455942, because the maintainer I am proposing to drop is a member of a team, and I remove their maintainers entry.

This makes sense, and the error message was even descriptive of the actual problem! But I'm not really sure what the solution is. Should I ping an org owner, or someone listed in the "maintainers" field of maintainers/github-teams.json? When should I do so: now (during the one-week waiting period), or later? Would they be allowed to remove membership before the waiting period is up? And will we need to wait (in the worst case) a second week for the teams to sync, or is manually running the sync workflow considered to be a reasonable option?

Ideally, I think the answers to these would be addressed in the error messages? I only knew to "blame" this because I had happened to see this PR (although I'm sure grepping for the error message would have gotten me here too), and I only noticed the significance of the "maintainers" field on the second read of this PR.

@infinisil
Copy link
Member Author

Should I ping an org owner, or someone listed in the "maintainers" field of maintainers/github-teams.json?

Pinging the most locally relevant person is always best (in line with our distributed decision-making value!), so yeah team maintainer first, and then to the Nixpkgs core team, and then to org owners.

When should I do so: now (during the one-week waiting period), or later? Would they be allowed to remove membership before the waiting period is up?

I'd only do it after the one-week waiting period, it shouldn't be removed before that.

And will we need to wait (in the worst case) a second week for the teams to sync, or is manually running the sync workflow considered to be a reasonable option?

Yeah manually running sounds totally fine, all committers can do that and it won't break anything

Ideally, I think the answers to these would be addressed in the error messages? I only knew to "blame" this because I had happened to see this PR (although I'm sure grepping for the error message would have gotten me here too), and I only noticed the significance of the "maintainers" field on the second read of this PR.

Sounds like a good idea, PR appreciated! Note that the error can occur both when removing a maintainer or when a GitHub user is added to a team without having a maintainer entry, so the error message would need to present both options.

@wolfgangwalther
Copy link
Contributor

Another option is also to remove the maintainer by hand from the synced file, so that CI in the "drop the maintainer" PR is happy. Once this is merged, the weekly sync will try to bring back the maintainer, at which point the org owner can clean this up.

(this is a bit annoying, because effectively only org owners can merge the weekly sync that way...)

We might have just hit a serious limitation of treating GitHub as the source of truth...

@wolfgangwalther wolfgangwalther mentioned this pull request Oct 29, 2025
2 tasks
@wolfgangwalther
Copy link
Contributor

I didn't really see this before, but I do now: With this sync from GitHub to Nixpkgs, we are changing the way how maintainers and teams are managed massively: Where ~200 committers were able to make a call on an addition to a team or the removal of a maintainers before, this is (in some cases) now reduced to a few people only: Those marked as maintainers of the GitHub team, or org owners as fallback. A lot of teams don't even have these maintainers.

This creates a practical bottleneck on one side - and on the other suddenly makes every team invite-only (aka requiring approval of an existing team member), where before we only had this for a handful of selected teams (mostly company teams), mentioned explicitly.

I don't have a solution at hand immediately, but I do see this as a significant problem.

@wolfgangwalther
Copy link
Contributor

Another issue that @emilazy pointed out: There is no clear process for addition of new members to teams anymore. Before, this required a pull request to the team-list, which allowed for discussion and a paper trail. Now? I'm not even sure. Do I just need to reach out to an existing maintainer of a team in some way, and they will just make a decision / add me ad-hoc on the GitHub side?

This seems wrong.

We will need to think about our workflows / processes for these cases - and then see whether we can still stick with the idea of syncing GitHub->Nixpkgs, I think.

@MattSturgeon
Copy link
Contributor

I wonder about flipping the logic to be more in line with the rfc39 approach? GitHub becomes the source-of-truth, and periodic team syncs (invites/removals) are done by the rfc39 bot.

I'm sure we discussed this before, but OTTOMH I can't remember why we decided against this approach.

@wolfgangwalther
Copy link
Contributor

I wonder about flipping the logic to be more in line with the rfc39 approach? GitHub becomes the source-of-truth, and periodic team syncs (invites/removals) are done by the rfc39 bot.

I'm sure we discussed this before, but OTTOMH I can't remember why we decided against this approach.

This was one of the options considered in #447514 (comment) (and following), but I argued against it in #447514 (comment). My main arguments were security and consistency with a potential move away from rfc39 for different reasons.

Now, I guess we can address the problems mentioned in that comment that currently exist with the rfc39 implementation in a different way, too. The security aspect still makes me very uneasy about a nixpkgs -> github migration, though. It's rather simple to add members to precisely one team (nixpkgs-maintainers) as rfc39 currently does. But to migrate team membership, we need to be very careful on which teams we can migrate memberships to, so that we don't accidentally allow privilege escalating, for example by merging members into the nix team or security team or core team (especially the latter has a lot of privileges!), ...

AFAIK we can't provide "scoped" privileges for the org-wide team maintenance token, that would be used for that. Although I'm not sure whether GitHub Enterprise could solve that?

@infinisil
Copy link
Member Author

infinisil commented Nov 1, 2025

Where ~200 committers were able to make a call on an addition to a team or the removal of a maintainers before, this is (in some cases) now reduced to a few people only: Those marked as maintainers of the GitHub team, or org owners as fallback.

This is only a problem if we ignore how lib.teams should stay in sync with the linked GitHub team. Because before this change, you'd need both a Nixpkgs committer and a GitHub team maintainer to make a synchronised team change, whereas now you only need a GitHub team maintainer.

A lot of teams don't even have these maintainers.

As listed in #456365, there's just 5 real teams that don't have a maintainer. But this was also a problem before if we care about teams being in sync. Once this is addressed for those teams, we can introduce an assert that ensures all teams have at least one maintainer, so this would be detected in the weekly sync going forward.

A related problem (though also not introduced by this PR) is that just having a GitHub team maintainer doesn't mean they're actually maintaining the team in practice. For that I suggest creating an issue that explains how to reach out to team maintainers and to encourage commenting there if they're unresponsive, in which case a Nixpkgs core member / org owner can assign a new maintainer.

The only issue I see this PR affecting is the desire for currently lib.teams-only teams to have a synced GitHub team, which would change them from Nixpkgs committer-maintained to self-maintained. While you could see it as a bottleneck, I see it as a way of empowering non-committers to take ownership of and maintain teams independently, putting less unnecessary1 burden on Nixpkgs committers.

Footnotes

  1. These teams are unprivileged, Nixpkgs committers don't need to review changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: lib The Nixpkgs function library 6.topic: policy discussion Discuss policies to work in and around Nixpkgs 6.topic: teams Relating to team creation, updates, other management actions 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.