From 419cd328d3d54f4a687aa05d37e774853dab5c8f Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 19 Jan 2025 01:35:27 +0100 Subject: [PATCH] ci/eval: support "10.rebuild-${kernel}: 1" labels This should restore the old behavior of ofborg --- ci/eval/compare/utils.nix | 59 ++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/ci/eval/compare/utils.nix b/ci/eval/compare/utils.nix index 04ac4f6e61629..401404a0bb9f8 100644 --- a/ci/eval/compare/utils.nix +++ b/ci/eval/compare/utils.nix @@ -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 ( - kernel: rebuildCount: - let - number = - if rebuildCount == 0 then - "0" - else if rebuildCount <= 10 then - "1-10" - else if rebuildCount <= 100 then - "11-100" - else if rebuildCount <= 500 then - "101-500" - else if rebuildCount <= 1000 then - "501-1000" - else if rebuildCount <= 2500 then - "1001-2500" - else if rebuildCount <= 5000 then - "2501-5000" - else - "5001+"; - - in - "10.rebuild-${kernel}: ${number}" - ); + getLabels = + rebuildCountByKernel: + lib.flatten ( + lib.mapAttrsToList ( + kernel: rebuildCount: + let + numbers = + if rebuildCount == 0 then + [ "0" ] + else if rebuildCount == 1 then + [ + "1" + "1-10" + ] + else if rebuildCount <= 10 then + [ "1-10" ] + else if rebuildCount <= 100 then + [ "11-100" ] + else if rebuildCount <= 500 then + [ "101-500" ] + else if rebuildCount <= 1000 then + [ "501-1000" ] + else if rebuildCount <= 2500 then + [ "1001-2500" ] + else if rebuildCount <= 5000 then + [ "2501-5000" ] + else + [ "5001+" ]; + in + lib.forEach numbers (number: "10.rebuild-${kernel}: ${number}") + ) rebuildCountByKernel + ); }