diff options
Diffstat (limited to 'src/SomhairlesDream.Modeling/Pipeline.fs')
| -rw-r--r-- | src/SomhairlesDream.Modeling/Pipeline.fs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/SomhairlesDream.Modeling/Pipeline.fs b/src/SomhairlesDream.Modeling/Pipeline.fs index 3f1f105..d9db5f6 100644 --- a/src/SomhairlesDream.Modeling/Pipeline.fs +++ b/src/SomhairlesDream.Modeling/Pipeline.fs @@ -33,6 +33,7 @@ type IArtifactBridge = type PipelineOptions = { ArtifactRoot: string Ids: RunIds + Steps: DesignStep array Render: bool Bridge: IArtifactBridge Clock: unit -> DateTimeOffset @@ -214,10 +215,12 @@ module Pipeline = let emit event = appendEvent log options.OnEvent event let ids = options.Ids - emit (RunEvent.Start { Ids = ids; At = startedAt; TotalSteps = Design.steps.Length }) + let steps = options.Steps + + emit (RunEvent.Start { Ids = ids; At = startedAt; TotalSteps = steps.Length }) let artifacts = - [| for step in Design.steps do + [| for step in steps do currentStep <- Some step.StepId emit (RunEvent.Heartbeat { Ids = ids; At = options.Clock(); Message = $"starting {step.StepId}" }) @@ -275,7 +278,7 @@ module Pipeline = At = options.Clock() StepId = step.StepId StepIndex = step.Index - TotalSteps = Design.steps.Length + TotalSteps = steps.Length Message = "artifact verified" ArtifactPath = relativePath } @@ -424,12 +427,12 @@ module ArtifactVerifier = || Ids.validateResourceId manifest.BaseId |> Result.isError || Ids.validateResourceId manifest.TargetId |> Result.isError then Error "manifest contains an invalid resource id" - elif manifest.Steps.Length <> Design.steps.Length then + elif manifest.Steps.Length <> (Design.forProject manifest.ProjectId).Length then Error "manifest step count does not match design" else let mutable failure: string option = None - for expected, actual in Array.zip Design.steps manifest.Steps do + for expected, actual in Array.zip (Design.forProject manifest.ProjectId) manifest.Steps do if failure.IsNone && actual.StepId <> expected.StepId then failure <- Some $"manifest step id mismatch: {expected.StepId}" elif failure.IsNone && actual.StepIndex <> expected.Index then |
