fix(workflows): execute immutable signed revisions

Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-08-24 23:21:40 -04:00
parent e8ec3c8b4d
commit 5dc8e4750d
8 changed files with 268 additions and 152 deletions

View File

@@ -166,16 +166,13 @@ async fn current_workflow_revision(
client: &BuzzClient,
workflow_id: &str,
) -> Result<String, CliError> {
let filter = serde_json::json!({
"kinds": [30620],
"#d": [workflow_id],
"limit": 1
});
let response = client.query(&filter).await?;
let events: Vec<serde_json::Value> = serde_json::from_str(&response).unwrap_or_default();
events
.first()
.and_then(|event| event.get("id"))
let response = client
.get_authed(&format!("/workflows/{workflow_id}/revision"))
.await?;
let event: serde_json::Value = serde_json::from_str(&response)
.map_err(|e| CliError::Other(format!("invalid workflow revision response: {e}")))?;
event
.get("id")
.and_then(|id| id.as_str())
.map(str::to_owned)
.ok_or_else(|| CliError::NotFound(format!("workflow {workflow_id} not found")))