Unverified Commit f2ca5796 authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

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.
parent 011f7759
Loading
Loading
Loading
Loading
+21 −12
Original line number Diff line number Diff line
@@ -22,10 +22,14 @@ let

  anyMatchingFiles = files: builtins.any anyMatchingFile files;

  attrsWithMaintainers = builtins.map (
  attrsWithMaintainers = lib.pipe (changedattrs ++ removedattrs) [
    (builtins.map (
      name:
      let
      package = lib.getAttrFromPath (lib.splitString "." name) pkgs;
        # 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;
@@ -33,7 +37,12 @@ let
        # Note that this will require keeping track of GH team IDs in "maintainers/teams.nix".
        maintainers = package.meta.maintainers or [ ];
      }
  ) (changedattrs ++ removedattrs);
    ))
    # 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: