summaryrefslogtreecommitdiff
path: root/makima/src/db/repository.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/db/repository.rs')
-rw-r--r--makima/src/db/repository.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs
index 1af22f6..f14bc66 100644
--- a/makima/src/db/repository.rs
+++ b/makima/src/db/repository.rs
@@ -4941,7 +4941,7 @@ pub async fn create_directive_for_owner(
.bind(&req.repository_url)
.bind(&req.local_path)
.bind(&req.base_branch)
- .bind(req.reconcile_mode.unwrap_or(false))
+ .bind(req.reconcile_mode.as_deref().unwrap_or("auto"))
.fetch_one(pool)
.await
}
@@ -5059,7 +5059,7 @@ pub async fn update_directive_for_owner(
let orchestrator_task_id = req.orchestrator_task_id.or(current.orchestrator_task_id);
let pr_url = req.pr_url.as_deref().or(current.pr_url.as_deref());
let pr_branch = req.pr_branch.as_deref().or(current.pr_branch.as_deref());
- let reconcile_mode = req.reconcile_mode.unwrap_or(current.reconcile_mode);
+ let reconcile_mode = req.reconcile_mode.clone().unwrap_or_else(|| current.reconcile_mode.clone());
let result = sqlx::query_as::<_, Directive>(
r#"
@@ -5738,6 +5738,8 @@ pub struct StepForDispatch {
pub base_branch: Option<String>,
/// The directive's PR branch (if a PR has already been created from previous steps).
pub pr_branch: Option<String>,
+ /// The directive's reconcile mode: "auto", "semi-auto", or "manual".
+ pub reconcile_mode: String,
}
/// Get ready steps that need task dispatch.
@@ -5760,7 +5762,8 @@ pub async fn get_ready_steps_for_dispatch(
d.title AS directive_title,
d.repository_url,
d.base_branch,
- d.pr_branch
+ d.pr_branch,
+ d.reconcile_mode
FROM directive_steps ds
JOIN directives d ON d.id = ds.directive_id
WHERE ds.status = 'ready'