From b486dfb1ab003e95746b68e1d904f82b1dd27e7e Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sat, 7 Feb 2026 16:28:10 +0100 Subject: [PATCH] modules/generic/meta-maintainers.nix: Remove Nixpkgs prefix from module path This is a functional change, but there's no known consumer of this interface, and if we want to trigger review request for PRs it's convenient for these paths to be absolute ci: Trigger review requests for module maintainers --- ci/eval/compare/maintainers.nix | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/ci/eval/compare/maintainers.nix b/ci/eval/compare/maintainers.nix index daecc1c154da..e202e47ae118 100644 --- a/ci/eval/compare/maintainers.nix +++ b/ci/eval/compare/maintainers.nix @@ -13,6 +13,14 @@ let config.allowAliases = false; }; + nixpkgsRoot = toString ../../.. + "/"; + + 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; + changedpaths = lib.importJSON changedpathsjson; # Extract attributes that changed from by-name paths. @@ -94,39 +102,42 @@ let attrsWithModifiedFiles = lib.filter (pkg: anyMatchingFiles pkg.filenames) attrsWithFilenames; userPings = - pkg: + context: map (maintainer: { type = "user"; userId = maintainer.githubId; - packageName = pkg.name; + inherit context; }); teamPings = - pkg: team: + context: team: if team ? github then [ { type = "team"; teamId = team.githubId; - packageName = pkg.name; + inherit context; } ] else - userPings pkg team.members; + userPings context team.members; - maintainersToPing = lib.concatMap ( - pkg: userPings pkg pkg.users ++ lib.concatMap (teamPings pkg) pkg.teams - ) attrsWithModifiedFiles; + maintainersToPing = + lib.concatMap ( + 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; byType = lib.groupBy (ping: ping.type) maintainersToPing; byUser = lib.pipe (byType.user or [ ]) [ (lib.groupBy (ping: toString ping.userId)) - (lib.mapAttrs (_user: lib.map (pkg: pkg.packageName))) + (lib.mapAttrs (_user: lib.map (pkg: pkg.context))) ]; byTeam = lib.pipe (byType.team or [ ]) [ (lib.groupBy (ping: toString ping.teamId)) - (lib.mapAttrs (_team: lib.map (pkg: pkg.packageName))) + (lib.mapAttrs (_team: lib.map (pkg: pkg.context))) ]; in {