From 20e161bc0731ba98b313cfe4d881307ab7ebd096 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 28 Apr 2026 09:33:59 -0700 Subject: [PATCH] refactor: rename checkpoints_disabled -> in_place The persisted bool described user intent (\"the user opted into the in-place execution mode\"), not a literal consequence -- SlateDB and event-sourced checkpoints flow regardless of the flag, only git checkpoints are skipped. Renaming aligns the name with intent and decouples it from any future implementation that allows git checkpoints in-place. The fork validator still consults this bool to bail out with a clear error before searching for git checkpoints that won't exist. --- docs/public/api-reference/fabro-api.yaml | 8 +- .../fabro-api/tests/run_summary_round_trip.rs | 2 +- .../fabro-cli/src/commands/runs/list.rs | 15 +- lib/crates/fabro-cli/src/server_runs.rs | 4 +- lib/crates/fabro-cli/tests/it/cmd/attach.rs | 2 +- lib/crates/fabro-server/src/demo/mod.rs | 2 +- lib/crates/fabro-server/src/run_manifest.rs | 2 +- lib/crates/fabro-server/src/server.rs | 4 +- lib/crates/fabro-store/src/run_state.rs | 35 ++-- lib/crates/fabro-store/src/slate/mod.rs | 2 +- .../tests/serializable_projection.rs | 28 +-- lib/crates/fabro-types/src/run.rs | 28 +-- lib/crates/fabro-types/src/run_event/run.rs | 32 +-- lib/crates/fabro-types/src/run_summary.rs | 40 ++-- .../fabro-types/tests/run_event_serde.rs | 34 ++-- .../fabro-types/tests/run_spec_methods.rs | 28 +-- .../fabro-types/tests/run_spec_serde.rs | 30 +-- lib/crates/fabro-workflow/src/event.rs | 102 +++++----- .../fabro-workflow/src/operations/create.rs | 28 +-- .../fabro-workflow/src/operations/fork.rs | 73 +++---- .../fabro-workflow/src/operations/start.rs | 4 +- .../src/pipeline/execute/tests.rs | 2 +- .../fabro-workflow/src/pipeline/initialize.rs | 2 +- .../fabro-workflow/src/pipeline/persist.rs | 36 ++-- .../src/pipeline/pull_request.rs | 186 +++++++++--------- .../fabro-workflow/src/pipeline/retro.rs | 62 +++--- lib/crates/fabro-workflow/src/run_dump.rs | 28 +-- lib/crates/fabro-workflow/src/run_lookup.rs | 62 +++--- .../fabro-workflow/src/runtime_store.rs | 62 +++--- lib/crates/fabro-workflow/src/sandbox_git.rs | 2 +- lib/crates/fabro-workflow/src/test_support.rs | 34 ++-- .../src/models/run-list-item.ts | 2 +- .../fabro-api-client/src/models/run-spec.ts | 2 +- .../src/models/run-summary.ts | 2 +- 34 files changed, 491 insertions(+), 494 deletions(-) diff --git a/docs/public/api-reference/fabro-api.yaml b/docs/public/api-reference/fabro-api.yaml index 86b7452ab..93b95e6e0 100644 --- a/docs/public/api-reference/fabro-api.yaml +++ b/docs/public/api-reference/fabro-api.yaml @@ -4522,7 +4522,7 @@ components: - run_id - settings - graph - - checkpoints_disabled + - in_place properties: run_id: type: string @@ -4558,7 +4558,7 @@ components: oneOf: - $ref: "#/components/schemas/ForkSourceRef" - type: "null" - checkpoints_disabled: + in_place: type: boolean RunProjection: @@ -4658,7 +4658,7 @@ components: type: string source_directory: type: ["string", "null"] - checkpoints_disabled: + in_place: type: boolean repo_origin_url: type: ["string", "null"] @@ -5313,7 +5313,7 @@ components: type: string source_directory: type: ["string", "null"] - checkpoints_disabled: + in_place: type: boolean repo_origin_url: type: ["string", "null"] diff --git a/lib/crates/fabro-api/tests/run_summary_round_trip.rs b/lib/crates/fabro-api/tests/run_summary_round_trip.rs index 3b6adb52f..9f88d9239 100644 --- a/lib/crates/fabro-api/tests/run_summary_round_trip.rs +++ b/lib/crates/fabro-api/tests/run_summary_round_trip.rs @@ -53,7 +53,7 @@ fn run_summary_json_matches_openapi_shape() { "team": "core" }, "source_directory": "/tmp/fabro", - "checkpoints_disabled": false, + "in_place": false, "repo_origin_url": null, "repository": { "name": "fabro" diff --git a/lib/crates/fabro-cli/src/commands/runs/list.rs b/lib/crates/fabro-cli/src/commands/runs/list.rs index 2f63758c5..855c1eae4 100644 --- a/lib/crates/fabro-cli/src/commands/runs/list.rs +++ b/lib/crates/fabro-cli/src/commands/runs/list.rs @@ -46,7 +46,7 @@ pub(crate) async fn list_command( "total_usd_micros": run.total_usd_micros(), "source_directory": run.source_directory(), "repo_origin_url": run.repo_origin_url(), - "checkpoints_disabled": run.checkpoints_disabled(), + "in_place": run.in_place(), "goal": run.goal(), }) }) @@ -83,7 +83,7 @@ pub(crate) async fn list_command( "RUN ID".cell().bold(use_color), "WORKFLOW".cell().bold(use_color), "STATUS".cell().bold(use_color), - "CHECKPOINTS".cell().bold(use_color), + "IN-PLACE".cell().bold(use_color), "DIRECTORY".cell().bold(use_color), "DURATION".cell().bold(use_color), "GOAL".cell().bold(use_color), @@ -113,7 +113,7 @@ pub(crate) async fn list_command( .foreground_color(color_if(use_color, Color::Ansi256(8))), run.workflow_name().cell(), status_cell(run.status(), use_color), - checkpoints_cell(run.checkpoints_disabled(), use_color), + in_place_cell(run.in_place(), use_color), dir_display.cell(), duration_display.cell(), truncate_goal(&run.goal(), 50) @@ -140,14 +140,13 @@ pub(crate) async fn list_command( Ok(()) } -fn checkpoints_cell(disabled: bool, use_color: bool) -> CellStruct { - if disabled { - return "disabled" +fn in_place_cell(in_place: bool, use_color: bool) -> CellStruct { + if in_place { + return "yes" .cell() .foreground_color(color_if(use_color, Color::Yellow)); } - "enabled" - .cell() + "no".cell() .foreground_color(color_if(use_color, Color::Ansi256(8))) } diff --git a/lib/crates/fabro-cli/src/server_runs.rs b/lib/crates/fabro-cli/src/server_runs.rs index 500534bb1..c4386420f 100644 --- a/lib/crates/fabro-cli/src/server_runs.rs +++ b/lib/crates/fabro-cli/src/server_runs.rs @@ -68,8 +68,8 @@ impl ServerRunSummaryInfo { self.summary.repo_origin_url.as_deref() } - pub(crate) fn checkpoints_disabled(&self) -> bool { - self.summary.checkpoints_disabled + pub(crate) fn in_place(&self) -> bool { + self.summary.in_place } pub(crate) fn goal(&self) -> String { diff --git a/lib/crates/fabro-cli/tests/it/cmd/attach.rs b/lib/crates/fabro-cli/tests/it/cmd/attach.rs index 4edb7c0ee..168c1e8fa 100644 --- a/lib/crates/fabro-cli/tests/it/cmd/attach.rs +++ b/lib/crates/fabro-cli/tests/it/cmd/attach.rs @@ -453,7 +453,6 @@ fn attach_json_errors_without_prompting_for_human_input() { "event": "run.created", "id": "[EVENT_ID]", "properties": { - "checkpoints_disabled": false, "graph": { "attrs": { "goal": { @@ -554,6 +553,7 @@ fn attach_json_errors_without_prompting_for_human_input() { } } }, + "in_place": false, "manifest_blob": "[BLOB_ID]", "provenance": { "client": { diff --git a/lib/crates/fabro-server/src/demo/mod.rs b/lib/crates/fabro-server/src/demo/mod.rs index 286f1a4da..1c2eb9329 100644 --- a/lib/crates/fabro-server/src/demo/mod.rs +++ b/lib/crates/fabro-server/src/demo/mod.rs @@ -918,7 +918,7 @@ mod runs { elapsed_secs: summary.elapsed_secs, goal: summary.goal, source_directory: summary.source_directory, - checkpoints_disabled: Some(summary.checkpoints_disabled), + in_place: Some(summary.in_place), repo_origin_url: summary.repo_origin_url, labels: summary.labels, pending_control: summary.pending_control, diff --git a/lib/crates/fabro-server/src/run_manifest.rs b/lib/crates/fabro-server/src/run_manifest.rs index 68abb3591..200cc0f47 100644 --- a/lib/crates/fabro-server/src/run_manifest.rs +++ b/lib/crates/fabro-server/src/run_manifest.rs @@ -172,7 +172,7 @@ pub(crate) fn create_run_input( base_branch: prepared.git.as_ref().map(|git| git.branch.clone()), pre_run_git: prepared.git.as_ref().map(pre_run_git_from_manifest), fork_source_ref: None, - checkpoints_disabled: prepared.in_place, + in_place: prepared.in_place, provenance: None, configured_providers, } diff --git a/lib/crates/fabro-server/src/server.rs b/lib/crates/fabro-server/src/server.rs index 1f8818cc4..3e0b5c2a1 100644 --- a/lib/crates/fabro-server/src/server.rs +++ b/lib/crates/fabro-server/src/server.rs @@ -9738,7 +9738,7 @@ strategy = "token" definition_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, }; create_durable_run_with_events(state, run_id, &[ @@ -9759,7 +9759,7 @@ strategy = "token" manifest_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, }, workflow_event::Event::WorkflowRunStarted { name: "test".to_string(), diff --git a/lib/crates/fabro-store/src/run_state.rs b/lib/crates/fabro-store/src/run_state.rs index b09297f78..5ce226fd4 100644 --- a/lib/crates/fabro-store/src/run_state.rs +++ b/lib/crates/fabro-store/src/run_state.rs @@ -62,7 +62,7 @@ impl RunProjectionReducer for RunProjection { definition_blob: None, pre_run_git: props.pre_run_git.clone(), fork_source_ref: props.fork_source_ref.clone(), - checkpoints_disabled: props.checkpoints_disabled, + in_place: props.in_place, }); self.graph_source.clone_from(&props.workflow_source); } @@ -393,10 +393,7 @@ pub(crate) fn build_summary(state: &RunProjection, run_id: &RunId) -> RunSummary .spec .as_ref() .and_then(|spec| spec.source_directory.clone()), - state - .spec - .as_ref() - .is_some_and(|spec| spec.checkpoints_disabled), + state.spec.as_ref().is_some_and(|spec| spec.in_place), state .spec .as_ref() @@ -988,20 +985,20 @@ mod tests { fn summary_synthesizes_submitted_when_run_exists_without_status() { let mut state = RunProjection::default(); state.spec = Some(fabro_types::RunSpec { - run_id: fixtures::RUN_1, - settings: WorkflowSettings::default(), - graph: fabro_types::Graph::new("test"), - workflow_slug: Some("test".to_string()), - source_directory: Some("/tmp/repo".to_string()), - repo_origin_url: None, - base_branch: None, - labels: HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: WorkflowSettings::default(), + graph: fabro_types::Graph::new("test"), + workflow_slug: Some("test".to_string()), + source_directory: Some("/tmp/repo".to_string()), + repo_origin_url: None, + base_branch: None, + labels: HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }); let summary_json = serde_json::to_value(build_summary(&state, &fixtures::RUN_1)).unwrap(); diff --git a/lib/crates/fabro-store/src/slate/mod.rs b/lib/crates/fabro-store/src/slate/mod.rs index 8ed90c953..fefbd1082 100644 --- a/lib/crates/fabro-store/src/slate/mod.rs +++ b/lib/crates/fabro-store/src/slate/mod.rs @@ -365,7 +365,7 @@ mod tests { definition_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, } } diff --git a/lib/crates/fabro-store/tests/serializable_projection.rs b/lib/crates/fabro-store/tests/serializable_projection.rs index f99720559..c0321e07d 100644 --- a/lib/crates/fabro-store/tests/serializable_projection.rs +++ b/lib/crates/fabro-store/tests/serializable_projection.rs @@ -12,20 +12,20 @@ use serde_json::json; fn sample_run_spec() -> RunSpec { RunSpec { - run_id: fixtures::RUN_1, - settings: WorkflowSettings::default(), - graph: Graph::new("ship"), - workflow_slug: Some("demo".to_string()), - source_directory: Some("/tmp/project".to_string()), - repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), - base_branch: Some("main".to_string()), - labels: HashMap::from([("team".to_string(), "platform".to_string())]), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: WorkflowSettings::default(), + graph: Graph::new("ship"), + workflow_slug: Some("demo".to_string()), + source_directory: Some("/tmp/project".to_string()), + repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), + base_branch: Some("main".to_string()), + labels: HashMap::from([("team".to_string(), "platform".to_string())]), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, } } diff --git a/lib/crates/fabro-types/src/run.rs b/lib/crates/fabro-types/src/run.rs index 37170550a..93b6bdd09 100644 --- a/lib/crates/fabro-types/src/run.rs +++ b/lib/crates/fabro-types/src/run.rs @@ -91,31 +91,31 @@ pub struct ForkSourceRef { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RunSpec { - pub run_id: RunId, - pub settings: WorkflowSettings, - pub graph: Graph, + pub run_id: RunId, + pub settings: WorkflowSettings, + pub graph: Graph, #[serde(default, skip_serializing_if = "Option::is_none")] - pub workflow_slug: Option, + pub workflow_slug: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub source_directory: Option, + pub source_directory: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub repo_origin_url: Option, + pub repo_origin_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub base_branch: Option, + pub base_branch: Option, #[serde(default, skip_serializing_if = "HashMap::is_empty")] - pub labels: HashMap, + pub labels: HashMap, #[serde(default, skip_serializing_if = "Option::is_none")] - pub provenance: Option, + pub provenance: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub manifest_blob: Option, + pub manifest_blob: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub definition_blob: Option, + pub definition_blob: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub pre_run_git: Option, + pub pre_run_git: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub fork_source_ref: Option, + pub fork_source_ref: Option, #[serde(default)] - pub checkpoints_disabled: bool, + pub in_place: bool, } impl RunSpec { diff --git a/lib/crates/fabro-types/src/run_event/run.rs b/lib/crates/fabro-types/src/run_event/run.rs index 0927c7543..b0d845890 100644 --- a/lib/crates/fabro-types/src/run_event/run.rs +++ b/lib/crates/fabro-types/src/run_event/run.rs @@ -11,35 +11,35 @@ use crate::{ #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct RunCreatedProps { - pub settings: WorkflowSettings, - pub graph: Graph, + pub settings: WorkflowSettings, + pub graph: Graph, #[serde(default, skip_serializing_if = "Option::is_none")] - pub workflow_source: Option, + pub workflow_source: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub workflow_config: Option, + pub workflow_config: Option, #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - pub labels: BTreeMap, - pub run_dir: String, + pub labels: BTreeMap, + pub run_dir: String, #[serde(default, skip_serializing_if = "Option::is_none")] - pub source_directory: Option, + pub source_directory: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub repo_origin_url: Option, + pub repo_origin_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub base_branch: Option, + pub base_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub workflow_slug: Option, + pub workflow_slug: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub db_prefix: Option, + pub db_prefix: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub provenance: Option, + pub provenance: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub manifest_blob: Option, + pub manifest_blob: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub pre_run_git: Option, + pub pre_run_git: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub fork_source_ref: Option, + pub fork_source_ref: Option, #[serde(default)] - pub checkpoints_disabled: bool, + pub in_place: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/lib/crates/fabro-types/src/run_summary.rs b/lib/crates/fabro-types/src/run_summary.rs index 06e5fd3fa..97e9ce29c 100644 --- a/lib/crates/fabro-types/src/run_summary.rs +++ b/lib/crates/fabro-types/src/run_summary.rs @@ -8,35 +8,35 @@ use crate::{RepositoryReference, RunControlAction, RunId, RunStatus}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct RunSummary { - pub run_id: RunId, + pub run_id: RunId, #[serde(default)] - pub workflow_name: Option, + pub workflow_name: Option, #[serde(default)] - pub workflow_slug: Option, - pub goal: String, - pub title: String, - pub labels: HashMap, + pub workflow_slug: Option, + pub goal: String, + pub title: String, + pub labels: HashMap, #[serde(default)] - pub source_directory: Option, + pub source_directory: Option, #[serde(default)] - pub checkpoints_disabled: bool, + pub in_place: bool, #[serde(default)] - pub repo_origin_url: Option, - pub repository: RepositoryReference, + pub repo_origin_url: Option, + pub repository: RepositoryReference, #[serde(default)] - pub start_time: Option>, - pub created_at: DateTime, - pub status: RunStatus, + pub start_time: Option>, + pub created_at: DateTime, + pub status: RunStatus, #[serde(default)] - pub pending_control: Option, + pub pending_control: Option, #[serde(default)] - pub duration_ms: Option, + pub duration_ms: Option, #[serde(default)] - pub elapsed_secs: Option, + pub elapsed_secs: Option, #[serde(default)] - pub total_usd_micros: Option, + pub total_usd_micros: Option, #[serde(default)] - pub superseded_by: Option, + pub superseded_by: Option, } impl RunSummary { @@ -51,7 +51,7 @@ impl RunSummary { goal: String, labels: HashMap, source_directory: Option, - checkpoints_disabled: bool, + in_place: bool, repo_origin_url: Option, start_time: Option>, status: RunStatus, @@ -75,7 +75,7 @@ impl RunSummary { title, labels, source_directory, - checkpoints_disabled, + in_place, repo_origin_url, repository, start_time, diff --git a/lib/crates/fabro-types/tests/run_event_serde.rs b/lib/crates/fabro-types/tests/run_event_serde.rs index 4dbb56070..47a244e0b 100644 --- a/lib/crates/fabro-types/tests/run_event_serde.rs +++ b/lib/crates/fabro-types/tests/run_event_serde.rs @@ -16,29 +16,29 @@ fn templated_settings() -> WorkflowSettings { #[test] fn run_created_props_round_trip_templated_settings() { let props = RunCreatedProps { - settings: templated_settings(), - graph: Graph::new("ship"), - workflow_source: Some("digraph Ship { start -> exit }".to_string()), - workflow_config: Some("[run]\ngoal = \"Ship {{ env.TASK }}\"".to_string()), - labels: BTreeMap::from([("team".to_string(), "platform".to_string())]), - run_dir: "/tmp/run".to_string(), - source_directory: Some("/Users/client/project".to_string()), - repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), - base_branch: Some("main".to_string()), - workflow_slug: Some("demo".to_string()), - db_prefix: Some("run_".to_string()), - provenance: None, - manifest_blob: None, - pre_run_git: Some(PreRunGitContext { + settings: templated_settings(), + graph: Graph::new("ship"), + workflow_source: Some("digraph Ship { start -> exit }".to_string()), + workflow_config: Some("[run]\ngoal = \"Ship {{ env.TASK }}\"".to_string()), + labels: BTreeMap::from([("team".to_string(), "platform".to_string())]), + run_dir: "/tmp/run".to_string(), + source_directory: Some("/Users/client/project".to_string()), + repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), + base_branch: Some("main".to_string()), + workflow_slug: Some("demo".to_string()), + db_prefix: Some("run_".to_string()), + provenance: None, + manifest_blob: None, + pre_run_git: Some(PreRunGitContext { display_base_sha: Some("abc123".to_string()), local_dirty: DirtyStatus::Unknown, push_outcome: PreRunPushOutcome::SkippedNoRemote, }), - fork_source_ref: Some(ForkSourceRef { + fork_source_ref: Some(ForkSourceRef { source_run_id: fixtures::RUN_2, checkpoint_sha: "def456".to_string(), }), - checkpoints_disabled: true, + in_place: true, }; let json = serde_json::to_value(&props).expect("props should serialize"); @@ -49,7 +49,7 @@ fn run_created_props_round_trip_templated_settings() { json["pre_run_git"]["push_outcome"]["type"], "skipped_no_remote" ); - assert_eq!(json["checkpoints_disabled"], true); + assert_eq!(json["in_place"], true); let round_trip: RunCreatedProps = serde_json::from_value(json.clone()).expect("props should deserialize"); diff --git a/lib/crates/fabro-types/tests/run_spec_methods.rs b/lib/crates/fabro-types/tests/run_spec_methods.rs index 2a12c956f..000a6b225 100644 --- a/lib/crates/fabro-types/tests/run_spec_methods.rs +++ b/lib/crates/fabro-types/tests/run_spec_methods.rs @@ -6,18 +6,18 @@ use fabro_types::{WorkflowSettings, fixtures}; fn sample_run_spec() -> RunSpec { RunSpec { - run_id: fixtures::RUN_1, - settings: WorkflowSettings::default(), - graph: Graph::new("ship"), - workflow_slug: Some("demo".to_string()), - source_directory: Some("/Users/client/project".to_string()), - repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), - base_branch: Some("main".to_string()), - labels: HashMap::from([("team".to_string(), "platform".to_string())]), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: Some(PreRunGitContext { + run_id: fixtures::RUN_1, + settings: WorkflowSettings::default(), + graph: Graph::new("ship"), + workflow_slug: Some("demo".to_string()), + source_directory: Some("/Users/client/project".to_string()), + repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), + base_branch: Some("main".to_string()), + labels: HashMap::from([("team".to_string(), "platform".to_string())]), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: Some(PreRunGitContext { display_base_sha: Some("abc123".to_string()), local_dirty: DirtyStatus::Dirty, push_outcome: PreRunPushOutcome::SkippedRemoteMismatch { @@ -25,8 +25,8 @@ fn sample_run_spec() -> RunSpec { repo_origin_url: "https://github.com/fabro-sh/fabro.git".to_string(), }, }), - fork_source_ref: None, - checkpoints_disabled: false, + fork_source_ref: None, + in_place: false, } } diff --git a/lib/crates/fabro-types/tests/run_spec_serde.rs b/lib/crates/fabro-types/tests/run_spec_serde.rs index 9688a5172..9875d58f1 100644 --- a/lib/crates/fabro-types/tests/run_spec_serde.rs +++ b/lib/crates/fabro-types/tests/run_spec_serde.rs @@ -15,18 +15,18 @@ fn templated_settings() -> WorkflowSettings { #[test] fn run_spec_round_trips_templated_settings() { let record = RunSpec { - run_id: fixtures::RUN_1, - settings: templated_settings(), - graph: Graph::new("ship"), - workflow_slug: Some("demo".to_string()), - source_directory: Some("/Users/client/project".to_string()), - repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), - base_branch: Some("main".to_string()), - labels: HashMap::from([("team".to_string(), "platform".to_string())]), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: Some(PreRunGitContext { + run_id: fixtures::RUN_1, + settings: templated_settings(), + graph: Graph::new("ship"), + workflow_slug: Some("demo".to_string()), + source_directory: Some("/Users/client/project".to_string()), + repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), + base_branch: Some("main".to_string()), + labels: HashMap::from([("team".to_string(), "platform".to_string())]), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: Some(PreRunGitContext { display_base_sha: Some("abc123".to_string()), local_dirty: DirtyStatus::Clean, push_outcome: PreRunPushOutcome::Succeeded { @@ -34,11 +34,11 @@ fn run_spec_round_trips_templated_settings() { branch: "main".to_string(), }, }), - fork_source_ref: Some(ForkSourceRef { + fork_source_ref: Some(ForkSourceRef { source_run_id: fixtures::RUN_2, checkpoint_sha: "def456".to_string(), }), - checkpoints_disabled: false, + in_place: false, }; let json = serde_json::to_value(&record).expect("record should serialize"); @@ -48,7 +48,7 @@ fn run_spec_round_trips_templated_settings() { assert_eq!(json["pre_run_git"]["local_dirty"], "clean"); assert_eq!(json["pre_run_git"]["push_outcome"]["type"], "succeeded"); assert_eq!(json["fork_source_ref"]["checkpoint_sha"], "def456"); - assert_eq!(json["checkpoints_disabled"], false); + assert_eq!(json["in_place"], false); let round_trip: RunSpec = serde_json::from_value(json.clone()).expect("record should deserialize"); diff --git a/lib/crates/fabro-workflow/src/event.rs b/lib/crates/fabro-workflow/src/event.rs index 5488eb396..f19c5c635 100644 --- a/lib/crates/fabro-workflow/src/event.rs +++ b/lib/crates/fabro-workflow/src/event.rs @@ -37,35 +37,35 @@ use crate::runtime_store::RunStoreHandle; )] pub enum Event { RunCreated { - run_id: RunId, - settings: serde_json::Value, - graph: serde_json::Value, + run_id: RunId, + settings: serde_json::Value, + graph: serde_json::Value, #[serde(default, skip_serializing_if = "Option::is_none")] - workflow_source: Option, + workflow_source: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - workflow_config: Option, - labels: BTreeMap, - run_dir: String, + workflow_config: Option, + labels: BTreeMap, + run_dir: String, #[serde(default, skip_serializing_if = "Option::is_none")] - source_directory: Option, + source_directory: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - repo_origin_url: Option, + repo_origin_url: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - base_branch: Option, + base_branch: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - workflow_slug: Option, + workflow_slug: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - db_prefix: Option, + db_prefix: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - provenance: Option, + provenance: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - manifest_blob: Option, + manifest_blob: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pre_run_git: Option, + pre_run_git: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - fork_source_ref: Option, + fork_source_ref: Option, #[serde(default)] - checkpoints_disabled: bool, + in_place: bool, }, WorkflowRunStarted { name: String, @@ -1530,26 +1530,26 @@ fn event_body_from_event(event: &Event) -> EventBody { manifest_blob, pre_run_git, fork_source_ref, - checkpoints_disabled, + in_place, .. } => EventBody::RunCreated(fabro_types::RunCreatedProps { - settings: serde_json::from_value(settings.clone()) + settings: serde_json::from_value(settings.clone()) .expect("run.created settings"), - graph: serde_json::from_value(graph.clone()).expect("run.created graph"), - workflow_source: workflow_source.clone(), - workflow_config: workflow_config.clone(), - labels: labels.clone(), - run_dir: run_dir.clone(), - source_directory: source_directory.clone(), - repo_origin_url: repo_origin_url.clone(), - base_branch: base_branch.clone(), - workflow_slug: workflow_slug.clone(), - db_prefix: db_prefix.clone(), - provenance: provenance.clone(), - manifest_blob: *manifest_blob, - pre_run_git: pre_run_git.clone(), - fork_source_ref: fork_source_ref.clone(), - checkpoints_disabled: *checkpoints_disabled, + graph: serde_json::from_value(graph.clone()).expect("run.created graph"), + workflow_source: workflow_source.clone(), + workflow_config: workflow_config.clone(), + labels: labels.clone(), + run_dir: run_dir.clone(), + source_directory: source_directory.clone(), + repo_origin_url: repo_origin_url.clone(), + base_branch: base_branch.clone(), + workflow_slug: workflow_slug.clone(), + db_prefix: db_prefix.clone(), + provenance: provenance.clone(), + manifest_blob: *manifest_blob, + pre_run_git: pre_run_git.clone(), + fork_source_ref: fork_source_ref.clone(), + in_place: *in_place, }), Event::WorkflowRunStarted { name, @@ -3671,23 +3671,23 @@ mod tests { }; let stored = to_run_event(&fixtures::RUN_1, &Event::RunCreated { - run_id: fixtures::RUN_1, - settings: serde_json::to_value(WorkflowSettings::default()).unwrap(), - graph: serde_json::to_value(Graph::new("test")).unwrap(), - workflow_source: None, - workflow_config: None, - labels: BTreeMap::default(), - run_dir: "/tmp/run".to_string(), - source_directory: Some("/tmp/run".to_string()), - repo_origin_url: None, - base_branch: None, - workflow_slug: None, - db_prefix: None, - provenance: Some(provenance), - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: serde_json::to_value(WorkflowSettings::default()).unwrap(), + graph: serde_json::to_value(Graph::new("test")).unwrap(), + workflow_source: None, + workflow_config: None, + labels: BTreeMap::default(), + run_dir: "/tmp/run".to_string(), + source_directory: Some("/tmp/run".to_string()), + repo_origin_url: None, + base_branch: None, + workflow_slug: None, + db_prefix: None, + provenance: Some(provenance), + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }); let actor = stored.actor.as_ref().expect("actor set"); assert_eq!(actor.kind, ActorKind::User); diff --git a/lib/crates/fabro-workflow/src/operations/create.rs b/lib/crates/fabro-workflow/src/operations/create.rs index 90739dbc4..376eb9ae7 100644 --- a/lib/crates/fabro-workflow/src/operations/create.rs +++ b/lib/crates/fabro-workflow/src/operations/create.rs @@ -45,7 +45,7 @@ pub struct CreateRunInput { pub base_branch: Option, pub pre_run_git: Option, pub fork_source_ref: Option, - pub checkpoints_disabled: bool, + pub in_place: bool, pub provenance: Option, pub configured_providers: Vec, } @@ -69,7 +69,7 @@ struct PersistCreateOptions { repo_origin_url: Option, pre_run_git: Option, fork_source_ref: Option, - checkpoints_disabled: bool, + in_place: bool, provenance: Option, configured_providers: Vec, } @@ -105,7 +105,7 @@ pub async fn create( base_branch, pre_run_git, fork_source_ref, - checkpoints_disabled, + in_place, provenance, configured_providers, } = request; @@ -143,7 +143,7 @@ pub async fn create( repo_origin_url, pre_run_git, fork_source_ref, - checkpoints_disabled, + in_place, provenance, configured_providers, }, @@ -236,7 +236,7 @@ async fn persist_created_run( manifest_blob, pre_run_git: record.pre_run_git.clone(), fork_source_ref: record.fork_source_ref.clone(), - checkpoints_disabled: record.checkpoints_disabled, + in_place: record.in_place, }, record.run_id.created_at(), None, @@ -355,7 +355,7 @@ fn persist_validated( repo_origin_url, pre_run_git, fork_source_ref, - checkpoints_disabled, + in_place, provenance, configured_providers, } = options; @@ -384,7 +384,7 @@ fn persist_validated( definition_blob: None, pre_run_git, fork_source_ref, - checkpoints_disabled, + in_place, }; pipeline::persist(validated, PersistOptions { run_dir, run_spec }) @@ -726,7 +726,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -771,7 +771,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -832,7 +832,7 @@ mod tests { base_branch: Some("main".to_string()), pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -942,7 +942,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -980,7 +980,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -1046,7 +1046,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -1091,7 +1091,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: Some(fabro_types::RunProvenance { server: Some(fabro_types::RunServerProvenance { version: "0.9.0".to_string(), diff --git a/lib/crates/fabro-workflow/src/operations/fork.rs b/lib/crates/fabro-workflow/src/operations/fork.rs index c2bc35649..d9fa71d24 100644 --- a/lib/crates/fabro-workflow/src/operations/fork.rs +++ b/lib/crates/fabro-workflow/src/operations/fork.rs @@ -112,9 +112,10 @@ fn validate_source_spec( checkpoint_sha: &str, ) -> std::result::Result<(), Error> { let spec = spec.ok_or_else(|| Error::engine("source run projection has no spec"))?; - if spec.checkpoints_disabled { + if spec.in_place { return Err(Error::Validation( - "source run was created with checkpoints disabled; cannot fork".to_string(), + "source run was created with --in-place; cannot fork (no git checkpoint history)" + .to_string(), )); } if checkpoint_sha.trim().is_empty() { @@ -169,25 +170,25 @@ async fn persist_forked_run( .map_err(|err| Error::engine(err.to_string()))?; event::append_event(&run_store, &spec.run_id, &Event::RunCreated { - run_id: spec.run_id, - settings: serde_json::to_value(&spec.settings) + run_id: spec.run_id, + settings: serde_json::to_value(&spec.settings) .map_err(|err| Error::engine(err.to_string()))?, - graph: serde_json::to_value(&spec.graph) + graph: serde_json::to_value(&spec.graph) .map_err(|err| Error::engine(err.to_string()))?, - workflow_source: projection.graph_source.clone(), - workflow_config: None, - labels: spec.labels.clone().into_iter().collect(), - run_dir: String::new(), - source_directory: spec.source_directory.clone(), - repo_origin_url: spec.repo_origin_url.clone(), - base_branch: spec.base_branch.clone(), - workflow_slug: spec.workflow_slug.clone(), - db_prefix: None, - provenance: spec.provenance.clone(), - manifest_blob: spec.manifest_blob, - pre_run_git: spec.pre_run_git.clone(), - fork_source_ref: spec.fork_source_ref.clone(), - checkpoints_disabled: spec.checkpoints_disabled, + workflow_source: projection.graph_source.clone(), + workflow_config: None, + labels: spec.labels.clone().into_iter().collect(), + run_dir: String::new(), + source_directory: spec.source_directory.clone(), + repo_origin_url: spec.repo_origin_url.clone(), + base_branch: spec.base_branch.clone(), + workflow_slug: spec.workflow_slug.clone(), + db_prefix: None, + provenance: spec.provenance.clone(), + manifest_blob: spec.manifest_blob, + pre_run_git: spec.pre_run_git.clone(), + fork_source_ref: spec.fork_source_ref.clone(), + in_place: spec.in_place, }) .await .map_err(|err| Error::engine(err.to_string()))?; @@ -321,23 +322,23 @@ mod tests { let settings = WorkflowSettings::default(); event::append_event(&source, &source_run_id, &Event::RunCreated { - run_id: source_run_id, - settings: serde_json::to_value(&settings).unwrap(), - graph: serde_json::to_value(&graph).unwrap(), - workflow_source: Some("digraph fork_source {}".to_string()), - workflow_config: None, - labels: BTreeMap::new(), - run_dir: "/tmp/source".to_string(), - source_directory: Some("/client/source".to_string()), - repo_origin_url: Some("https://github.com/example/repo.git".to_string()), - base_branch: Some("main".to_string()), - workflow_slug: Some("fork-source".to_string()), - db_prefix: None, - provenance: None, - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: source_run_id, + settings: serde_json::to_value(&settings).unwrap(), + graph: serde_json::to_value(&graph).unwrap(), + workflow_source: Some("digraph fork_source {}".to_string()), + workflow_config: None, + labels: BTreeMap::new(), + run_dir: "/tmp/source".to_string(), + source_directory: Some("/client/source".to_string()), + repo_origin_url: Some("https://github.com/example/repo.git".to_string()), + base_branch: Some("main".to_string()), + workflow_slug: Some("fork-source".to_string()), + db_prefix: None, + provenance: None, + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }) .await .unwrap(); diff --git a/lib/crates/fabro-workflow/src/operations/start.rs b/lib/crates/fabro-workflow/src/operations/start.rs index 807cecb97..1561a77ac 100644 --- a/lib/crates/fabro-workflow/src/operations/start.rs +++ b/lib/crates/fabro-workflow/src/operations/start.rs @@ -1078,7 +1078,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, @@ -1258,7 +1258,7 @@ mod tests { base_branch: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, provenance: None, configured_providers: Vec::new(), }, diff --git a/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs b/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs index 5dee9c4dd..945fd7c97 100644 --- a/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs +++ b/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs @@ -153,7 +153,7 @@ fn persisted_workflow(graph: Graph, source: String, run_dir: &Path, run_id: RunI definition_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, }, ) } diff --git a/lib/crates/fabro-workflow/src/pipeline/initialize.rs b/lib/crates/fabro-workflow/src/pipeline/initialize.rs index d00f469e6..8e3743dea 100644 --- a/lib/crates/fabro-workflow/src/pipeline/initialize.rs +++ b/lib/crates/fabro-workflow/src/pipeline/initialize.rs @@ -873,7 +873,7 @@ mod tests { definition_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, }, ) } diff --git a/lib/crates/fabro-workflow/src/pipeline/persist.rs b/lib/crates/fabro-workflow/src/pipeline/persist.rs index 7094efec1..277ca87aa 100644 --- a/lib/crates/fabro-workflow/src/pipeline/persist.rs +++ b/lib/crates/fabro-workflow/src/pipeline/persist.rs @@ -148,7 +148,7 @@ mod tests { definition_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, } } @@ -156,23 +156,23 @@ mod tests { let store = memory_store(); let run_store = store.create_run(&record.run_id).await.unwrap(); append_event(&run_store, &record.run_id, &Event::RunCreated { - run_id: record.run_id, - settings: serde_json::to_value(&record.settings).unwrap(), - graph: serde_json::to_value(&record.graph).unwrap(), - workflow_source: source.map(ToOwned::to_owned), - workflow_config: None, - labels: record.labels.clone().into_iter().collect(), - run_dir: run_dir.to_string_lossy().to_string(), - source_directory: record.source_directory.clone(), - repo_origin_url: record.repo_origin_url.clone(), - base_branch: record.base_branch.clone(), - workflow_slug: record.workflow_slug.clone(), - db_prefix: None, - provenance: record.provenance.clone(), - manifest_blob: None, - pre_run_git: record.pre_run_git.clone(), - fork_source_ref: record.fork_source_ref.clone(), - checkpoints_disabled: record.checkpoints_disabled, + run_id: record.run_id, + settings: serde_json::to_value(&record.settings).unwrap(), + graph: serde_json::to_value(&record.graph).unwrap(), + workflow_source: source.map(ToOwned::to_owned), + workflow_config: None, + labels: record.labels.clone().into_iter().collect(), + run_dir: run_dir.to_string_lossy().to_string(), + source_directory: record.source_directory.clone(), + repo_origin_url: record.repo_origin_url.clone(), + base_branch: record.base_branch.clone(), + workflow_slug: record.workflow_slug.clone(), + db_prefix: None, + provenance: record.provenance.clone(), + manifest_blob: None, + pre_run_git: record.pre_run_git.clone(), + fork_source_ref: record.fork_source_ref.clone(), + in_place: record.in_place, }) .await .unwrap(); diff --git a/lib/crates/fabro-workflow/src/pipeline/pull_request.rs b/lib/crates/fabro-workflow/src/pipeline/pull_request.rs index d6842645b..6cd14b3fc 100644 --- a/lib/crates/fabro-workflow/src/pipeline/pull_request.rs +++ b/lib/crates/fabro-workflow/src/pipeline/pull_request.rs @@ -1167,39 +1167,39 @@ mod tests { let run_store = store.create_run(&fixtures::RUN_1).await.unwrap(); let run_spec = RunSpec { - run_id: fixtures::RUN_1, - settings: fabro_types::WorkflowSettings::default(), - graph: Graph::new("test"), - workflow_slug: Some("test".to_string()), - source_directory: Some("/tmp/project".to_string()), - repo_origin_url: None, - base_branch: Some("main".to_string()), - labels: HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: fabro_types::WorkflowSettings::default(), + graph: Graph::new("test"), + workflow_slug: Some("test".to_string()), + source_directory: Some("/tmp/project".to_string()), + repo_origin_url: None, + base_branch: Some("main".to_string()), + labels: HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }; append_event(&run_store, &fixtures::RUN_1, &Event::RunCreated { - run_id: fixtures::RUN_1, - settings: serde_json::to_value(&run_spec.settings).unwrap(), - graph: serde_json::to_value(&run_spec.graph).unwrap(), - workflow_source: Some("digraph test { plan -> code }".to_string()), - workflow_config: None, - labels: run_spec.labels.clone().into_iter().collect(), - run_dir: "/tmp/project".to_string(), - source_directory: run_spec.source_directory.clone(), - repo_origin_url: run_spec.repo_origin_url.clone(), - base_branch: run_spec.base_branch.clone(), - workflow_slug: run_spec.workflow_slug.clone(), - db_prefix: None, - provenance: run_spec.provenance.clone(), - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: serde_json::to_value(&run_spec.settings).unwrap(), + graph: serde_json::to_value(&run_spec.graph).unwrap(), + workflow_source: Some("digraph test { plan -> code }".to_string()), + workflow_config: None, + labels: run_spec.labels.clone().into_iter().collect(), + run_dir: "/tmp/project".to_string(), + source_directory: run_spec.source_directory.clone(), + repo_origin_url: run_spec.repo_origin_url.clone(), + base_branch: run_spec.base_branch.clone(), + workflow_slug: run_spec.workflow_slug.clone(), + db_prefix: None, + provenance: run_spec.provenance.clone(), + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }) .await .unwrap(); @@ -1234,39 +1234,39 @@ mod tests { let run_store = store.create_run(&fixtures::RUN_1).await.unwrap(); let run_spec = RunSpec { - run_id: fixtures::RUN_1, - settings: fabro_types::WorkflowSettings::default(), - graph: Graph::new("test"), - workflow_slug: Some("test".to_string()), - source_directory: Some("/tmp/project".to_string()), - repo_origin_url: None, - base_branch: Some("main".to_string()), - labels: HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: fabro_types::WorkflowSettings::default(), + graph: Graph::new("test"), + workflow_slug: Some("test".to_string()), + source_directory: Some("/tmp/project".to_string()), + repo_origin_url: None, + base_branch: Some("main".to_string()), + labels: HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }; append_event(&run_store, &fixtures::RUN_1, &Event::RunCreated { - run_id: fixtures::RUN_1, - settings: serde_json::to_value(&run_spec.settings).unwrap(), - graph: serde_json::to_value(&run_spec.graph).unwrap(), - workflow_source: Some("digraph test { plan -> code }".to_string()), - workflow_config: None, - labels: run_spec.labels.clone().into_iter().collect(), - run_dir: "/tmp/project".to_string(), - source_directory: run_spec.source_directory.clone(), - repo_origin_url: run_spec.repo_origin_url.clone(), - base_branch: run_spec.base_branch.clone(), - workflow_slug: run_spec.workflow_slug.clone(), - db_prefix: None, - provenance: run_spec.provenance.clone(), - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: serde_json::to_value(&run_spec.settings).unwrap(), + graph: serde_json::to_value(&run_spec.graph).unwrap(), + workflow_source: Some("digraph test { plan -> code }".to_string()), + workflow_config: None, + labels: run_spec.labels.clone().into_iter().collect(), + run_dir: "/tmp/project".to_string(), + source_directory: run_spec.source_directory.clone(), + repo_origin_url: run_spec.repo_origin_url.clone(), + base_branch: run_spec.base_branch.clone(), + workflow_slug: run_spec.workflow_slug.clone(), + db_prefix: None, + provenance: run_spec.provenance.clone(), + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }) .await .unwrap(); @@ -1534,39 +1534,39 @@ mod tests { let store = test_store(); let run_store = store.create_run(&fixtures::RUN_1).await.unwrap(); let run_spec = RunSpec { - run_id: fixtures::RUN_1, - settings: fabro_types::WorkflowSettings::default(), - graph: Graph::new("test"), - workflow_slug: None, - source_directory: Some(tmp.path().display().to_string()), - repo_origin_url: None, - base_branch: None, - labels: std::collections::HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: fabro_types::WorkflowSettings::default(), + graph: Graph::new("test"), + workflow_slug: None, + source_directory: Some(tmp.path().display().to_string()), + repo_origin_url: None, + base_branch: None, + labels: std::collections::HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }; append_event(&run_store, &fixtures::RUN_1, &Event::RunCreated { - run_id: fixtures::RUN_1, - settings: serde_json::to_value(&run_spec.settings).unwrap(), - graph: serde_json::to_value(&run_spec.graph).unwrap(), - workflow_source: None, - workflow_config: None, - labels: run_spec.labels.clone().into_iter().collect(), - run_dir: tmp.path().display().to_string(), - source_directory: run_spec.source_directory.clone(), - repo_origin_url: run_spec.repo_origin_url.clone(), - base_branch: None, - workflow_slug: None, - db_prefix: None, - provenance: run_spec.provenance.clone(), - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: serde_json::to_value(&run_spec.settings).unwrap(), + graph: serde_json::to_value(&run_spec.graph).unwrap(), + workflow_source: None, + workflow_config: None, + labels: run_spec.labels.clone().into_iter().collect(), + run_dir: tmp.path().display().to_string(), + source_directory: run_spec.source_directory.clone(), + repo_origin_url: run_spec.repo_origin_url.clone(), + base_branch: None, + workflow_slug: None, + db_prefix: None, + provenance: run_spec.provenance.clone(), + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }) .await .unwrap(); diff --git a/lib/crates/fabro-workflow/src/pipeline/retro.rs b/lib/crates/fabro-workflow/src/pipeline/retro.rs index dc81a591f..5a449cd67 100644 --- a/lib/crates/fabro-workflow/src/pipeline/retro.rs +++ b/lib/crates/fabro-workflow/src/pipeline/retro.rs @@ -211,39 +211,39 @@ mod tests { let inner = test_store().create_run(&test_run_id()).await.unwrap(); let run_store = inner; let run_spec = RunSpec { - run_id: test_run_id(), - settings: WorkflowSettings::default(), - graph: Graph::new("test"), - workflow_slug: None, - source_directory: Some(run_dir.to_string_lossy().to_string()), - repo_origin_url: None, - base_branch: None, - labels: std::collections::HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: test_run_id(), + settings: WorkflowSettings::default(), + graph: Graph::new("test"), + workflow_slug: None, + source_directory: Some(run_dir.to_string_lossy().to_string()), + repo_origin_url: None, + base_branch: None, + labels: std::collections::HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }; append_event(&run_store, &test_run_id(), &Event::RunCreated { - run_id: test_run_id(), - settings: serde_json::to_value(&run_spec.settings).unwrap(), - graph: serde_json::to_value(&run_spec.graph).unwrap(), - workflow_source: None, - workflow_config: None, - labels: run_spec.labels.clone().into_iter().collect(), - run_dir: run_dir.to_string_lossy().to_string(), - source_directory: run_spec.source_directory.clone(), - repo_origin_url: run_spec.repo_origin_url.clone(), - base_branch: None, - workflow_slug: None, - db_prefix: None, - provenance: run_spec.provenance.clone(), - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: test_run_id(), + settings: serde_json::to_value(&run_spec.settings).unwrap(), + graph: serde_json::to_value(&run_spec.graph).unwrap(), + workflow_source: None, + workflow_config: None, + labels: run_spec.labels.clone().into_iter().collect(), + run_dir: run_dir.to_string_lossy().to_string(), + source_directory: run_spec.source_directory.clone(), + repo_origin_url: run_spec.repo_origin_url.clone(), + base_branch: None, + workflow_slug: None, + db_prefix: None, + provenance: run_spec.provenance.clone(), + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }) .await .unwrap(); diff --git a/lib/crates/fabro-workflow/src/run_dump.rs b/lib/crates/fabro-workflow/src/run_dump.rs index 7b20e8581..898768240 100644 --- a/lib/crates/fabro-workflow/src/run_dump.rs +++ b/lib/crates/fabro-workflow/src/run_dump.rs @@ -423,20 +423,20 @@ mod tests { fn sample_run_spec() -> RunSpec { RunSpec { - run_id: fixtures::RUN_1, - settings: WorkflowSettings::default(), - graph: Graph::new("ship"), - workflow_slug: Some("demo".to_string()), - source_directory: Some("/tmp/project".to_string()), - repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), - base_branch: Some("main".to_string()), - labels: HashMap::from([("team".to_string(), "platform".to_string())]), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: WorkflowSettings::default(), + graph: Graph::new("ship"), + workflow_slug: Some("demo".to_string()), + source_directory: Some("/tmp/project".to_string()), + repo_origin_url: Some("https://github.com/fabro-sh/fabro.git".to_string()), + base_branch: Some("main".to_string()), + labels: HashMap::from([("team".to_string(), "platform".to_string())]), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, } } diff --git a/lib/crates/fabro-workflow/src/run_lookup.rs b/lib/crates/fabro-workflow/src/run_lookup.rs index cc6dc48a9..716561b8a 100644 --- a/lib/crates/fabro-workflow/src/run_lookup.rs +++ b/lib/crates/fabro-workflow/src/run_lookup.rs @@ -434,20 +434,20 @@ mod tests { fn sample_run_spec() -> RunSpec { RunSpec { - run_id: fixtures::RUN_1, - settings: WorkflowSettings::default(), - graph: Graph::new("test"), - workflow_slug: Some("test".to_string()), - source_directory: Some("/tmp/project".to_string()), - repo_origin_url: None, - base_branch: Some("main".to_string()), - labels: HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: WorkflowSettings::default(), + graph: Graph::new("test"), + workflow_slug: Some("test".to_string()), + source_directory: Some("/tmp/project".to_string()), + repo_origin_url: None, + base_branch: Some("main".to_string()), + labels: HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, } } @@ -461,23 +461,23 @@ mod tests { let run_spec = sample_run_spec(); let run_store = store.create_run(&fixtures::RUN_1).await.unwrap(); append_event(&run_store, &fixtures::RUN_1, &Event::RunCreated { - run_id: fixtures::RUN_1, - settings: serde_json::to_value(&run_spec.settings).unwrap(), - graph: serde_json::to_value(&run_spec.graph).unwrap(), - workflow_source: None, - workflow_config: None, - labels: run_spec.labels.clone().into_iter().collect(), - run_dir: run_dir.display().to_string(), - source_directory: run_spec.source_directory.clone(), - repo_origin_url: run_spec.repo_origin_url.clone(), - base_branch: run_spec.base_branch.clone(), - workflow_slug: run_spec.workflow_slug.clone(), - db_prefix: None, - provenance: run_spec.provenance.clone(), - manifest_blob: None, - pre_run_git: run_spec.pre_run_git.clone(), - fork_source_ref: run_spec.fork_source_ref.clone(), - checkpoints_disabled: run_spec.checkpoints_disabled, + run_id: fixtures::RUN_1, + settings: serde_json::to_value(&run_spec.settings).unwrap(), + graph: serde_json::to_value(&run_spec.graph).unwrap(), + workflow_source: None, + workflow_config: None, + labels: run_spec.labels.clone().into_iter().collect(), + run_dir: run_dir.display().to_string(), + source_directory: run_spec.source_directory.clone(), + repo_origin_url: run_spec.repo_origin_url.clone(), + base_branch: run_spec.base_branch.clone(), + workflow_slug: run_spec.workflow_slug.clone(), + db_prefix: None, + provenance: run_spec.provenance.clone(), + manifest_blob: None, + pre_run_git: run_spec.pre_run_git.clone(), + fork_source_ref: run_spec.fork_source_ref.clone(), + in_place: run_spec.in_place, }) .await .unwrap(); diff --git a/lib/crates/fabro-workflow/src/runtime_store.rs b/lib/crates/fabro-workflow/src/runtime_store.rs index f8aba75f6..b7323c806 100644 --- a/lib/crates/fabro-workflow/src/runtime_store.rs +++ b/lib/crates/fabro-workflow/src/runtime_store.rs @@ -130,20 +130,20 @@ mod tests { fn test_run_spec() -> RunSpec { RunSpec { - run_id: fixtures::RUN_1, - settings: WorkflowSettings::default(), - graph: Graph::new("test"), - workflow_slug: Some("test".to_string()), - source_directory: Some("/tmp/test".to_string()), - repo_origin_url: None, - base_branch: None, - labels: HashMap::new(), - provenance: None, - manifest_blob: None, - definition_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: WorkflowSettings::default(), + graph: Graph::new("test"), + workflow_slug: Some("test".to_string()), + source_directory: Some("/tmp/test".to_string()), + repo_origin_url: None, + base_branch: None, + labels: HashMap::new(), + provenance: None, + manifest_blob: None, + definition_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, } } @@ -152,23 +152,23 @@ mod tests { let run_store = test_run_store().await; let record = test_run_spec(); append_event(&run_store, &fixtures::RUN_1, &Event::RunCreated { - run_id: fixtures::RUN_1, - settings: serde_json::to_value(&record.settings).unwrap(), - graph: serde_json::to_value(&record.graph).unwrap(), - workflow_source: Some("digraph test {}".to_string()), - workflow_config: None, - labels: std::collections::BTreeMap::new(), - run_dir: "/tmp/test".to_string(), - source_directory: Some("/tmp/test".to_string()), - repo_origin_url: None, - base_branch: None, - workflow_slug: Some("test".to_string()), - db_prefix: None, - provenance: None, - manifest_blob: None, - pre_run_git: None, - fork_source_ref: None, - checkpoints_disabled: false, + run_id: fixtures::RUN_1, + settings: serde_json::to_value(&record.settings).unwrap(), + graph: serde_json::to_value(&record.graph).unwrap(), + workflow_source: Some("digraph test {}".to_string()), + workflow_config: None, + labels: std::collections::BTreeMap::new(), + run_dir: "/tmp/test".to_string(), + source_directory: Some("/tmp/test".to_string()), + repo_origin_url: None, + base_branch: None, + workflow_slug: Some("test".to_string()), + db_prefix: None, + provenance: None, + manifest_blob: None, + pre_run_git: None, + fork_source_ref: None, + in_place: false, }) .await .unwrap(); diff --git a/lib/crates/fabro-workflow/src/sandbox_git.rs b/lib/crates/fabro-workflow/src/sandbox_git.rs index cb18ab31e..31497028f 100644 --- a/lib/crates/fabro-workflow/src/sandbox_git.rs +++ b/lib/crates/fabro-workflow/src/sandbox_git.rs @@ -1194,7 +1194,7 @@ mod tests { definition_blob: None, pre_run_git: None, fork_source_ref: None, - checkpoints_disabled: false, + in_place: false, }); let mut dump = crate::run_dump::RunDump::from_projection(&projection); dump.add_file_bytes("binary/payload.bin", vec![0, 159, 146, 150]); diff --git a/lib/crates/fabro-workflow/src/test_support.rs b/lib/crates/fabro-workflow/src/test_support.rs index 0a3747a49..3480925cc 100644 --- a/lib/crates/fabro-workflow/src/test_support.rs +++ b/lib/crates/fabro-workflow/src/test_support.rs @@ -107,28 +107,28 @@ async fn initialized( .expect("failed to create slate-backed test run store"); let run_store = inner_store; append_event(&run_store, &run_options.run_id, &Event::RunCreated { - run_id: run_options.run_id, - settings: serde_json::to_value(&run_options.settings) + run_id: run_options.run_id, + settings: serde_json::to_value(&run_options.settings) .expect("failed to serialize settings"), - graph: serde_json::to_value(graph).expect("failed to serialize graph"), - workflow_source: None, - workflow_config: None, - labels: run_options + graph: serde_json::to_value(graph).expect("failed to serialize graph"), + workflow_source: None, + workflow_config: None, + labels: run_options .labels .clone() .into_iter() .collect::>(), - run_dir: run_options.run_dir.display().to_string(), - source_directory: Some(sandbox.working_directory().to_string()), - repo_origin_url: None, - base_branch: run_options.base_branch.clone(), - workflow_slug: run_options.workflow_slug.clone(), - db_prefix: None, - provenance: None, - manifest_blob: None, - pre_run_git: run_options.pre_run_git.clone(), - fork_source_ref: run_options.fork_source_ref.clone(), - checkpoints_disabled: false, + run_dir: run_options.run_dir.display().to_string(), + source_directory: Some(sandbox.working_directory().to_string()), + repo_origin_url: None, + base_branch: run_options.base_branch.clone(), + workflow_slug: run_options.workflow_slug.clone(), + db_prefix: None, + provenance: None, + manifest_blob: None, + pre_run_git: run_options.pre_run_git.clone(), + fork_source_ref: run_options.fork_source_ref.clone(), + in_place: false, }) .await .expect("failed to seed run.created event in run store"); diff --git a/lib/packages/fabro-api-client/src/models/run-list-item.ts b/lib/packages/fabro-api-client/src/models/run-list-item.ts index 8a551d798..0e96fd889 100644 --- a/lib/packages/fabro-api-client/src/models/run-list-item.ts +++ b/lib/packages/fabro-api-client/src/models/run-list-item.ts @@ -54,7 +54,7 @@ export interface RunListItem { 'status': RunStatus; 'labels': { [key: string]: string; }; 'source_directory'?: string | null; - 'checkpoints_disabled'?: boolean; + 'in_place'?: boolean; 'repo_origin_url'?: string | null; 'start_time'?: string | null; 'pending_control'?: RunControlAction | null; diff --git a/lib/packages/fabro-api-client/src/models/run-spec.ts b/lib/packages/fabro-api-client/src/models/run-spec.ts index 7470a7817..fa548a6f0 100644 --- a/lib/packages/fabro-api-client/src/models/run-spec.ts +++ b/lib/packages/fabro-api-client/src/models/run-spec.ts @@ -40,6 +40,6 @@ export interface RunSpec { 'definition_blob'?: string | null; 'pre_run_git'?: PreRunGitContext | null; 'fork_source_ref'?: ForkSourceRef | null; - 'checkpoints_disabled': boolean; + 'in_place': boolean; } diff --git a/lib/packages/fabro-api-client/src/models/run-summary.ts b/lib/packages/fabro-api-client/src/models/run-summary.ts index 5b33c5a51..6430a9e5c 100644 --- a/lib/packages/fabro-api-client/src/models/run-summary.ts +++ b/lib/packages/fabro-api-client/src/models/run-summary.ts @@ -34,7 +34,7 @@ export interface RunSummary { 'title': string; 'labels': { [key: string]: string; }; 'source_directory'?: string | null; - 'checkpoints_disabled'?: boolean; + 'in_place'?: boolean; 'repo_origin_url'?: string | null; 'repository': RepositoryReference; 'start_time'?: string | null;