Watch
0
0
Fork
You've already forked hyperhive
0

add a per-agent nix builds mode, host or none, carried like privateUsers

This commit is contained in:
atlas 2026-11-03 00:30:55 +01:00 • committed by mara
commit 5485151ba6

View file

@ -620,6 +620,7 @@ async fn handle_meta(
system,
cached,
private_users,
nix_builds,
} => tracing::info!(
agent = %job.agent,
meta_rev = %job.meta_rev,
@ -627,6 +628,7 @@ async fn handle_meta(
%system,
cached,
private_users,
?nix_builds,
"agent meta build built"
),
FromMetaReply::Failed { error_tail } => tracing::warn!(
@ -859,6 +861,7 @@ mod tests {
system: "s".to_owned(),
cached: false,
private_users: false,
nix_builds: hive_types::NixBuilds::Host,
}
},
)
@ -881,6 +884,7 @@ mod tests {
system: "s".to_owned(),
cached: false,
private_users: false,
nix_builds: hive_types::NixBuilds::Host,
}
},
)
@ -1462,11 +1466,12 @@ mod tests {
"system": "x86_64-linux",
"cached": false,
"private_users": true,
"nix_builds": "host",
})
);
assert_eq!(fake.lines("tokens"), ["forge-token"; 2]);
assert_eq!(fake.lines("tokens"), ["forge-token"; 3]);
let calls = fake.calls();
assert_eq!(calls.len(), 2, "{calls:?}");
assert_eq!(calls.len(), 3, "{calls:?}");
assert!(
calls[0].contains(&format!(
"git+https://forge.example/internal/meta.git?rev={REV}#nixosConfigurations.atlas.config.system.build.toplevel"
@ -1477,6 +1482,10 @@ mod tests {
calls[1].contains("services.hyperhive.agent.user.privateUsers"),
"{calls:?}"
);
assert!(
calls[2].contains("services.hyperhive.agent.nixBuilds"),
"{calls:?}"
);
}
#[tokio::test]
@ -1582,7 +1591,7 @@ mod tests {
];
serve_meta(fake.builder(), env, msgs).await;
assert_eq!(next(&mut sent).await.0, "_INBOX.2");
assert_eq!(fake.calls().len(), 2, "one build and its option read");
assert_eq!(fake.calls().len(), 3, "one build and its two option reads");
}
#[tokio::test(start_paused = true)]