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

This should restore the old behavior of ofborg
This commit is contained in:
Peder Bergebakken Sundt
2025-01-19 01:35:27 +01:00
parent b1b1d927bb
commit a226f13211

View File

@@ -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.concatLists (
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
);
}