Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ci/eval/compare/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ let
# - values: lists of `packagePlatformPath`s
diffAttrs = builtins.fromJSON (builtins.readFile "${combinedDir}/combined-diff.json");

changedPackagePlatformAttrs = convertToPackagePlatformAttrs diffAttrs.changed;
rebuildsPackagePlatformAttrs = convertToPackagePlatformAttrs diffAttrs.rebuilds;
removedPackagePlatformAttrs = convertToPackagePlatformAttrs diffAttrs.removed;

changed-paths =
let
Expand Down Expand Up @@ -115,8 +117,9 @@ let
);

maintainers = callPackage ./maintainers.nix { } {
changedattrs = lib.attrNames (lib.groupBy (a: a.name) rebuildsPackagePlatformAttrs);
changedattrs = lib.attrNames (lib.groupBy (a: a.name) changedPackagePlatformAttrs);
changedpathsjson = touchedFilesJson;
removedattrs = lib.attrNames (lib.groupBy (a: a.name) removedPackagePlatformAttrs);
inherit byName;
};
in
Expand Down
38 changes: 7 additions & 31 deletions ci/eval/compare/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{
changedattrs,
changedpathsjson,
removedattrs,
byName ? false,
}:
let
Expand All @@ -21,43 +22,18 @@ let

anyMatchingFiles = files: builtins.any anyMatchingFile files;

enrichedAttrs = builtins.map (name: {
path = lib.splitString "." name;
name = name;
}) changedattrs;

validPackageAttributes = builtins.filter (
pkg:
if (lib.attrsets.hasAttrByPath pkg.path pkgs) then
(
let
value = lib.attrsets.attrByPath pkg.path null pkgs;
in
if (builtins.tryEval value).success then
if value != null then true else builtins.trace "${pkg.name} exists but is null" false
else
builtins.trace "Failed to access ${pkg.name} even though it exists" false
)
else
builtins.trace "Failed to locate ${pkg.name}." false
) enrichedAttrs;
Comment on lines -29 to -43
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part did not only filter out packages that failed to evaluate, but also null values. Need to add that part back.


attrsWithPackages = builtins.map (
pkg: pkg // { package = lib.attrsets.attrByPath pkg.path null pkgs; }
) validPackageAttributes;

attrsWithMaintainers = builtins.map (
pkg:
name:
let
meta = pkg.package.meta or { };
package = lib.getAttrFromPath (lib.splitString "." name) pkgs;
in
pkg
// {
{
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 = meta.maintainers or [ ];
maintainers = package.meta.maintainers or [ ];
}
) attrsWithPackages;
) (changedattrs ++ removedattrs);

relevantFilenames =
drv:
Expand Down
Loading