Skip to content

Commit 708ba63

Browse files
authored
Merge pull request #724 from Project-MONAI/release/0.1.6
Release/0.1.6
2 parents 977177e + 264aedd commit 708ba63

File tree

7 files changed

+1053
-1537
lines changed

7 files changed

+1053
-1537
lines changed

.github/.gitversion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
next-version: 0.1.2
15+
next-version: 0.1.5
1616
assembly-versioning-scheme: MajorMinorPatchTag
1717
mode: ContinuousDelivery
1818
branches:

src/Shared/Shared/ValidationConstants.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,13 @@ public static class ValidationConstants
4848
/// </summary>
4949
public static readonly string Mode = "mode";
5050

51-
/// <summary>
52-
/// Key for the notifications.
53-
/// </summary>
54-
public static readonly string Notifications = "notifications";
55-
5651
public enum ModeValues
5752
{
5853
QA,
5954
Research,
6055
Clinical
6156
}
6257

63-
public enum NotificationValues
64-
{
65-
True,
66-
False
67-
}
68-
6958
/// <summary>
7059
/// Required arguments to run the clinical review task workflow args.
7160
/// </summary>

src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -407,16 +407,6 @@ private void ValidateClinicalReviewRequiredFields(TaskObject[] tasks, TaskObject
407407
return;
408408
}
409409

410-
if (!currentTask.Args.ContainsKey(Notifications))
411-
{
412-
Errors.Add($"Task: '{currentTask.Id}' notifications must be specified.");
413-
return;
414-
}
415-
else if (!Enum.TryParse(typeof(NotificationValues), currentTask.Args[Notifications], true, out var _))
416-
{
417-
Errors.Add($"Task: '{currentTask.Id}' notifications is incorrectly specified{Comma}please specify 'true' or 'false'");
418-
}
419-
420410
var reviewedTask = tasks.First(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower());
421411

422412
if (reviewedTask.Type.Equals(ArgoTaskType, StringComparison.OrdinalIgnoreCase) is false)

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature

Lines changed: 69 additions & 81 deletions
Large diffs are not rendered by default.

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowInstanceStepDefintions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
using System.Globalization;
1718
using BoDi;
1819
using Monai.Deploy.Messaging.Events;
1920
using Monai.Deploy.WorkflowManager.Contracts.Models;

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs

Lines changed: 982 additions & 1189 deletions
Large diffs are not rendered by default.

tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs

Lines changed: 0 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -221,251 +221,6 @@ public async Task ValidateAsync_WorkflowValid_Returns204()
221221
Assert.Equal(204, objectResult.StatusCode);
222222
}
223223

224-
[Fact]
225-
public async Task ValidateAsync_ValidWorkflowWithClinicalReview_Returns204()
226-
{
227-
var newWorkflow = new Workflow()
228-
{
229-
Name = "Basic workflow",
230-
Description = "Basic workflow update",
231-
Version = "1",
232-
Tasks = new TaskObject[]
233-
{
234-
new TaskObject
235-
{
236-
Id = "argo-task",
237-
Type = "argo",
238-
Description = "Argo task",
239-
Args = new Dictionary<string, string> {
240-
{ "workflow_template_name", "Workflow Name" },
241-
},
242-
Artifacts = new ArtifactMap()
243-
{
244-
Input = new Artifact[]
245-
{
246-
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
247-
},
248-
Output = new Artifact[]
249-
{
250-
new Artifact { Name = "Argo2" }
251-
}
252-
},
253-
TaskDestinations = new TaskDestination[] {
254-
new TaskDestination
255-
{
256-
Name = "clinical-review"
257-
}
258-
}
259-
},
260-
new TaskObject
261-
{
262-
Id = "clinical-review",
263-
Type = "aide_clinical_review",
264-
Description = "Basic Workflow update Task update",
265-
Args = new Dictionary<string, string>
266-
{
267-
{ "workflow_name", "test" },
268-
{ "reviewed_task_id", "argo-task" },
269-
{ "application_name", "test" },
270-
{ "application_version", "1.1" },
271-
{ "mode", "QA" },
272-
{ "notifications", "true" }
273-
},
274-
Artifacts = new ArtifactMap()
275-
{
276-
Input = new Artifact[]
277-
{
278-
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
279-
},
280-
Output = new Artifact[] {}
281-
},
282-
TaskDestinations = new TaskDestination[] { }
283-
}
284-
},
285-
InformaticsGateway = new InformaticsGateway()
286-
{
287-
AeTitle = "Update",
288-
DataOrigins = new string[] { "test" },
289-
ExportDestinations = new string[] { "test" }
290-
}
291-
};
292-
293-
var request = new WorkflowUpdateRequest();
294-
request.Workflow = newWorkflow;
295-
request.OriginalWorkflowName = newWorkflow.Name + "1";
296-
297-
var result = await WorkflowsController.ValidateAsync(request);
298-
299-
var objectResult = Assert.IsType<StatusCodeResult>(result);
300-
301-
Assert.Equal(204, objectResult.StatusCode);
302-
}
303-
304-
[Fact]
305-
public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewMissingNotifications_ReturnsBadRequest()
306-
{
307-
var newWorkflow = new Workflow()
308-
{
309-
Name = "Basic workflow",
310-
Description = "Basic workflow update",
311-
Version = "1",
312-
Tasks = new TaskObject[]
313-
{
314-
new TaskObject
315-
{
316-
Id = "argo-task",
317-
Type = "argo",
318-
Description = "Argo task",
319-
Args = new Dictionary<string, string> {
320-
{ "workflow_template_name", "Workflow Name" },
321-
},
322-
Artifacts = new ArtifactMap()
323-
{
324-
Input = new Artifact[]
325-
{
326-
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
327-
},
328-
Output = new Artifact[]
329-
{
330-
new Artifact { Name = "Argo2" }
331-
}
332-
},
333-
TaskDestinations = new TaskDestination[] {
334-
new TaskDestination
335-
{
336-
Name = "clinical-review"
337-
}
338-
}
339-
},
340-
new TaskObject
341-
{
342-
Id = "clinical-review",
343-
Type = "aide_clinical_review",
344-
Description = "Basic Workflow update Task update",
345-
Args = new Dictionary<string, string>
346-
{
347-
{ "workflow_name", "test" },
348-
{ "reviewed_task_id", "argo-task" },
349-
{ "application_name", "test" },
350-
{ "application_version", "1.1" },
351-
{ "mode", "QA" },
352-
},
353-
Artifacts = new ArtifactMap()
354-
{
355-
Input = new Artifact[]
356-
{
357-
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
358-
},
359-
Output = new Artifact[] {}
360-
},
361-
TaskDestinations = new TaskDestination[] { }
362-
}
363-
},
364-
InformaticsGateway = new InformaticsGateway()
365-
{
366-
AeTitle = "Update",
367-
DataOrigins = new string[] { "test" },
368-
ExportDestinations = new string[] { "test" }
369-
}
370-
};
371-
372-
var request = new WorkflowUpdateRequest();
373-
request.Workflow = newWorkflow;
374-
request.OriginalWorkflowName = newWorkflow.Name + "1";
375-
376-
var result = await WorkflowsController.ValidateAsync(request);
377-
378-
var objectResult = Assert.IsType<ObjectResult>(result);
379-
380-
Assert.Equal(400, objectResult.StatusCode);
381-
382-
const string expectedInstance = "/workflows";
383-
Assert.StartsWith(expectedInstance, ((ProblemDetails)objectResult.Value).Instance);
384-
}
385-
386-
[Fact]
387-
public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewInvalidNotifications_ReturnsBadRequest()
388-
{
389-
var newWorkflow = new Workflow()
390-
{
391-
Name = "Basic workflow",
392-
Description = "Basic workflow update",
393-
Version = "1",
394-
Tasks = new TaskObject[]
395-
{
396-
new TaskObject
397-
{
398-
Id = "argo-task",
399-
Type = "argo",
400-
Description = "Argo task",
401-
Args = new Dictionary<string, string> {
402-
{ "workflow_template_name", "Workflow Name" },
403-
},
404-
Artifacts = new ArtifactMap()
405-
{
406-
Input = new Artifact[]
407-
{
408-
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
409-
},
410-
Output = new Artifact[]
411-
{
412-
new Artifact { Name = "Argo2" }
413-
}
414-
},
415-
TaskDestinations = new TaskDestination[] {
416-
new TaskDestination
417-
{
418-
Name = "clinical-review"
419-
}
420-
}
421-
},
422-
new TaskObject
423-
{
424-
Id = "clinical-review",
425-
Type = "aide_clinical_review",
426-
Description = "Basic Workflow update Task update",
427-
Args = new Dictionary<string, string>
428-
{
429-
{ "workflow_name", "test" },
430-
{ "reviewed_task_id", "argo-task" },
431-
{ "application_name", "test" },
432-
{ "application_version", "1.1" },
433-
{ "mode", "QA" },
434-
{ "notifications", "cat" }
435-
},
436-
Artifacts = new ArtifactMap()
437-
{
438-
Input = new Artifact[]
439-
{
440-
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
441-
},
442-
Output = new Artifact[] {}
443-
},
444-
TaskDestinations = new TaskDestination[] { }
445-
}
446-
},
447-
InformaticsGateway = new InformaticsGateway()
448-
{
449-
AeTitle = "Update",
450-
DataOrigins = new string[] { "test" },
451-
ExportDestinations = new string[] { "test" }
452-
}
453-
};
454-
455-
var request = new WorkflowUpdateRequest();
456-
request.Workflow = newWorkflow;
457-
request.OriginalWorkflowName = newWorkflow.Name + "1";
458-
459-
var result = await WorkflowsController.ValidateAsync(request);
460-
461-
var objectResult = Assert.IsType<ObjectResult>(result);
462-
463-
Assert.Equal(400, objectResult.StatusCode);
464-
465-
const string expectedInstance = "/workflows";
466-
Assert.StartsWith(expectedInstance, ((ProblemDetails)objectResult.Value).Instance);
467-
}
468-
469224
[Fact]
470225
public async Task UpdateAsync_InvalidWorkflow_ReturnsBadRequest()
471226
{

0 commit comments

Comments
 (0)