Skip to content

Commit e4a099a

Browse files
committed
Merge branch 'develop'
2 parents 0ba5ba5 + 340f181 commit e4a099a

File tree

133 files changed

+1127
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1127
-366
lines changed

src/Api/DicomAssociationInfo.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
using System;
18+
using System.Collections.Generic;
1819

1920
namespace Monai.Deploy.InformaticsGateway.Api
2021
{
@@ -30,14 +31,21 @@ public class DicomAssociationInfo : MongoDBEntityBase
3031
public string Errors { get; set; } = string.Empty;
3132
public TimeSpan Duration { get; private set; } = default!;
3233

34+
public HashSet<string> PayloadIds { get; private set; }
35+
3336
public DicomAssociationInfo()
3437
{
3538
FileCount = 0;
39+
PayloadIds = new HashSet<string>();
3640
}
3741

38-
public void FileReceived()
42+
public void FileReceived(string? payloadId)
3943
{
40-
FileCount++;
44+
if (!string.IsNullOrWhiteSpace(payloadId))
45+
{
46+
FileCount++;
47+
PayloadIds.Add(payloadId);
48+
}
4149
}
4250

4351
public void Disconnect()

src/Api/GlobalSuppressions.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2022 MONAI Consortium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// This file is used by Code Analysis to maintain SuppressMessage
18+
// attributes that are applied to this project.
19+
// Project-level suppressions either have no target or are given
20+
// a specific target and scoped to a namespace, type, member, etc.
21+
22+
using System.Diagnostics.CodeAnalysis;
23+
24+
[assembly: SuppressMessage("Sonar Code Smell", "S2094: Remove this empty class, write its code or make it an \"interface\"", Justification = "placeholder code")]

src/Api/SourceApplicationEntity.cs

100644100755
File mode changed.

src/Api/Storage/FileStorageMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public abstract record FileStorageMetadata
6969
/// Gets or sets the data origin of this file.
7070
/// </summary>
7171
[JsonPropertyName("dataOrigin"), JsonInclude]
72-
public DataOrigin DataOrigin { get; private set; }
72+
public DataOrigin DataOrigin { get; private set; } = new();
7373

7474
/// <summary>
7575
/// Gets a list of workflows designated for the file.

src/Api/Storage/StorageObjectMetadata.cs

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class StorageObjectMetadata
4040
/// Gets the file extension.
4141
/// </summary>
4242
[JsonPropertyName("fileExtension")]
43-
public string FileExtension { get; init; } = default!;
43+
public string FileExtension { get; init; }
4444

4545
/// <summary>
4646
/// Gets or sets the content type of the file.
@@ -83,7 +83,7 @@ public class StorageObjectMetadata
8383
/// Gets or sets whether upload failed.
8484
/// </summary>
8585
[JsonPropertyName("isUploadFailed"), JsonInclude]
86-
public bool IsUploadFailed { get; private set; } = default!;
86+
public bool IsUploadFailed { get; private set; }
8787

8888
[JsonPropertyName("isMoveCompleted"), JsonInclude]
8989
public bool IsMoveCompleted { get; private set; } = default!;

src/CLI/Services/DockerRunner.cs

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task<RunnerState> IsApplicationRunning(ImageVersion imageVersion, C
6464
return new RunnerState { IsRunning = false };
6565
}
6666

67-
return new RunnerState { IsRunning = true, Id = matches.First().ID };
67+
return new RunnerState { IsRunning = true, Id = matches[0].ID };
6868
}
6969

7070
public async Task<ImageVersion> GetLatestApplicationVersion(CancellationToken cancellationToken = default)
@@ -98,7 +98,7 @@ public async Task<IList<ImageVersion>> GetApplicationVersions(string version, Ca
9898
};
9999
_logger.RetrievingImagesFromDocker();
100100
var images = await _dockerClient.Images.ListImagesAsync(parameters, cancellationToken).ConfigureAwait(false);
101-
return images?.Select(p => new ImageVersion { Version = p.RepoTags.First(), Id = p.ID, Created = p.Created }).ToList();
101+
return images?.Select(p => new ImageVersion { Version = p.RepoTags[0], Id = p.ID, Created = p.Created }).ToList();
102102
}
103103

