From 4198e557f3e402376672ecf50a5d43c2c0011d3e Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 1 Sep 2025 15:47:55 +0200 Subject: [PATCH] ci/eval/compare: handle missing packages Not all packages that are reported as changed will actually exist on the platform that the maintainers are colleted on. This is the case for some attributes that are only available on Darwin or explicitly set to `null` on Linux. By filtering out packages without maintainers, these are ignored - and we should potentially get a small performance improvement as well. (cherry picked from commit f2ca5796dea9a929995db23999e93ad0d690f030) --- ci/eval/compare/maintainers.nix | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/ci/eval/compare/maintainers.nix b/ci/eval/compare/maintainers.nix index bc1cfb5a3cfb..488eb0ea9201 100644 --- a/ci/eval/compare/maintainers.nix +++ b/ci/eval/compare/maintainers.nix @@ -22,18 +22,27 @@ let anyMatchingFiles = files: builtins.any anyMatchingFile files; - attrsWithMaintainers = builtins.map ( - name: - let - package = lib.getAttrFromPath (lib.splitString "." name) pkgs; - in - { - inherit name package; - # 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". - maintainers = package.meta.maintainers or [ ]; - } - ) (changedattrs ++ removedattrs); + attrsWithMaintainers = lib.pipe (changedattrs ++ removedattrs) [ + (builtins.map ( + name: + let + # Some packages might be reported as changed on a different platform, but + # not even have an attribute on the platform the maintainers are requested on. + # Fallback to `null` for these to filter them out below. + package = lib.attrByPath (lib.splitString "." name) null pkgs; + in + { + inherit name package; + # 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". + maintainers = package.meta.maintainers or [ ]; + } + )) + # No need to match up packages without maintainers with their files. + # This also filters out attributes where `packge = null`, which is the + # case for libintl, for example. + (builtins.filter (pkg: pkg.maintainers != [ ])) + ]; relevantFilenames = drv: