update_meta_inputs: require operator approval, rename to request_update_meta_inputs
This commit is contained in:
parent
597e4ba03a
commit
3e098c56ff
7 changed files with 94 additions and 28 deletions
|
|
@ -69,6 +69,14 @@ pub async fn approve(coord: Arc<Coordinator>, id: i64) -> Result<()> {
|
|||
.await;
|
||||
finish_approval(&coord, &approval, result, None)
|
||||
}
|
||||
ApprovalKind::UpdateMetaInputs => {
|
||||
// Decode the inputs from the commit_ref field (stored as JSON
|
||||
// by submit_apply_commit's counterpart in manager_server.rs).
|
||||
let inputs: Vec<String> =
|
||||
serde_json::from_str(&approval.commit_ref).unwrap_or_default();
|
||||
let result = crate::meta::lock_update(&inputs).await;
|
||||
finish_approval(&coord, &approval, result, None)
|
||||
}
|
||||
ApprovalKind::Spawn => {
|
||||
// Run the spawn in the background so the approve POST returns
|
||||
// immediately. The dashboard reads `transient` to render a spinner.
|
||||
|
|
@ -158,6 +166,7 @@ fn finish_approval(
|
|||
ApprovalKind::Spawn => "spawn",
|
||||
ApprovalKind::ApplyCommit => "apply_commit",
|
||||
ApprovalKind::InitConfig => "init_config",
|
||||
ApprovalKind::UpdateMetaInputs => "update_meta_inputs",
|
||||
};
|
||||
let sha_short = approval
|
||||
.fetched_sha
|
||||
|
|
@ -199,6 +208,9 @@ fn finish_approval(
|
|||
sha: approval.fetched_sha.clone(),
|
||||
tag: terminal_tag,
|
||||
}),
|
||||
// UpdateMetaInputs: ApprovalResolved already carries the result.
|
||||
// No separate lifecycle event needed.
|
||||
ApprovalKind::UpdateMetaInputs => {}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
|
@ -462,6 +474,7 @@ pub async fn deny(coord: &Coordinator, id: i64, note: Option<&str>) -> Result<()
|
|||
ApprovalKind::Spawn => "spawn",
|
||||
ApprovalKind::ApplyCommit => "apply_commit",
|
||||
ApprovalKind::InitConfig => "init_config",
|
||||
ApprovalKind::UpdateMetaInputs => "update_meta_inputs",
|
||||
};
|
||||
let sha_short = sha.as_deref().map(|s| s[..s.len().min(12)].to_owned());
|
||||
let description = a.description.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue