summaryrefslogtreecommitdiff
path: root/makima/src/daemon/chain
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/chain')
-rw-r--r--makima/src/daemon/chain/parser.rs7
-rw-r--r--makima/src/daemon/chain/runner.rs12
2 files changed, 15 insertions, 4 deletions
diff --git a/makima/src/daemon/chain/parser.rs b/makima/src/daemon/chain/parser.rs
index 3851d1f..b32d0f2 100644
--- a/makima/src/daemon/chain/parser.rs
+++ b/makima/src/daemon/chain/parser.rs
@@ -395,7 +395,9 @@ contracts:
fn test_repo_alias() {
let yaml = r#"
name: Repo Chain
-repo: https://github.com/user/project
+repositories:
+ - name: main
+ repository_url: https://github.com/user/project
contracts:
- name: Phase1
tasks:
@@ -403,8 +405,9 @@ contracts:
plan: "Work on repo"
"#;
let chain = parse_chain_yaml(yaml).unwrap();
+ assert_eq!(chain.repositories.len(), 1);
assert_eq!(
- chain.repository_url,
+ chain.repositories[0].repository_url,
Some("https://github.com/user/project".to_string())
);
}
diff --git a/makima/src/daemon/chain/runner.rs b/makima/src/daemon/chain/runner.rs
index dfbcfa7..1814581 100644
--- a/makima/src/daemon/chain/runner.rs
+++ b/makima/src/daemon/chain/runner.rs
@@ -37,8 +37,10 @@ pub enum RunnerError {
/// Chain runner for creating and managing chains.
pub struct ChainRunner {
/// Base API URL
+ #[allow(dead_code)]
api_url: String,
/// API key for authentication
+ #[allow(dead_code)]
api_key: String,
}
@@ -116,6 +118,7 @@ impl ChainRunner {
CreateChainRequest {
name: chain.name.clone(),
description: chain.description.clone(),
+ repository_url: None, // Legacy field, repositories take precedence
repositories: if repositories.is_empty() {
None
} else {
@@ -242,7 +245,9 @@ mod tests {
let yaml = r#"
name: Test Chain
description: A test chain
-repo: https://github.com/test/repo
+repositories:
+ - name: main
+ repository_url: https://github.com/test/repo
contracts:
- name: Research
type: simple
@@ -270,8 +275,11 @@ loop:
assert_eq!(request.name, "Test Chain");
assert_eq!(request.description, Some("A test chain".to_string()));
+ // Repositories are now in a separate array
+ let repos = request.repositories.unwrap();
+ assert_eq!(repos.len(), 1);
assert_eq!(
- request.repository_url,
+ repos[0].repository_url,
Some("https://github.com/test/repo".to_string())
);
assert_eq!(request.loop_enabled, Some(true));