Keep startup demo cleanup non-fatal
Deploy / deploy (push) Successful in 1m38s
CI / Rust Checks (push) Successful in 6m36s
CI / UI Checks (push) Successful in 5s
CI / Deployment Manifests (push) Successful in 2s
CI / Frontend E2E (push) Failing after 13m30s

This commit is contained in:
github-ops
2026-06-24 06:24:29 +00:00
parent 6d36b5e262
commit 5fb3d37329
2 changed files with 94 additions and 18 deletions
+27 -11
View File
@@ -7,7 +7,7 @@ use crank_core::{
};
use crank_mapping::{JsonPathRoot, infer_mapping_from_samples};
use crank_mapping::{MappingRule, MappingSet};
use crank_registry::{ListInvocationLogsQuery, OperationSummary, SampleKind};
use crank_registry::{ListInvocationLogsQuery, OperationSummary, RegistryError, SampleKind};
use crank_schema::Schema;
use serde_json::{Value, json};
@@ -99,11 +99,8 @@ impl AdminService {
.name
.starts_with("weather_current_open_meteo_smoke_")
{
self.delete_operation(
workspace_id,
&OperationId::new(operation.id.as_str().to_owned()),
)
.await?;
self.delete_legacy_demo_operation_if_safe(workspace_id, &operation.id)
.await?;
}
}
@@ -113,17 +110,36 @@ impl AdminService {
"weather_current_open_meteo",
] {
if let Some(operation) = self.find_operation_by_name(workspace_id, name).await? {
self.delete_operation(
workspace_id,
&OperationId::new(operation.id.as_str().to_owned()),
)
.await?;
self.delete_legacy_demo_operation_if_safe(workspace_id, &operation.id)
.await?;
}
}
Ok(())
}
async fn delete_legacy_demo_operation_if_safe(
&self,
workspace_id: &WorkspaceId,
operation_id: &OperationId,
) -> Result<(), ApiError> {
match self
.registry
.delete_operation(workspace_id, operation_id)
.await
{
Ok(()) => Ok(()),
Err(RegistryError::OperationHasPublishedAgentBindings { .. }) => {
tracing::warn!(
operation_id = %operation_id.as_str(),
"legacy demo operation is still bound to a published agent; leaving it in place"
);
Ok(())
}
Err(error) => Err(ApiError::from(error)),
}
}
async fn ensure_demo_platform_api_key(
&self,
workspace_id: &WorkspaceId,