mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-07 03:00:29 +00:00
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.
This commit is contained in:
parent
928b2f585b
commit
20e161bc07
34 changed files with 491 additions and 494 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ mod tests {
|
|||
definition_blob: None,
|
||||
pre_run_git: None,
|
||||
fork_source_ref: None,
|
||||
checkpoints_disabled: false,
|
||||
in_place: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<String>,
|
||||
pub workflow_slug: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub source_directory: Option<String>,
|
||||
pub source_directory: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub repo_origin_url: Option<String>,
|
||||
pub repo_origin_url: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub base_branch: Option<String>,
|
||||
pub base_branch: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||
pub labels: HashMap<String, String>,
|
||||
pub labels: HashMap<String, String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub provenance: Option<RunProvenance>,
|
||||
pub provenance: Option<RunProvenance>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub manifest_blob: Option<RunBlobId>,
|
||||
pub manifest_blob: Option<RunBlobId>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub definition_blob: Option<RunBlobId>,
|
||||
pub definition_blob: Option<RunBlobId>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pre_run_git: Option<PreRunGitContext>,
|
||||
pub pre_run_git: Option<PreRunGitContext>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub fork_source_ref: Option<ForkSourceRef>,
|
||||
pub fork_source_ref: Option<ForkSourceRef>,
|
||||
#[serde(default)]
|
||||
pub checkpoints_disabled: bool,
|
||||
pub in_place: bool,
|
||||
}
|
||||
|
||||
impl RunSpec {
|
||||
|
|
|
|||
|
|
@ -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<String>,
|
||||
pub workflow_source: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workflow_config: Option<String>,
|
||||
pub workflow_config: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
|
||||
pub labels: BTreeMap<String, String>,
|
||||
pub run_dir: String,
|
||||
pub labels: BTreeMap<String, String>,
|
||||
pub run_dir: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub source_directory: Option<String>,
|
||||
pub source_directory: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub repo_origin_url: Option<String>,
|
||||
pub repo_origin_url: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub base_branch: Option<String>,
|
||||
pub base_branch: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub workflow_slug: Option<String>,
|
||||
pub workflow_slug: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub db_prefix: Option<String>,
|
||||
pub db_prefix: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub provenance: Option<RunProvenance>,
|
||||
pub provenance: Option<RunProvenance>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub manifest_blob: Option<RunBlobId>,
|
||||
pub manifest_blob: Option<RunBlobId>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub pre_run_git: Option<PreRunGitContext>,
|
||||
pub pre_run_git: Option<PreRunGitContext>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub fork_source_ref: Option<ForkSourceRef>,
|
||||
pub fork_source_ref: Option<ForkSourceRef>,
|
||||
#[serde(default)]
|
||||
pub checkpoints_disabled: bool,
|
||||
pub in_place: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
|
|
|
|||
|
|
@ -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<String>,
|
||||
pub workflow_name: Option<String>,
|
||||
#[serde(default)]
|
||||
pub workflow_slug: Option<String>,
|
||||
pub goal: String,
|
||||
pub title: String,
|
||||
pub labels: HashMap<String, String>,
|
||||
pub workflow_slug: Option<String>,
|
||||
pub goal: String,
|
||||
pub title: String,
|
||||
pub labels: HashMap<String, String>,
|
||||
#[serde(default)]
|
||||
pub source_directory: Option<String>,
|
||||
pub source_directory: Option<String>,
|
||||
#[serde(default)]
|
||||
pub checkpoints_disabled: bool,
|
||||
pub in_place: bool,
|
||||
#[serde(default)]
|
||||
pub repo_origin_url: Option<String>,
|
||||
pub repository: RepositoryReference,
|
||||
pub repo_origin_url: Option<String>,
|
||||
pub repository: RepositoryReference,
|
||||
#[serde(default)]
|
||||
pub start_time: Option<DateTime<Utc>>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub status: RunStatus,
|
||||
pub start_time: Option<DateTime<Utc>>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub status: RunStatus,
|
||||
#[serde(default)]
|
||||
pub pending_control: Option<RunControlAction>,
|
||||
pub pending_control: Option<RunControlAction>,
|
||||
#[serde(default)]
|
||||
pub duration_ms: Option<u64>,
|
||||
pub duration_ms: Option<u64>,
|
||||
#[serde(default)]
|
||||
pub elapsed_secs: Option<f64>,
|
||||
pub elapsed_secs: Option<f64>,
|
||||
#[serde(default)]
|
||||
pub total_usd_micros: Option<i64>,
|
||||
pub total_usd_micros: Option<i64>,
|
||||
#[serde(default)]
|
||||
pub superseded_by: Option<RunId>,
|
||||
pub superseded_by: Option<RunId>,
|
||||
}
|
||||
|
||||
impl RunSummary {
|
||||
|
|
@ -51,7 +51,7 @@ impl RunSummary {
|
|||
goal: String,
|
||||
labels: HashMap<String, String>,
|
||||
source_directory: Option<String>,
|
||||
checkpoints_disabled: bool,
|
||||
in_place: bool,
|
||||
repo_origin_url: Option<String>,
|
||||
start_time: Option<DateTime<Utc>>,
|
||||
status: RunStatus,
|
||||
|
|
@ -75,7 +75,7 @@ impl RunSummary {
|
|||
title,
|
||||
labels,
|
||||
source_directory,
|
||||
checkpoints_disabled,
|
||||
in_place,
|
||||
repo_origin_url,
|
||||
repository,
|
||||
start_time,
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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<String>,
|
||||
workflow_source: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
workflow_config: Option<String>,
|
||||
labels: BTreeMap<String, String>,
|
||||
run_dir: String,
|
||||
workflow_config: Option<String>,
|
||||
labels: BTreeMap<String, String>,
|
||||
run_dir: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
source_directory: Option<String>,
|
||||
source_directory: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
repo_origin_url: Option<String>,
|
||||
repo_origin_url: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
base_branch: Option<String>,
|
||||
base_branch: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
workflow_slug: Option<String>,
|
||||
workflow_slug: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
db_prefix: Option<String>,
|
||||
db_prefix: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
provenance: Option<RunProvenance>,
|
||||
provenance: Option<RunProvenance>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
manifest_blob: Option<RunBlobId>,
|
||||
manifest_blob: Option<RunBlobId>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pre_run_git: Option<PreRunGitContext>,
|
||||
pre_run_git: Option<PreRunGitContext>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
fork_source_ref: Option<ForkSourceRef>,
|
||||
fork_source_ref: Option<ForkSourceRef>,
|
||||
#[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);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ pub struct CreateRunInput {
|
|||
pub base_branch: Option<String>,
|
||||
pub pre_run_git: Option<PreRunGitContext>,
|
||||
pub fork_source_ref: Option<ForkSourceRef>,
|
||||
pub checkpoints_disabled: bool,
|
||||
pub in_place: bool,
|
||||
pub provenance: Option<RunProvenance>,
|
||||
pub configured_providers: Vec<Provider>,
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ struct PersistCreateOptions {
|
|||
repo_origin_url: Option<String>,
|
||||
pre_run_git: Option<PreRunGitContext>,
|
||||
fork_source_ref: Option<ForkSourceRef>,
|
||||
checkpoints_disabled: bool,
|
||||
in_place: bool,
|
||||
provenance: Option<RunProvenance>,
|
||||
configured_providers: Vec<Provider>,
|
||||
}
|
||||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -873,7 +873,7 @@ mod tests {
|
|||
definition_blob: None,
|
||||
pre_run_git: None,
|
||||
fork_source_ref: None,
|
||||
checkpoints_disabled: false,
|
||||
in_place: false,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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::<BTreeMap<_, _>>(),
|
||||
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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue