diff --git a/lib/tests/teams.nix b/lib/tests/teams.nix index 726e7f63a8e9..ed7db2b873f1 100644 --- a/lib/tests/teams.nix +++ b/lib/tests/teams.nix @@ -31,6 +31,10 @@ let type = types.str; default = ""; }; + githubId = lib.mkOption { + type = types.int; + default = 0; + }; githubMaintainers = lib.mkOption { type = types.listOf (types.submodule ./maintainer-module.nix); default = [ ]; diff --git a/maintainers/computed-team-list.nix b/maintainers/computed-team-list.nix index bcb8a0f9c237..7ee37f4283e3 100644 --- a/maintainers/computed-team-list.nix +++ b/maintainers/computed-team-list.nix @@ -20,6 +20,8 @@ let ); in +# TODO: Consider automatically exposing all GitHub teams under `lib.teams`, +# so that no manual PRs are necessary to add such teams anymore lib.mapAttrs ( name: attrs: if attrs ? github then @@ -28,6 +30,12 @@ lib.mapAttrs ( githubTeams.${attrs.github} or (throw "lib.teams.${name}: Corresponding GitHub team ${attrs.github} not known yet, make sure to create it and wait for the regular team sync"); in + # TODO: Consider specifying `githubId` in team-list.nix and inferring `github` from it (or even dropping it) + # This would make renames easier because no additional place needs to keep track of them. + # Though in a future where all Nixpkgs GitHub teams are automatically exposed under `lib.teams`, + # this would also not be an issue anymore. + assert lib.assertMsg (!attrs ? githubId) + "lib.teams.${name}: Both `githubId` and `github` is set, but the former is synced from the latter"; assert lib.assertMsg (!attrs ? shortName) "lib.teams.${name}: Both `shortName` and `github` is set, but the former is synced from the latter"; assert lib.assertMsg ( @@ -38,6 +46,7 @@ lib.mapAttrs ( ) "lib.teams.${name}: Both `members` and `github` is set, but the former is synced from the latter"; attrs // { + githubId = githubTeam.id; shortName = githubTeam.name; scope = githubTeam.description; members = diff --git a/maintainers/team-list.nix b/maintainers/team-list.nix index b9c155748e38..9774b61d7e25 100644 --- a/maintainers/team-list.nix +++ b/maintainers/team-list.nix @@ -17,6 +17,7 @@ - There is limited mention capacity in a single post, so this should be reserved for critical components or larger ecosystems within nixpkgs. - `github` will ping the specified GitHub team and sync the `members`, `scope` and `shortName` fields from it + - `githubId` will be set automatically based on `github` If `github` is specified and you'd like to be added to the team, contact one of the `githubMaintainers` of the team: