diff options
Diffstat (limited to 'makima/src/server/handlers/mesh.rs')
| -rw-r--r-- | makima/src/server/handlers/mesh.rs | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/makima/src/server/handlers/mesh.rs b/makima/src/server/handlers/mesh.rs index 9ef6248..af77b56 100644 --- a/makima/src/server/handlers/mesh.rs +++ b/makima/src/server/handlers/mesh.rs @@ -601,14 +601,14 @@ pub async fn start_task( .into_response(); } - // Get local_only flag from contract if task has one - let local_only = if let Some(contract_id) = task.contract_id { + // Get local_only and auto_merge_local flags from contract if task has one + let (local_only, auto_merge_local) = if let Some(contract_id) = task.contract_id { match repository::get_contract_for_owner(pool, contract_id, auth.owner_id).await { - Ok(Some(contract)) => contract.local_only, - _ => false, + Ok(Some(contract)) => (contract.local_only, contract.auto_merge_local), + _ => (false, false), } } else { - false + (false, false) }; // Get list of daemons that have previously failed this task @@ -707,6 +707,7 @@ pub async fn start_task( patch_data: None, patch_base_sha: None, local_only, + auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor }; @@ -761,6 +762,7 @@ pub async fn start_task( patch_data: None, patch_base_sha: None, local_only, + auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor }; @@ -1144,14 +1146,14 @@ pub async fn send_message( }; if let Ok(Some(updated_task)) = repository::update_task_for_owner(pool, id, auth.owner_id, update_req).await { - // Get local_only from contract if task has one - let local_only = if let Some(contract_id) = updated_task.contract_id { + // Get local_only and auto_merge_local from contract if task has one + let (local_only, auto_merge_local) = if let Some(contract_id) = updated_task.contract_id { match repository::get_contract_for_owner(pool, contract_id, auth.owner_id).await { - Ok(Some(contract)) => contract.local_only, - _ => false, + Ok(Some(contract)) => (contract.local_only, contract.auto_merge_local), + _ => (false, false), } } else { - false + (false, false) }; // Send spawn command to new daemon @@ -1177,6 +1179,7 @@ pub async fn send_message( patch_data: None, patch_base_sha: None, local_only, + auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor }; @@ -2689,14 +2692,14 @@ pub async fn reassign_task( } }; - // Get local_only from contract if task has one - let local_only = if let Some(contract_id) = task.contract_id { + // Get local_only and auto_merge_local from contract if task has one + let (local_only, auto_merge_local) = if let Some(contract_id) = task.contract_id { match repository::get_contract_for_owner(pool, contract_id, auth.owner_id).await { - Ok(Some(contract)) => contract.local_only, - _ => false, + Ok(Some(contract)) => (contract.local_only, contract.auto_merge_local), + _ => (false, false), } } else { - false + (false, false) }; // Send SpawnTask command to daemon for the new task @@ -2722,6 +2725,7 @@ pub async fn reassign_task( patch_data, patch_base_sha, local_only, + auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor }; @@ -3028,14 +3032,14 @@ pub async fn continue_task( }; let is_orchestrator = task.depth == 0 && subtask_count > 0; - // Get local_only from contract if task has one - let local_only = if let Some(contract_id) = task.contract_id { + // Get local_only and auto_merge_local from contract if task has one + let (local_only, auto_merge_local) = if let Some(contract_id) = task.contract_id { match repository::get_contract_for_owner(pool, contract_id, auth.owner_id).await { - Ok(Some(contract)) => contract.local_only, - _ => false, + Ok(Some(contract)) => (contract.local_only, contract.auto_merge_local), + _ => (false, false), } } else { - false + (false, false) }; // Send SpawnTask command to daemon @@ -3061,6 +3065,7 @@ pub async fn continue_task( patch_data: None, patch_base_sha: None, local_only, + auto_merge_local, supervisor_worktree_task_id: None, // Not spawned by supervisor }; @@ -3989,6 +3994,7 @@ pub async fn branch_task( patch_data, patch_base_sha, local_only: false, // No contract, so not local_only + auto_merge_local: false, // No contract, so no auto_merge_local supervisor_worktree_task_id: None, // Not spawned by supervisor }; |
