From 1e892b09b46de9908ddbdc895031895101313a26 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Wed, 28 Oct 2026 21:40:13 +1000 Subject: refactor: initial artifact cleanup and implementation --- src/marlin.core/models/plan/ExecutionPlan.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/marlin.core/models/plan/ExecutionPlan.cs') diff --git a/src/marlin.core/models/plan/ExecutionPlan.cs b/src/marlin.core/models/plan/ExecutionPlan.cs index 24c40e4..fa84634 100644 --- a/src/marlin.core/models/plan/ExecutionPlan.cs +++ b/src/marlin.core/models/plan/ExecutionPlan.cs @@ -1,20 +1,19 @@ namespace marlin.core.models.plan; +using System.Collections.ObjectModel; using meta; using util; public class ExecutionPlan { - public IEnumerable Components => [..this._commands, ..this._deferredArtifactHandler, ..this._deferredCleanup]; + public IEnumerable Components => [..this._commands, ..this._deferredCleanup]; private readonly List _commands; - private readonly List _deferredArtifactHandler; private readonly List _deferredCleanup; public ExecutionPlan() { this._commands = new(); - this._deferredArtifactHandler = new(); this._deferredCleanup = new(); } @@ -31,10 +30,6 @@ public class ExecutionPlan this._deferredCleanup.Add(command); break; - case CommandRole.ArtifactHandler: - this._deferredArtifactHandler.Add(command); - break; - default: throw new InvalidOperationException($"Cannot defer {command.Role}"); } @@ -117,6 +112,10 @@ public class ExecutionPlan run = VariableExpander.Expand(run, args); + IReadOnlyDictionary artifacts = step is RecipeStep rs + ? rs.Artifacts + : ReadOnlyDictionary.Empty; + ExecutionCommand stepCommand = new ExecutionCommand { Id = step.Id, @@ -124,12 +123,12 @@ public class ExecutionPlan Command = run, Role = step switch { - ArtifactHandlerStep => CommandRole.ArtifactHandler, RecipeStep => CommandRole.Step, CleanupStep => CommandRole.Cleanup, _ => throw new ArgumentOutOfRangeException() }, FailBehavior = fail.Value, + Artifacts = artifacts, Deferred = defer }; -- cgit v1.3.1