mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
check-meta: wrap maintainers attribute to include team members (#402991)
This commit is contained in:
commit
a7eef26e86
2 changed files with 20 additions and 4 deletions
|
@ -53,9 +53,7 @@ let
|
||||||
// {
|
// {
|
||||||
# TODO: Refactor this so we can ping entire teams instead of the individual members.
|
# TODO: Refactor this so we can ping entire teams instead of the individual members.
|
||||||
# Note that this will require keeping track of GH team IDs in "maintainers/teams.nix".
|
# Note that this will require keeping track of GH team IDs in "maintainers/teams.nix".
|
||||||
maintainers =
|
maintainers = meta.maintainers or [ ];
|
||||||
meta.maintainers or [ ]
|
|
||||||
++ lib.flatten (map (team: team.members or [ ]) (meta.teams or [ ]));
|
|
||||||
}
|
}
|
||||||
) attrsWithPackages;
|
) attrsWithPackages;
|
||||||
|
|
||||||
|
@ -64,7 +62,8 @@ let
|
||||||
(lib.lists.unique (
|
(lib.lists.unique (
|
||||||
builtins.map (pos: lib.strings.removePrefix (toString ../..) pos.file) (
|
builtins.map (pos: lib.strings.removePrefix (toString ../..) pos.file) (
|
||||||
builtins.filter (x: x != null) [
|
builtins.filter (x: x != null) [
|
||||||
(builtins.unsafeGetAttrPos "maintainers" (drv.meta or { }))
|
((drv.meta or { }).maintainersPosition or null)
|
||||||
|
((drv.meta or { }).teamsPosition or null)
|
||||||
(builtins.unsafeGetAttrPos "src" drv)
|
(builtins.unsafeGetAttrPos "src" drv)
|
||||||
# broken because name is always set by stdenv:
|
# broken because name is always set by stdenv:
|
||||||
# # A hack to make `nix-env -qa` and `nix search` ignore broken packages.
|
# # A hack to make `nix-env -qa` and `nix search` ignore broken packages.
|
||||||
|
|
|
@ -411,6 +411,10 @@ let
|
||||||
isFcitxEngine = bool;
|
isFcitxEngine = bool;
|
||||||
isIbusEngine = bool;
|
isIbusEngine = bool;
|
||||||
isGutenprint = bool;
|
isGutenprint = bool;
|
||||||
|
|
||||||
|
# Used for the original location of the maintainer and team attributes to assist with pings.
|
||||||
|
maintainersPosition = any;
|
||||||
|
teamsPosition = any;
|
||||||
};
|
};
|
||||||
|
|
||||||
checkMetaAttr =
|
checkMetaAttr =
|
||||||
|
@ -589,11 +593,24 @@ let
|
||||||
)
|
)
|
||||||
] ++ optional (hasOutput "man") "man";
|
] ++ optional (hasOutput "man") "man";
|
||||||
}
|
}
|
||||||
|
// {
|
||||||
|
# CI scripts look at these to determine pings.
|
||||||
|
maintainersPosition = builtins.unsafeGetAttrPos "maintainers" (attrs.meta or { });
|
||||||
|
teamsPosition = builtins.unsafeGetAttrPos "teams" (attrs.meta or { });
|
||||||
|
}
|
||||||
// attrs.meta or { }
|
// attrs.meta or { }
|
||||||
# Fill `meta.position` to identify the source location of the package.
|
# Fill `meta.position` to identify the source location of the package.
|
||||||
// optionalAttrs (pos != null) {
|
// optionalAttrs (pos != null) {
|
||||||
position = pos.file + ":" + toString pos.line;
|
position = pos.file + ":" + toString pos.line;
|
||||||
}
|
}
|
||||||
|
// {
|
||||||
|
# Maintainers should be inclusive of teams.
|
||||||
|
# Note that there may be external consumers of this API (repology, for instance) -
|
||||||
|
# if you add a new maintainer or team attribute please ensure that this expectation is still met.
|
||||||
|
maintainers =
|
||||||
|
attrs.meta.maintainers or [ ]
|
||||||
|
++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ];
|
||||||
|
}
|
||||||
// {
|
// {
|
||||||
# Expose the result of the checks for everyone to see.
|
# Expose the result of the checks for everyone to see.
|
||||||
unfree = hasUnfreeLicense attrs;
|
unfree = hasUnfreeLicense attrs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue