Skip to content

Commit

Permalink
refactor: added enums. Removed placeholder code for cross tab. Remove… (
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybeeelsdon authored Oct 9, 2023
1 parent f6e49c8 commit bb8f82e
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 9 deletions.
88 changes: 85 additions & 3 deletions src/BL/Models/Enums/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,91 @@ public enum StatusType
Running = 26,
[Display(Name = "Failed")]
Failed = 27,
//Remove these later
SendingFileToHUTCH = 28,
SendingToHUTCHForFinalPackaging = 29
//Remove these later
SendingFileToHUTCH = 28,
SendingToHUTCHForFinalPackaging = 29,

//Internal Hutch Statuses
/// <summary>
/// Waiting for a Crate payload or Crate URL to be submitted to Hutch.
/// </summary>
[Display(Name = "Waiting for a Crate")]
WaitingForCrate = 30,

/// <summary>
/// A Crate has been submitted via URL; Hutch is fetching it.
/// </summary>
[Display(Name = "Fetching Crate")]
FetchingCrate = 31,

/// <summary>
/// Hutch has queued the Crate to be executed.
/// </summary>
[Display(Name = "Create queued")]
Queued = 32,

/// <summary>
/// Hutch is validating the Job Crate metadata prior to execution.
/// </summary>
[Display(Name = "Validating Crate")]
ValidatingCrate = 33,

/// <summary>
/// Hutch is fetching the remote workflow referenced by the crate.
/// </summary>
[Display(Name = "Fetching workflow")]
FetchingWorkflow=34,

/// <summary>
/// Hutch is preparing the workflow for the Workflow Executor (e.g. WfExS)
/// using a combination of the Job Crate, the Workflow Crate and Executor configuration.
/// </summary>
[Display(Name = "Preparing workflow")]
StagingWorkflow=35,

/// <summary>
/// Hutch has triggered the Workflow Executor to run the Worflow.
/// </summary>
[Display(Name = "Executing workflow")]
ExecutingWorkflow = 36,

/// <summary>
/// Following successful Workflow Execution, Hutch is preparing outputs
/// for an Egress request (e.g. disclosure checks etc.)
/// </summary>
[Display(Name = "Preparing outputs")]
PreparingOutputs = 37,

/// <summary>
/// Hutch has requested Egress and/or is providing outputs for Egress checking
/// </summary>
[Display(Name = "Requested Egress")]
DataOutRequested=38,

/// <summary>
/// Hutch has provided outputs for Egress and is awaiting the results of checks
/// </summary>
[Display(Name = "Waiting for Egress results")]
TransferredForDataOut = 39,

/// <summary>
/// Egress checks have approved some or all outputs; Hutch is finalising the approved results RO-Crate package.
/// </summary>
[Display(Name = "Finalising approved results")]
PackagingApprovedResults=40,

/// <summary>
/// Hutch has transferred the results RO-Crate package to the Intermediary Store.
/// </summary>
[Display(Name = "Completed")]
Complete=41,

/// <summary>
/// Hutch was unable to get the job to a complete status; it failed during the previous status stage.
/// </summary>
[Display(Name = "Failed")]
Failure = 42

}

public enum Decision
Expand Down
17 changes: 16 additions & 1 deletion src/DARE-API/Controllers/SubmissionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
using Microsoft.AspNetCore.SignalR;
using System.Reflection;
using System.ComponentModel.DataAnnotations;
using System.Numerics;
using System.Xml.Linq;

namespace DARE_API.Controllers
{
Expand Down Expand Up @@ -199,7 +201,20 @@ public List<StageInfo> StageTypes()
StatusType.CancellationRequestSent,
StatusType.CancellingChildren,
//StatusType.Cancelled,
StatusType.PodProcessingFailed
StatusType.PodProcessingFailed,
StatusType.WaitingForCrate,
StatusType.FetchingCrate,
StatusType.Queued,
StatusType.ValidatingCrate,
StatusType.FetchingWorkflow,
StatusType.StagingWorkflow,
StatusType.ExecutingWorkflow,
StatusType.PreparingOutputs,
StatusType.DataOutRequested,
StatusType.TransferredForDataOut,
StatusType.PackagingApprovedResults,
StatusType.Complete,
StatusType.Failure

};
Dictionary<int, List<StatusType>> stage3Dict = new Dictionary<int, List<StatusType>>();
Expand Down
5 changes: 3 additions & 2 deletions src/DARE-FrontEnd/Views/Submission/GetASubmission.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@
</div>
</div>
</div>
<div class="row">
@* <div class="row">
<div class="col-12">
<div class="card-header bg-white shadow-sm border-1 p-4 mt-4">
<h5 class="mb-0">Event Log</h5>
Expand Down Expand Up @@ -1344,7 +1344,8 @@
</div>
</div>
</div>
</div>
</div>*@
</div>
<script>
Expand Down
6 changes: 3 additions & 3 deletions src/TRE-API/DoAgentWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ public void Execute()
{
Log.Information("Submission: {submission}", aSubmission);

//TODO: Put user approval check


// Check user is allowed ont he project
if (false && ! _subHelper.IsUserApprovedOnProject(aSubmission.Project.Id, aSubmission.SubmittedBy.Id))
if (_subHelper.IsUserApprovedOnProject(aSubmission.Project.Id, aSubmission.SubmittedBy.Id))
{
Log.Error("User {UserID}/project {ProjectId} is not value for this submission {submission}", aSubmission.SubmittedBy.Id, aSubmission.Project.Id, aSubmission);
// record error with submission layer
Expand All @@ -255,7 +255,7 @@ public void Execute()
{


//TODO: Mahadi copy from submission input bucket to tre input bucket

try
{
Uri uri = new Uri(aSubmission.DockerInputLocation);
Expand Down

0 comments on commit bb8f82e

Please sign in to comment.