gate each deploy on a swarm build of the agent from internal/meta
This commit is contained in:
parent
3db835fb57
commit
5e64048e53
1 changed files with 1570 additions and 178 deletions
|
|
@ -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(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue