Skip to content

Commit

Permalink
Release/0.1.24 (#209)
Browse files Browse the repository at this point in the history
+semver: patch

* adding new fields to messages for external app executions

Signed-off-by: Neil South <[email protected]>

* added forgot licence header

Signed-off-by: Neil South <[email protected]>

* added export request to export cmplete message event

Signed-off-by: Neil South <[email protected]>

* Update ExportRequestEvent and update dependencies (#210)

* Update dependencies
* Remove ExportRequestType enum and replace with a list of plug-in assembly names
* Update dependencies decisions
* Include taskId in WorkflowRequestEvent to support multiple external app executions


Signed-off-by: Victor Chang <[email protected]>

---------

Signed-off-by: Neil South <[email protected]>
Signed-off-by: Victor Chang <[email protected]>
Co-authored-by: Victor Chang <[email protected]>
  • Loading branch information
neildsouth and mocsharp authored Aug 7, 2023
1 parent c2810be commit 4b53983
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 174 deletions.
54 changes: 27 additions & 27 deletions doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- :who: mocsharp
:why: MIT (https://github.com/ardalis/GuardClauses.Analyzers/raw/master/LICENSE)
:versions:
- 4.0.1
- 4.1.1
:when: 2022-08-16 21:39:30.077666354 Z
- - :approve
- Castle.Core
Expand All @@ -23,26 +23,26 @@
- - :approve
- Microsoft.CodeCoverage
- :who: woodheadio
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.1/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.7.0/LICENSE)
:versions:
- 17.4.1
- 17.5.0
- 17.7.0
- Microsoft.CodeCoverage
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
- Microsoft.Extensions.Diagnostics.HealthChecks
- :who: woodheadio
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.12
- 6.0.14
- 6.0.20
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions
- :who: woodheadio
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.12
- 6.0.14
- 6.0.20
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
- Microsoft.Extensions.Configuration
Expand Down Expand Up @@ -162,7 +162,7 @@
- :who: mocsharp
:why: MIT (https://github.com/dotnet/runtime/raw/main/LICENSE.TXT)
:versions:
- 6.0.3
- 6.0.4
:when: 2022-08-16 21:39:44.471693654 Z
- - :approve
- Microsoft.Extensions.Logging.Configuration
Expand Down Expand Up @@ -223,9 +223,9 @@
- - :approve
- Microsoft.NET.Test.Sdk
- :who: woodheadio
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.1/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.7.0/LICENSE)
:versions:
- 17.4.1
- 17.7.0
- 17.5.0
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
Expand All @@ -245,17 +245,17 @@
- - :approve
- Microsoft.TestPlatform.ObjectModel
- :who: woodheadio
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.1/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.7.0/LICENSE)
:versions:
- 17.4.1
- 17.7.0
- 17.5.0
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
- Microsoft.TestPlatform.TestHost
- :who: woodheadio
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.1/LICENSE)
:why: MIT (https://github.com/microsoft/vstest/raw/v17.7.0/LICENSE)
:versions:
- 17.4.1
- 17.7.0
- 17.5.0
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
Expand Down Expand Up @@ -292,14 +292,14 @@
- :who: mocsharp
:why: Apache-2.0 (https://github.com/NuGet/NuGet.Client/raw/dev/LICENSE.txt)
:versions:
- 5.11.0
- 6.5.0
:when: 2022-08-16 21:39:52.061412838 Z
- - :approve
- RabbitMQ.Client
- :who: mocsharp
:why: Apache-2.0 (https://github.com/rabbitmq/rabbitmq-dotnet-client/raw/main/LICENSE-APACHE2)
:versions:
- 6.4.0
- 6.5.0
:when: 2022-08-16 21:39:52.474284611 Z
- - :approve
- System.AppContext
Expand Down Expand Up @@ -481,7 +481,7 @@
- :who: mocsharp
:why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT)
:versions:
- 4.5.4
- 4.5.5
:when: 2022-08-16 21:40:03.543731192 Z
- - :approve
- System.Net.Http
Expand Down Expand Up @@ -740,7 +740,7 @@
- :who: mocsharp
:why: MIT ( https://github.com/dotnet/corefx/blob/master/LICENSE.TXT)
:versions:
- 4.7.1
- 7.0.0
:when: 2022-08-16 21:40:19.306691187 Z
- - :approve
- System.Threading.Tasks
Expand Down Expand Up @@ -782,7 +782,7 @@
- :who: mocsharp
:why: MIT (https://github.com/coverlet-coverage/coverlet/raw/master/LICENSE)
:versions:
- 3.2.0
- 6.0.0
:when: 2022-08-16 21:40:21.855388365 Z
- - :approve
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl
Expand Down Expand Up @@ -901,7 +901,7 @@
- :who: mocsharp
:why: Apache-2.0 ( https://raw.githubusercontent.com/xunit/xunit/master/license.txt)
:versions:
- 2.4.2
- 2.5.0
:when: 2022-08-16 21:40:29.166018542 Z
- - :approve
- xunit.abstractions
Expand All @@ -915,49 +915,49 @@
- :who: mocsharp
:why: Apache-2.0 ( https://raw.githubusercontent.com/xunit/xunit.analyzers/master/LICENSE)
:versions:
- 1.0.0
- 1.2.0
:when: 2022-08-16 21:40:30.047067134 Z
- - :approve
- xunit.assert
- :who: mocsharp
:why: Apache-2.0 ( https://raw.githubusercontent.com/xunit/xunit/master/license.txt)
:versions:
- 2.4.2
- 2.5.0
:when: 2022-08-16 21:40:30.526718458 Z
- - :approve
- xunit.core
- :who: mocsharp
:why: Apache-2.0 ( https://raw.githubusercontent.com/xunit/xunit/master/license.txt)
:versions:
- 2.4.2
- 2.5.0
:when: 2022-08-16 21:40:30.973515441 Z
- - :approve
- xunit.extensibility.core
- :who: mocsharp
:why: Apache-2.0 ( https://raw.githubusercontent.com/xunit/xunit/master/license.txt)
:versions:
- 2.4.2
- 2.5.0
:when: 2022-08-16 21:40:31.401607230 Z
- - :approve
- xunit.extensibility.execution
- :who: mocsharp
:why: Apache-2.0 ( https://raw.githubusercontent.com/xunit/xunit/master/license.txt)
:versions:
- 2.4.2
- 2.5.0
:when: 2022-08-16 21:40:31.845685693 Z
- - :approve
- xunit.runner.visualstudio
- :who: mocsharp
:why: MIT ( https://licenses.nuget.org/MIT)
:versions:
- 2.4.5
- 2.5.0
:when: 2022-08-16 21:40:32.294717110 Z
- - :approve
- Polly
- :who: mocsharp
:why: MIT ( https://licenses.nuget.org/MIT)
:versions:
- 7.2.3
- 7.2.4
:when: 2022-11-09 18:57:32.294717110 Z
- - :approve
- Microsoft.AspNetCore.Hosting.Abstractions
Expand Down Expand Up @@ -993,7 +993,7 @@
:why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt)
:versions:
- 6.0.12
- 6.0.14
- 6.0.20
:when: 2023-08-16 16:49:26.950721112 Z
- - :approve
- System.IO.Pipelines
Expand Down
24 changes: 0 additions & 24 deletions src/Messaging/API/IMessageBrokerSubscriberService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,6 @@ public interface IMessageBrokerSubscriberService : IDisposable
/// </summary>
string Name { get; }

/// <summary>
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> for every message that is received.
/// Either provide a topic, a queue or both.
/// A queue is generated if the name of the queue is not provided.
/// </summary>
/// <param name="topic">Topic/routing key to bind to</param>
/// <param name="queue">Name of the queue to consume</param>
/// <param name="messageReceivedCallback">Action to be performed when message is received</param>
/// <param name="prefetchCount">Number of unacknowledged messages to receive at once. Defaults to 0.</param>
[Obsolete("This method is obsolete, use SubscribeAsync instead")]
void Subscribe(string topic, string queue, Action<MessageReceivedEventArgs> messageReceivedCallback, ushort prefetchCount = 0);

/// <summary>
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> for every message that is received.
/// Either provide a topic, a queue or both.
/// A queue is generated if the name of the queue is not provided.
/// </summary>
/// <param name="topics">Topics/routing keys to bind to</param>
/// <param name="queue">Name of the queue to consume</param>
/// <param name="messageReceivedCallback">Action to be performed when message is received</param>
/// <param name="prefetchCount">Number of unacknowledged messages to receive at once. Defaults to 0.</param>
[Obsolete("This method is obsolete, use SubscribeAsync instead")]
void Subscribe(string[] topics, string queue, Action<MessageReceivedEventArgs> messageReceivedCallback, ushort prefetchCount = 0);

/// <summary>
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
/// Either provide a topic, a queue or both.
Expand Down
39 changes: 39 additions & 0 deletions src/Messaging/Common/ServiceException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2023 MONAI Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System.Runtime.Serialization;

namespace Monai.Deploy.Messaging.Common
{
public class ServiceException : Exception

Check warning on line 21 in src/Messaging/Common/ServiceException.cs

View workflow job for this annotation

GitHub Actions / unit-test

Update this implementation of 'ISerializable' to conform to the recommended serialization pattern.

Check warning on line 21 in src/Messaging/Common/ServiceException.cs

View workflow job for this annotation

GitHub Actions / unit-test

Update this implementation of 'ISerializable' to conform to the recommended serialization pattern.

Check warning on line 21 in src/Messaging/Common/ServiceException.cs

View workflow job for this annotation

GitHub Actions / unit-test

Update this implementation of 'ISerializable' to conform to the recommended serialization pattern.

Check warning on line 21 in src/Messaging/Common/ServiceException.cs

View workflow job for this annotation

GitHub Actions / unit-test

Update this implementation of 'ISerializable' to conform to the recommended serialization pattern.
{
public ServiceException()
{
}

public ServiceException(string? message) : base(message)
{
}

public ServiceException(string? message, Exception? innerException) : base(message, innerException)
{
}

protected ServiceException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
6 changes: 3 additions & 3 deletions src/Messaging/Events/ExportCompleteEvent.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public ExportCompleteEvent()

public ExportCompleteEvent(ExportRequestEvent exportRequest, ExportStatus exportStatus, Dictionary<string, FileExportStatus> fileStatuses)
{
Guard.Against.Null(exportRequest);
Guard.Against.Null(exportStatus);
Guard.Against.Null(fileStatuses);
Guard.Against.Null(exportRequest, nameof(exportRequest));
Guard.Against.Null(exportStatus, nameof(exportStatus));
Guard.Against.Null(fileStatuses, nameof(fileStatuses));

WorkflowInstanceId = exportRequest.WorkflowInstanceId;
ExportTaskId = exportRequest.ExportTaskId;
Expand Down
9 changes: 9 additions & 0 deletions src/Messaging/Events/ExportRequestEvent.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,18 @@ public class ExportRequestEvent : EventBase
/// </summary>
public List<string> ErrorMessages { get; private set; }

/// <summary>
/// A list of data output plug-in type names to be executed by the export services.
/// Each string must be a fully-qualified type name.
/// E.g. <code>MyCompnay.MyProject.MyNamepsace.MyPlugin, MyCompnay.MyProject.MyNamepsace</code> where
/// <code>MyCompnay.MyProject.MyNamepsace</code> is the name of the assembly (DLL).
/// </summary>
public List<string> PluginAssemblies { get; private set; }

public ExportRequestEvent()
{
ErrorMessages = new List<string>();
PluginAssemblies = new List<string>();
}

public void AddErrorMessages(IList<string> errorMessages)
Expand Down
16 changes: 16 additions & 0 deletions src/Messaging/Events/WorkflowRequestEvent.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ public class WorkflowRequestEvent : EventBase
[Required]
public DateTime Timestamp { get; set; }

/// <summary>
/// Sets the workflow instance ID for the Workflow Manager.
/// This is only applicable to resume events (after external app executions)
/// In standard workflows this will not be set
/// </summary>
[JsonProperty(PropertyName = "workflow_instance_id")]
public string? WorkflowInstanceId { get; set; } = default;

/// <summary>
/// Sets the task ID for the Workflow Manager.
/// This is only applicable to resume events (after external app executions)
/// In standard workflows this will not be set
/// </summary>
[JsonProperty(PropertyName = "task_id")]
public string? TaskId { get; set; } = default;

/// <summary>
/// Gets or sets a list of files and metadata files in this request.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Messaging/Monai.Deploy.Messaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
<PackageReference Include="Ardalis.GuardClauses" Version="4.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.14" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.20" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
Expand Down
3 changes: 3 additions & 0 deletions src/Messaging/Tests/IServiceCollectionExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ internal class GoodSubscriberService : IMessageBrokerSubscriberService
{
public string Name => throw new NotImplementedException();

#pragma warning disable CS0067 // The event 'GoodSubscriberService.OnConnectionError' is never used
// event used by users of this library
public event ConnectionErrorHandler? OnConnectionError;
#pragma warning restore CS0067 // The event 'GoodSubscriberService.OnConnectionError' is never used

public void Acknowledge(MessageBase message) => throw new NotImplementedException();

Expand Down
8 changes: 4 additions & 4 deletions src/Messaging/Tests/Monai.Deploy.Messaging.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 3 additions & 1 deletion src/Messaging/Tests/WorkflowRequestMessageTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public void ConvertsJsonMessageToMessage()
FileCount = 10,
PayloadId = Guid.NewGuid(),
Timestamp = DateTime.Now,
Workflows = new List<string> { Guid.NewGuid().ToString() }
Workflows = new List<string> { Guid.NewGuid().ToString() },
WorkflowInstanceId = Guid.NewGuid().ToString(),
TaskId = Guid.NewGuid().ToString(),
};

var files = new List<BlockStorageInfo>()
Expand Down
Loading

0 comments on commit 4b53983

Please sign in to comment.