feat: Enhance Task Runner with simulation and failure policy support
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
- Added tests for output projection and failure policy population in TaskPackPlanner. - Introduced new failure policy manifest in TestManifests. - Implemented simulation endpoints in the web service for task execution. - Created TaskRunnerServiceOptions for configuration management. - Updated appsettings.json to include TaskRunner configuration. - Enhanced PackRunWorkerService to handle execution graphs and state management. - Added support for parallel execution and conditional steps in the worker service. - Updated documentation to reflect new features and changes in execution flow.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace StellaOps.Cli.Services.Models;
|
||||
|
||||
internal sealed record TaskRunnerSimulationRequest(string Manifest, JsonObject? Inputs);
|
||||
|
||||
internal sealed record TaskRunnerSimulationResult(
|
||||
string PlanHash,
|
||||
TaskRunnerSimulationFailurePolicy FailurePolicy,
|
||||
IReadOnlyList<TaskRunnerSimulationStep> Steps,
|
||||
IReadOnlyList<TaskRunnerSimulationOutput> Outputs,
|
||||
bool HasPendingApprovals);
|
||||
|
||||
internal sealed record TaskRunnerSimulationFailurePolicy(int MaxAttempts, int BackoffSeconds, bool ContinueOnError);
|
||||
|
||||
internal sealed record TaskRunnerSimulationStep(
|
||||
string Id,
|
||||
string TemplateId,
|
||||
string Kind,
|
||||
bool Enabled,
|
||||
string Status,
|
||||
string? StatusReason,
|
||||
string? Uses,
|
||||
string? ApprovalId,
|
||||
string? GateMessage,
|
||||
int? MaxParallel,
|
||||
bool ContinueOnError,
|
||||
IReadOnlyList<TaskRunnerSimulationStep> Children);
|
||||
|
||||
internal sealed record TaskRunnerSimulationOutput(
|
||||
string Name,
|
||||
string Type,
|
||||
bool RequiresRuntimeValue,
|
||||
string? PathExpression,
|
||||
string? ValueExpression);
|
||||
@@ -0,0 +1,73 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace StellaOps.Cli.Services.Models.Transport;
|
||||
|
||||
internal sealed class TaskRunnerSimulationRequestDocument
|
||||
{
|
||||
public string Manifest { get; set; } = string.Empty;
|
||||
|
||||
public JsonObject? Inputs { get; set; }
|
||||
}
|
||||
|
||||
internal sealed class TaskRunnerSimulationResponseDocument
|
||||
{
|
||||
public string PlanHash { get; set; } = string.Empty;
|
||||
|
||||
public TaskRunnerSimulationFailurePolicyDocument? FailurePolicy { get; set; }
|
||||
|
||||
public List<TaskRunnerSimulationStepDocument>? Steps { get; set; }
|
||||
|
||||
public List<TaskRunnerSimulationOutputDocument>? Outputs { get; set; }
|
||||
|
||||
public bool HasPendingApprovals { get; set; }
|
||||
}
|
||||
|
||||
internal sealed class TaskRunnerSimulationFailurePolicyDocument
|
||||
{
|
||||
public int MaxAttempts { get; set; }
|
||||
|
||||
public int BackoffSeconds { get; set; }
|
||||
|
||||
public bool ContinueOnError { get; set; }
|
||||
}
|
||||
|
||||
internal sealed class TaskRunnerSimulationStepDocument
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
public string TemplateId { get; set; } = string.Empty;
|
||||
|
||||
public string Kind { get; set; } = string.Empty;
|
||||
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
||||
public string? StatusReason { get; set; }
|
||||
|
||||
public string? Uses { get; set; }
|
||||
|
||||
public string? ApprovalId { get; set; }
|
||||
|
||||
public string? GateMessage { get; set; }
|
||||
|
||||
public int? MaxParallel { get; set; }
|
||||
|
||||
public bool ContinueOnError { get; set; }
|
||||
|
||||
public List<TaskRunnerSimulationStepDocument>? Children { get; set; }
|
||||
}
|
||||
|
||||
internal sealed class TaskRunnerSimulationOutputDocument
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
public bool RequiresRuntimeValue { get; set; }
|
||||
|
||||
public string? PathExpression { get; set; }
|
||||
|
||||
public string? ValueExpression { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user