Watch
0
0
Fork
You've already forked hyperhive
0

record whether an agent's config sets privateUsers in its closure record

This commit is contained in:
atlas 2026-11-01 16:05:36 +01:00 • committed by mara
commit 3ca660e558

View file

@ -149,6 +149,11 @@ pub enum FromMetaReply {
system: String,
#[serde(default)]
cached: bool,
/// Whether the agent's evaluated config sets
/// `services.hyperhive.agent.user.privateUsers`. A builder that
/// predates the field answers without it, which reads as false.
#[serde(default)]
private_users: bool,
},
/// The build did not succeed: the last lines `nix` printed, or why it
/// stopped (it timed out, or could not start). The controller holds the
@ -262,12 +267,14 @@ mod tests {
out_path: "/nix/store/x".to_owned(),
system: "x86_64-linux".to_owned(),
cached: true,
private_users: true,
},
json!({
"state": "built",
"out_path": "/nix/store/x",
"system": "x86_64-linux",
"cached": true,
"private_users": true,
}),
),
(
@ -292,7 +299,7 @@ mod tests {
}
#[test]
fn a_built_reply_from_a_builder_without_the_field_reads_as_not_cached() {
fn a_built_reply_from_a_builder_without_the_fields_reads_as_not_cached_and_not_namespaced() {
let old = json!({"state": "built", "out_path": "/nix/store/x", "system": "s"});
assert_eq!(
serde_json::from_value::<FromMetaReply>(old).expect("decodes"),
@ -300,6 +307,7 @@ mod tests {
out_path: "/nix/store/x".to_owned(),
system: "s".to_owned(),
cached: false,
private_users: false,
}
);
}