< Summary

Information
Class: Elsa.Platform.Integration.Models.PlatformRuntimeCommand
Assembly: Elsa.Platform.Integration
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Platform.Integration/Models/PlatformRuntimeContracts.cs
Line coverage
7%
Covered lines: 2
Uncovered lines: 25
Coverable lines: 27
Total lines: 138
Line coverage: 7.4%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Id()100%210%
get_WorkspaceId()100%210%
get_RunId()100%210%
get_EnvironmentId()100%210%
get_EngineId()100%210%
get_Action()100%210%
get_Status()100%210%
get_Artifact()100%210%
get_Revision()100%210%
get_IdempotencyKey()100%210%
get_WorkerId()100%210%
get_ClaimedAt()100%210%
get_LeaseExpiresAt()100%210%
get_HeartbeatAt()100%210%
get_AttemptNumber()100%210%
get_PercentComplete()100%210%
get_ProgressMessage()100%210%
get_ObservedArtifactDigest()100%210%
get_RuntimeReference()100%210%
get_Diagnostics()100%210%
get_CreatedAt()100%210%
get_UpdatedAt()100%210%
get_AvailableAt()100%210%
get_ExpiresAt()100%210%
get_CompletedAt()100%210%
get_Artifacts()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Platform.Integration/Models/PlatformRuntimeContracts.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace Elsa.Platform.Integration.Models;
 4
 5[JsonConverter(typeof(JsonStringEnumConverter<PlatformRuntimeCommandAction>))]
 6public enum PlatformRuntimeCommandAction
 7{
 8    Unknown,
 9    Deploy,
 10    Rollback,
 11    Validate,
 12    RuntimeControl
 13}
 14
 15[JsonConverter(typeof(JsonStringEnumConverter<PlatformRuntimeCommandStatus>))]
 16public enum PlatformRuntimeCommandStatus
 17{
 18    Unknown,
 19    Pending,
 20    Claimed,
 21    Running,
 22    Completed,
 23    Failed,
 24    Rejected,
 25    Cancelled,
 26    RecoveryRequired,
 27    Expired
 28}
 29
 30[JsonConverter(typeof(JsonStringEnumConverter<PlatformArtifactStatus>))]
 31public enum PlatformArtifactStatus
 32{
 33    Pending,
 34    Downloading,
 35    Validated,
 36    Applying,
 37    Applied,
 38    Failed,
 39    Rejected,
 40    Skipped
 41}
 42
 43[JsonConverter(typeof(JsonStringEnumConverter<PlatformDiagnosticSeverity>))]
 44public enum PlatformDiagnosticSeverity
 45{
 46    Info,
 47    Warning,
 48    Error
 49}
 50
 51public sealed record PlatformRuntimeCommandListResponse(IReadOnlyList<PlatformRuntimeCommand> Commands);
 52
 53public sealed record PlatformRuntimeCommandClaimRequest(Guid EngineId, string WorkerId, int LeaseSeconds);
 54
 55public sealed record PlatformRuntimeCommandClaimResponse(PlatformRuntimeCommand Command, string LeaseToken);
 56
 57public sealed record PlatformRuntimeCommandHeartbeatRequest(string LeaseToken, string WorkerId);
 58
 59public sealed record PlatformRuntimeCommandProgressRequest(string LeaseToken, string Status, int? PercentComplete, strin
 60
 61public sealed record PlatformRuntimeCommandCompleteRequest(
 62    string LeaseToken,
 63    PlatformArtifactDigest? ObservedArtifactDigest,
 64    string? RuntimeReference,
 65    IReadOnlyList<PlatformDiagnostic> Diagnostics,
 66    IReadOnlyList<PlatformArtifactOutcome>? Artifacts = null);
 67
 68public sealed record PlatformRuntimeCommandFailRequest(
 69    string LeaseToken,
 70    IReadOnlyList<PlatformDiagnostic> Diagnostics,
 71    IReadOnlyList<PlatformArtifactOutcome>? Artifacts = null);
 72
 73public sealed record PlatformRuntimeCommandRejectRequest(
 74    string LeaseToken,
 75    IReadOnlyList<PlatformDiagnostic> Diagnostics,
 76    IReadOnlyList<PlatformArtifactOutcome>? Artifacts = null);
 77
 278public sealed record PlatformRuntimeCommand(
 079    Guid Id,
 080    Guid WorkspaceId,
 081    Guid RunId,
 082    Guid EnvironmentId,
 083    Guid EngineId,
 084    PlatformRuntimeCommandAction Action,
 085    PlatformRuntimeCommandStatus Status,
 086    PlatformRuntimeCommandArtifactReference? Artifact,
 087    PlatformRuntimeCommandRevisionReference? Revision,
 088    string IdempotencyKey,
 089    string? WorkerId,
 090    DateTimeOffset? ClaimedAt,
 091    DateTimeOffset? LeaseExpiresAt,
 092    DateTimeOffset? HeartbeatAt,
 093    int AttemptNumber,
 094    int? PercentComplete,
 095    string? ProgressMessage,
 096    PlatformArtifactDigest? ObservedArtifactDigest,
 097    string? RuntimeReference,
 098    IReadOnlyList<PlatformDiagnostic> Diagnostics,
 099    DateTimeOffset CreatedAt,
 0100    DateTimeOffset UpdatedAt,
 0101    DateTimeOffset? AvailableAt,
 0102    DateTimeOffset? ExpiresAt,
 0103    DateTimeOffset? CompletedAt,
 2104    IReadOnlyList<PlatformArtifactItem>? Artifacts = null);
 105
 106public sealed record PlatformRuntimeCommandArtifactReference(
 107    Guid? ArtifactRecordId,
 108    string? ArtifactId,
 109    string? ArtifactTypeId,
 110    PlatformArtifactDigest? ContentDigest);
 111
 112public sealed record PlatformRuntimeCommandRevisionReference(Guid? RevisionId);
 113
 114public sealed record PlatformArtifactItem(
 115    Guid ArtifactRecordId,
 116    string ArtifactId,
 117    string ArtifactTypeId,
 118    string? ArtifactSchemaVersion,
 119    PlatformArtifactDigest ContentDigest,
 120    string DisplayName,
 121    string? DownloadUrl,
 122    PlatformArtifactStatus Status,
 123    PlatformArtifactDigest? ObservedDigest,
 124    string? RuntimeReference,
 125    IReadOnlyList<PlatformDiagnostic>? Diagnostics);
 126
 127public sealed record PlatformArtifactOutcome(
 128    Guid ArtifactRecordId,
 129    PlatformArtifactStatus Status,
 130    PlatformArtifactDigest? ObservedDigest = null,
 131    string? RuntimeReference = null,
 132    IReadOnlyList<PlatformDiagnostic>? Diagnostics = null);
 133
 134public sealed record PlatformArtifactDigest(string Algorithm, string Value);
 135
 136public sealed record PlatformDiagnostic(string Code, PlatformDiagnosticSeverity Severity, string Message);
 137
 138public sealed record PlatformProblemDetails(string? Title, string? Detail);