diff options
Diffstat (limited to 'makima/src/daemon/chain/runner.rs')
| -rw-r--r-- | makima/src/daemon/chain/runner.rs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/makima/src/daemon/chain/runner.rs b/makima/src/daemon/chain/runner.rs index 9c6f6b4..dfbcfa7 100644 --- a/makima/src/daemon/chain/runner.rs +++ b/makima/src/daemon/chain/runner.rs @@ -14,8 +14,8 @@ use thiserror::Error; use super::dag::{topological_sort, validate_dag, DagError}; use super::parser::{parse_chain_file, ChainDefinition, ParseError}; use crate::db::models::{ - CreateChainContractRequest, CreateChainDeliverableRequest, CreateChainRequest, - CreateChainTaskRequest, + AddChainRepositoryRequest, CreateChainContractRequest, CreateChainDeliverableRequest, + CreateChainRequest, CreateChainTaskRequest, }; /// Error type for chain runner operations. @@ -100,11 +100,27 @@ impl ChainRunner { None => (None, None, None), }; + // Convert repository definitions to API format + let repositories: Vec<AddChainRepositoryRequest> = chain + .repositories + .iter() + .map(|r| AddChainRepositoryRequest { + name: r.name.clone(), + repository_url: r.repository_url.clone(), + local_path: r.local_path.clone(), + source_type: r.source_type.clone(), + is_primary: r.is_primary, + }) + .collect(); + CreateChainRequest { name: chain.name.clone(), description: chain.description.clone(), - repository_url: chain.repository_url.clone(), - local_path: chain.local_path.clone(), + repositories: if repositories.is_empty() { + None + } else { + Some(repositories) + }, loop_enabled, loop_max_iterations, loop_progress_check, |
