Watch
0
0
Fork
You've already forked hyperhive
0

gate each deploy on a swarm build of the agent from internal/meta

This commit is contained in:
atlas 2026-10-26 16:40:06 +01:00
commit 5e64048e53

View file

@ -215,7 +215,7 @@ pub(crate) struct Report {
}
/// Bring `internal/meta` up to the forge's current heads for `agents`, and
/// give each of `hives`' forge accounts read on it.
/// give each of `hives`' forge accounts, and the swarm builder's, read on it.
///
/// # Errors
/// A head that cannot be read, a lock the builder refuses, or a refused commit.
@ -229,10 +229,13 @@ pub(crate) async fn update(
hives: &[String],
) -> Result<Report> {
forge.ensure_meta_repo().await?;
for hive in hives {
let login = swarm_secret_client::forge::hive_login(hive);
let logins = hives
.iter()
.map(|hive| swarm_secret_client::forge::hive_login(hive))
.chain([crate::forge::builder_account::LOGIN.to_owned()]);
for login in logins {
if let Err(e) = forge.grant_meta_read(&login).await {
tracing::warn!(%hive, error = %format!("{e:#}"), "meta flake: read grant on internal/meta failed");
tracing::warn!(%login, error = %format!("{e:#}"), "meta flake: read grant on internal/meta failed");
}
}
let committed = forge
@ -753,7 +756,10 @@ mod tests {
);
assert_eq!(
*forge.grants.lock().unwrap(),
vec![swarm_secret_client::forge::hive_login("pr1ma")]
vec![
swarm_secret_client::forge::hive_login("pr1ma"),
crate::forge::builder_account::LOGIN.to_owned(),
]
);
}