104104
public async Task<bool> StartApplication(ImageVersion imageVersion, CancellationToken cancellationToken = default)

src/CLI/Services/NLogConfigurationOptionAccessor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public interface INLogConfigurationOptionAccessor
3030

3131
public class NLogConfigurationOptionAccessor : INLogConfigurationOptionAccessor
3232
{
33+
public const string NlogSchema = "http://www.nlog-project.org/schemas/NLog.xsd";
3334
private readonly XmlDocument _xmlDocument;
3435
private readonly XmlNamespaceManager _namespaceManager;
3536

@@ -44,7 +45,7 @@ public NLogConfigurationOptionAccessor(IFileSystem fileSystem)
4445
_xmlDocument = new XmlDocument();
4546
_xmlDocument.LoadXml(xml);
4647
_namespaceManager = new XmlNamespaceManager(_xmlDocument.NameTable);
47-
_namespaceManager.AddNamespace("ns", "http://www.nlog-project.org/schemas/NLog.xsd");
48+
_namespaceManager.AddNamespace("ns", NlogSchema);
4849
}
4950

5051
public string LogStoragePath

src/Client.Common/UriExtensions.cs

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static Uri EnsureUriEndsWithSlash(this Uri input)
2828

2929
var str = input.ToString();
3030

31-
if (!string.IsNullOrWhiteSpace(str) && !str.EndsWith("/"))
31+
if (!string.IsNullOrWhiteSpace(str) && !str.EndsWith('/'))
3232
{
3333
#pragma warning disable S1075 // URIs should not be hardcoded
3434
return new Uri(str + '/');

src/Client/HttpContentExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ internal static class HttpContentExtensions
2424
{
2525
public static async System.Threading.Tasks.Task<T> ReadAsAsync<T>(this HttpContent httpContent, CancellationToken cancellationToken)
2626
{
27-
var json = await httpContent.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
2827
using (var contentStream = await httpContent.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false))
2928
{
3029
return await JsonSerializer.DeserializeAsync<T>(contentStream, Configuration.JsonSerializationOptions, cancellationToken: cancellationToken).ConfigureAwait(false);

src/Client/Test/packages.lock.json

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,17 @@
16591659
"System.Text.Encoding": "4.3.0"
16601660
}
16611661
},
1662+
"System.Text.Encoding.Extensions": {
1663+
"type": "Transitive",
1664+
"resolved": "4.3.0",
1665+
"contentHash": "YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==",
1666+
"dependencies": {
1667+
"Microsoft.NETCore.Platforms": "1.1.0",
1668+
"Microsoft.NETCore.Targets": "1.1.0",
1669+
"System.Runtime": "4.3.0",
1670+
"System.Text.Encoding": "4.3.0"
1671+
}
1672+
},
16621673
"System.Text.Encodings.Web": {
16631674
"type": "Transitive",
16641675
"resolved": "6.0.0",
@@ -1764,6 +1775,47 @@
17641775
"System.Xml.ReaderWriter": "4.3.0"
17651776
}
17661777
},
1778+
"System.Xml.ReaderWriter": {
1779+
"type": "Transitive",
1780+
"resolved": "4.3.0",
1781+
"contentHash": "GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==",
1782+
"dependencies": {
1783+
"System.Collections": "4.3.0",
1784+
"System.Diagnostics.Debug": "4.3.0",
1785+
"System.Globalization": "4.3.0",
1786+
"System.IO": "4.3.0",
1787+
"System.IO.FileSystem": "4.3.0",
1788+
"System.IO.FileSystem.Primitives": "4.3.0",
1789+
"System.Resources.ResourceManager": "4.3.0",
1790+
"System.Runtime": "4.3.0",
1791+
"System.Runtime.Extensions": "4.3.0",
1792+
"System.Runtime.InteropServices": "4.3.0",
1793+
"System.Text.Encoding": "4.3.0",
1794+
"System.Text.Encoding.Extensions": "4.3.0",
1795+
"System.Text.RegularExpressions": "4.3.0",
1796+
"System.Threading.Tasks": "4.3.0",
1797+
"System.Threading.Tasks.Extensions": "4.3.0"
1798+
}
1799+
},
1800+
"System.Xml.XDocument": {
1801+
"type": "Transitive",
1802+
"resolved": "4.3.0",
1803+
"contentHash": "5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==",
1804+
"dependencies": {
1805+
"System.Collections": "4.3.0",
1806+
"System.Diagnostics.Debug": "4.3.0",
1807+
"System.Diagnostics.Tools": "4.3.0",
1808+
"System.Globalization": "4.3.0",
1809+
"System.IO": "4.3.0",
1810+
"System.Reflection": "4.3.0",
1811+
"System.Resources.ResourceManager": "4.3.0",
1812+
"System.Runtime": "4.3.0",
1813+
"System.Runtime.Extensions": "4.3.0",
1814+
"System.Text.Encoding": "4.3.0",
1815+
"System.Threading": "4.3.0",
1816+
"System.Xml.ReaderWriter": "4.3.0"
1817+
}
1818+
},
17671819
"xunit.abstractions": {
17681820
"type": "Transitive",
17691821
"resolved": "2.0.3",
@@ -1827,6 +1879,7 @@
18271879
"Monai.Deploy.InformaticsGateway.Database.Api": "[1.0.0, )",
18281880
"Monai.Deploy.InformaticsGateway.Database.EntityFramework": "[1.0.0, )",
18291881
"Monai.Deploy.InformaticsGateway.DicomWeb.Client": "[1.0.0, )",
1882+
"Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution": "[1.0.0, )",
18301883
"Monai.Deploy.Messaging.RabbitMQ": "[1.0.0, )",
18311884
"Monai.Deploy.Security": "[0.1.3, )",
18321885
"Monai.Deploy.Storage.MinIO": "[0.2.18, )",
@@ -1889,7 +1942,8 @@
18891942
"type": "Project",
18901943
"dependencies": {
18911944
"Monai.Deploy.InformaticsGateway.Api": "[1.0.0, )",
1892-
"Monai.Deploy.InformaticsGateway.Configuration": "[1.0.0, )"
1945+
"Monai.Deploy.InformaticsGateway.Configuration": "[1.0.0, )",
1946+
"NLog": "[5.2.3, )"
18931947
}
18941948
},
18951949
"monai.deploy.informaticsgateway.database.entityframework": {
@@ -1921,6 +1975,23 @@
19211975
"System.Linq.Async": "[6.0.1, )",
19221976
"fo-dicom": "[5.1.1, )"
19231977
}
1978+
},
1979+
"monai.deploy.informaticsgateway.plugins.remoteappexecution": {
1980+
"type": "Project",
1981+
"dependencies": {
1982+
"Microsoft.EntityFrameworkCore": "[6.0.21, )",
1983+
"Microsoft.EntityFrameworkCore.Relational": "[6.0.21, )",
1984+
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.21, )",
1985+
"Microsoft.Extensions.Configuration": "[6.0.1, )",
1986+
"Microsoft.Extensions.Configuration.FileExtensions": "[6.0.0, )",
1987+
"Microsoft.Extensions.Configuration.Json": "[6.0.0, )",
1988+
"Monai.Deploy.InformaticsGateway.Api": "[1.0.0, )",
1989+
"Monai.Deploy.InformaticsGateway.Configuration": "[1.0.0, )",
1990+
"Monai.Deploy.InformaticsGateway.Database.Api": "[1.0.0, )",
1991+
"MongoDB.Driver": "[2.21.0, )",
1992+
"NLog": "[5.2.3, )",
1993+
"Polly": "[7.2.4, )"
1994+
}
19241995
}
19251996
}
19261997
}

0 commit comments

Comments
 (0)