Skip to content

Commit

Permalink
ci/eval: support "10.rebuild-${kernel}: 1" labels
Browse files Browse the repository at this point in the history
This should restore the old behavior of ofborg
  • Loading branch information
pbsds committed Jan 19, 2025
1 parent b1b1d92 commit 419cd32
Showing 1 changed file with 34 additions and 25 deletions.
59 changes: 34 additions & 25 deletions ci/eval/compare/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

0 comments on commit 419cd32

Please sign in to comment.