mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 01:24:09 +01:00
modules/generic/meta-maintainers.nix: Introduce meta.teams
And trigger review requests for it
This commit is contained in:
parent
b486dfb1ab
commit
5991eab94f
2 changed files with 29 additions and 6 deletions
|
|
@ -14,12 +14,15 @@ let
|
|||
};
|
||||
|
||||
nixpkgsRoot = toString ../../.. + "/";
|
||||
stripNixpkgsRootFromKeys = lib.mapAttrs' (
|
||||
file: value: lib.nameValuePair (lib.removePrefix nixpkgsRoot file) value
|
||||
);
|
||||
|
||||
fileMaintainers =
|
||||
# Currently just nixos module maintainers, but in the future we can use this for code owners too
|
||||
lib.mapAttrs' (
|
||||
file: maintainers: lib.nameValuePair (lib.removePrefix nixpkgsRoot file) maintainers
|
||||
) (pkgs.nixos { }).config.meta.maintainers;
|
||||
moduleMeta = (pkgs.nixos { }).config.meta;
|
||||
|
||||
# Currently just nixos module maintainers, but in the future we can use this for code owners too
|
||||
fileMaintainers = stripNixpkgsRootFromKeys moduleMeta.maintainers;
|
||||
fileTeams = stripNixpkgsRootFromKeys moduleMeta.teams;
|
||||
|
||||
changedpaths = lib.importJSON changedpathsjson;
|
||||
|
||||
|
|
@ -127,7 +130,11 @@ let
|
|||
pkg:
|
||||
userPings { attr = pkg.name; } pkg.users ++ lib.concatMap (teamPings { pkg = pkg.name; }) pkg.teams
|
||||
) attrsWithModifiedFiles
|
||||
++ lib.concatMap (path: userPings { file = path; } (fileMaintainers.${path} or [ ])) changedpaths;
|
||||
++ lib.concatMap (
|
||||
path:
|
||||
userPings { file = path; } (fileMaintainers.${path} or [ ])
|
||||
++ lib.concatMap (teamPings { file = path; }) (fileTeams.${path} or [ ])
|
||||
) changedpaths;
|
||||
|
||||
byType = lib.groupBy (ping: ping.type) maintainersToPing;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,22 @@ in
|
|||
The option value is not a list of maintainers, but an attribute set that maps module file names to lists of maintainers.
|
||||
'';
|
||||
};
|
||||
teams = mkOption {
|
||||
type =
|
||||
let
|
||||
allTeams = lib.attrValues lib.teams;
|
||||
in
|
||||
lib.types.addCheck sourceList (lib.all (v: lib.elem v allTeams))
|
||||
// {
|
||||
description = "list of lib.teams";
|
||||
};
|
||||
default = [ ];
|
||||
example = lib.literalExpression "[ lib.teams.acme lib.teams.haskell ]";
|
||||
description = ''
|
||||
List of team maintainers of each module.
|
||||
This option should be defined at most once per module.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue