Commit a226f132 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt
Browse files

ci/eval: support "10.rebuild-${kernel}: 1" labels

This should restore the old behavior of ofborg
parent b1b1d927
Loading
Loading
Loading
Loading
+34 −25
Original line number Diff line number Diff line
@@ -182,36 +182,45 @@ rec {
    Turns
      {
        linux = 56;
        darwin = 8;
        darwin = 1;
      }
    into
      [
        "10.rebuild-darwin: 1"
        "10.rebuild-darwin: 1-10"
        "10.rebuild-linux: 11-100"
      ]
  */
  getLabels = lib.mapAttrsToList (
  getLabels =
    rebuildCountByKernel:
    lib.concatLists (
      lib.mapAttrsToList (
        kernel: rebuildCount:
        let
      number =
          numbers =
            if rebuildCount == 0 then
          "0"
        else if rebuildCount <= 10 then
              [ "0" ]
            else if rebuildCount == 1 then
              [
                "1"
                "1-10"
              ]
            else if rebuildCount <= 10 then
              [ "1-10" ]
            else if rebuildCount <= 100 then
          "11-100"
              [ "11-100" ]
            else if rebuildCount <= 500 then
          "101-500"
              [ "101-500" ]
            else if rebuildCount <= 1000 then
          "501-1000"
              [ "501-1000" ]
            else if rebuildCount <= 2500 then
          "1001-2500"
              [ "1001-2500" ]
            else if rebuildCount <= 5000 then
          "2501-5000"
              [ "2501-5000" ]
            else
          "5001+";

              [ "5001+" ];
        in
    "10.rebuild-${kernel}: ${number}"
        lib.forEach numbers (number: "10.rebuild-${kernel}: ${number}")
      ) rebuildCountByKernel
    );
}