Skip to content
6 changes: 3 additions & 3 deletions src/Shared/Configuration/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
},
"System.IO.Abstractions": {
"type": "Direct",
"requested": "[17.2.1, )",
"resolved": "17.2.1",
"contentHash": "QiPMiZa6SP9FxvM4k2Tso4j7DHbdpZo5dcGnVD38XjXnm2fOsYg4BkHmADTa5Tq7Fc0OzUGvHhV5KePPCwxB8Q=="
"requested": "[17.2.3, )",
"resolved": "17.2.3",
"contentHash": "VcozGeE4SxIo0cnXrDHhbrh/Gb8KQnZ3BvMelvh+iw0PrIKtuuA46U2Xm4e4pgnaWFgT4RdZfTpWl/WPRdw0WQ=="
},
"Ardalis.GuardClauses": {
"type": "Transitive",
Expand Down
620 changes: 310 additions & 310 deletions src/TaskManager/Database/packages.lock.json

Large diffs are not rendered by default.

1,152 changes: 576 additions & 576 deletions src/TaskManager/Plug-ins/Argo/packages.lock.json

Large diffs are not rendered by default.

2,944 changes: 1,472 additions & 1,472 deletions src/TaskManager/TaskManager/packages.lock.json

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions src/WorkflowManager/Storage/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,19 +785,20 @@
"monai.deploy.workflowmanager.contracts": {
"type": "Project",
"dependencies": {
"AWSSDK.SecurityToken": "3.7.1.193",
"Microsoft.Extensions.Configuration": "6.0.1",
"Monai.Deploy.Messaging": "0.1.6-rc0001",
"MongoDB.Bson": "2.17.1",
"Newtonsoft.Json": "13.0.1"
"AWSSDK.SecurityToken": "[3.7.1.203, )",
"Microsoft.Extensions.Configuration": "[6.0.1, )",
"Monai.Deploy.Messaging": "[0.1.6-rc0001, )",
"MongoDB.Bson": "[2.17.1, )",
"Newtonsoft.Json": "[13.0.1, )"
}
},
"monai.deploy.workflowmanager.logging": {
"type": "Project",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Core": "2.2.5",
"Microsoft.Extensions.Logging.Abstractions": "6.0.1",
"Monai.Deploy.WorkflowManager.Contracts": "1.0.0"
"Microsoft.AspNetCore.Mvc.Core": "[2.2.5, )",
"Microsoft.Extensions.Logging.Abstractions": "[6.0.2, )",
"Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )",
"Serilog": "[2.11.0, )"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public async Task<IActionResult> GetAsync([FromRoute] string id)
{
_logger.LogDebug($"{nameof(GetAsync)} - Failed to find payload with payload id: {id}");

return NotFound($"Failed to find payload with payload id: {id}");
return Problem($"Failed to find payload with payload id: {id}", $"/payload/{id}", NotFound);
}

return Ok(payload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ public async Task<IActionResult> GetListAsync([FromQuery] PaginationFilter filte
{
try
{
if (!string.IsNullOrWhiteSpace(payloadId) && !Guid.TryParse(payloadId, out _))
{
_logger.LogDebug($"{nameof(GetListAsync)} - Failed to validate {nameof(payloadId)}");

return Problem($"Failed to validate {nameof(payloadId)}, not a valid guid", $"/workflowinstances/{payloadId}", BadRequest);
}

Status? parsedStatus = status == null ? null : Enum.Parse<Status>(status, true);

if (disablePagination is true)
Expand Down Expand Up @@ -104,7 +111,7 @@ public async Task<IActionResult> GetListAsync([FromQuery] PaginationFilter filte
{
_logger.LogError($"{nameof(GetListAsync)} - Failed to get workflowInstances", e);

return Problem($"Unexpected error occured: {e.Message}", $"/workflowinstances", (int)HttpStatusCode.InternalServerError);
return Problem($"Unexpected error occured: {e.Message}", $"/workflowinstances", InternalServerError);
}
}

Expand All @@ -121,7 +128,7 @@ public async Task<IActionResult> GetByIdAsync([FromRoute] string id)
{
_logger.LogDebug($"{nameof(GetByIdAsync)} - Failed to validate {nameof(id)}");

return Problem($"Failed to validate {nameof(id)}, not a valid guid", $"/workflows/{id}", (int)HttpStatusCode.BadRequest);
return Problem($"Failed to validate {nameof(id)}, not a valid guid", $"/workflows/{id}", BadRequest);
}

try
Expand All @@ -132,14 +139,14 @@ public async Task<IActionResult> GetByIdAsync([FromRoute] string id)
{
_logger.LogDebug($"{nameof(GetByIdAsync)} - Failed to find workflow instance with Id: {id}");

return NotFound($"Failed to find workflow instance with Id: {id}");
return Problem($"Failed to find workflow instance with Id: {id}", $"/workflows/{id}", NotFound);
}

return Ok(workflowInstance);
}
catch (Exception e)
{
return Problem($"Unexpected error occured: {e.Message}", $"/workflowinstances/{nameof(id)}", (int)HttpStatusCode.InternalServerError);
return Problem($"Unexpected error occured: {e.Message}", $"/workflowinstances/{nameof(id)}", InternalServerError);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,13 @@ Scenario: Get all workflows instances by Id. Id Bad Request
And I have a Workflow Instance WFI_Static_1 with no artifacts
When I send a GET request
Then I will get a 400 response
And I will recieve the error message Failed to validate id, not a valid guid


@GetWorkflowInstances
Scenario: Get workflow instances by payloadId. Id Bad Request
Given I have an endpoint /workflowinstances?payloadid=invalidid
And I have a Workflow Instance WFI_Static_1 with no artifacts
When I send a GET request
Then I will get a 400 response
And I will recieve the error message Failed to validate payloadId, not a valid guid
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ public async Task GetByIdAsync_PayloadDoesNotExist_ReturnsNotFound()

var result = await PayloadController.GetAsync(payloadId);

var objectResult = Assert.IsType<NotFoundObjectResult>(result);
var objectResult = Assert.IsType<ObjectResult>(result);

var responseValue = (ProblemDetails)objectResult.Value;
string expectedErrorMessage = $"Failed to find payload with payload id: {payloadId}";
responseValue.Detail.Should().BeEquivalentTo(expectedErrorMessage);

Assert.Equal((int)HttpStatusCode.NotFound, objectResult.StatusCode);
Assert.Equal((int)HttpStatusCode.NotFound, responseValue.Status);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ public async Task GetListAsync_PaginationDisabled_ReturnsList()
responseValue.Should().BeEquivalentTo(workflowsInstances);
}

[Fact]
public async Task GetListAsync_InvalidPayloadId_Returns400()
{
var expectedErrorMessage = "Failed to validate payloadId, not a valid guid";
var result = await WorkflowInstanceController.GetListAsync(new Filter.PaginationFilter(), null, "invalid", true);

var objectResult = Assert.IsType<ObjectResult>(result);

var responseValue = (ProblemDetails)objectResult.Value;
responseValue.Detail.Should().BeEquivalentTo(expectedErrorMessage);
}

[Fact]
public async Task GetListAsync_ServiceException_ReturnProblem()
{
Expand Down Expand Up @@ -179,7 +191,13 @@ public async Task GetByIdAsync_WorkflowInstanceDoesNotExist_ReturnsNotFound()

var result = await WorkflowInstanceController.GetByIdAsync(workflowId);

var objectResult = Assert.IsType<NotFoundObjectResult>(result);
var objectResult = Assert.IsType<ObjectResult>(result);

var responseValue = (ProblemDetails)objectResult.Value;
string expectedErrorMessage = $"Failed to find workflow instance with Id: {workflowId}";
responseValue.Detail.Should().BeEquivalentTo(expectedErrorMessage);

Assert.Equal((int)HttpStatusCode.NotFound, responseValue.Status);

Assert.Equal((int)HttpStatusCode.NotFound, objectResult.StatusCode);
}
Expand Down