From f33892fcc9846ca2f6b6a922cdd245a631c2729c Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 16 Oct 2025 13:34:02 +0200 Subject: [PATCH] ci/eval/compare/maintainers: ping by-name reviewers for pure refactors This allows requesting reviewers for pure refactor PRs, which don't cause a rebuild of the package. This is only possible for by-name, because only here the package names can be inferred from the filenames. --- ci/eval/compare/maintainers.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/eval/compare/maintainers.nix b/ci/eval/compare/maintainers.nix index 1ddad23da909..fef5ecb8d9b9 100644 --- a/ci/eval/compare/maintainers.nix +++ b/ci/eval/compare/maintainers.nix @@ -11,13 +11,24 @@ let changedpaths = lib.importJSON changedpathsjson; + # Extract attributes that changed from by-name paths. + # This allows pinging reviewers for pure refactors. + touchedattrs = lib.pipe changedpaths [ + (lib.filter (changed: lib.hasPrefix "pkgs/by-name/" changed)) + (map (lib.splitString "/")) + (map (path: lib.elemAt path 3)) + lib.unique + ]; + anyMatchingFile = filename: lib.any (lib.hasPrefix filename) changedpaths; anyMatchingFiles = files: lib.any anyMatchingFile files; sharded = name: "${lib.substring 0 2 name}/${name}"; - attrsWithMaintainers = lib.pipe (changedattrs ++ removedattrs) [ + attrsWithMaintainers = lib.pipe (changedattrs ++ removedattrs ++ touchedattrs) [ + # An attribute can appear in changed/removed *and* touched + lib.unique (map ( name: let