From ce70a9e6b4a7a88d5cee8905858061ae95fb258c Mon Sep 17 00:00:00 2001 From: dramforever Date: Sat, 14 Mar 2026 14:04:54 +0800 Subject: [PATCH 1/2] ci/eval/compare/maintainers: Handle nonexistent attribute in changedByNameAttrPaths This could happen if a new package was added in pkgs/by-name --- ci/eval/compare/maintainers.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/eval/compare/maintainers.nix b/ci/eval/compare/maintainers.nix index 0594d13e8b7a..a471aa769ff2 100644 --- a/ci/eval/compare/maintainers.nix +++ b/ci/eval/compare/maintainers.nix @@ -96,6 +96,8 @@ let (lib.filter (path: lib.length path > 3)) (map (path: lib.elemAt path 3)) (map lib.singleton) + # Filter out new packages + (lib.filter (attrPath: lib.hasAttrByPath attrPath pkgs)) ]; # An attribute can appear in affected *and* touched From 16b3779220d285d08a9a1b8c43913f99fdafd041 Mon Sep 17 00:00:00 2001 From: dramforever Date: Sat, 14 Mar 2026 14:05:57 +0800 Subject: [PATCH 2/2] ci/eval/compare: Add test for nonexistent by-name attribute --- ci/eval/compare/test.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ci/eval/compare/test.nix b/ci/eval/compare/test.nix index 409f58296530..aaaff6ec9581 100644 --- a/ci/eval/compare/test.nix +++ b/ci/eval/compare/test.nix @@ -138,6 +138,21 @@ let ]; }; }; + testByNameNonExistentChanged = { + expr = fun { + pkgs = mockPkgs { + packages = [ ]; + }; + # Happens when a new package was added to pkgs/by-name + changedFiles = [ "pkgs/by-name/he/hello/sources.json" ]; + affectedAttrPaths = [ ]; + }; + expected = { + packages = [ ]; + teams = { }; + users = { }; + }; + }; testByNameReadmeChanged = { expr = fun { pkgs = mockPkgs {