Skip to content

Commit 16e1cb7

Browse files
authored
Update licenses & CI (#234)
* Fix build warnings * Update licenses & fix nuget scan * Split CodeQL actions * Make CodeQL-Analyze required for release * Fix minio client setup in integration test Signed-off-by: Victor Chang <[email protected]>
1 parent 8aa247f commit 16e1cb7

File tree

12 files changed

+104
-71
lines changed

12 files changed

+104
-71
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,53 @@ jobs:
5959
useConfigFile: true
6060
configFilePath: .github/.gitversion.yml
6161

62+
CodeQL-Analyze:
63+
runs-on: ubuntu-latest
64+
permissions:
65+
actions: read
66+
contents: read
67+
security-events: write
68+
69+
steps:
70+
- name: Checkout repository
71+
uses: actions/checkout@v3
72+
with:
73+
fetch-depth: 0
74+
75+
- uses: actions/setup-dotnet@v3
76+
with:
77+
dotnet-version: "6.0.x"
78+
79+
- name: Enable NuGet cache
80+
uses: actions/[email protected]
81+
with:
82+
path: ~/.nuget/packages
83+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
84+
restore-keys: |
85+
${{ runner.os }}-nuget
86+
87+
- name: Initialize CodeQL
88+
uses: github/codeql-action/init@v2
89+
with:
90+
languages: csharp
91+
92+
- name: Restore dependencies
93+
run: dotnet restore
94+
working-directory: ./src
95+
96+
- name: Build Solution
97+
run: dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
98+
working-directory: ./src
99+
100+
- name: Perform CodeQL Analysis
101+
uses: github/codeql-action/analyze@v2
102+
62103
analyze:
63104
runs-on: ubuntu-latest
64105
permissions:
65106
actions: read
66107
contents: read
67108
security-events: write
68-
strategy:
69-
fail-fast: false
70-
matrix:
71-
language: [ 'csharp' ]
72109

73110
steps:
74111
- name: Checkout repository
@@ -97,13 +134,12 @@ jobs:
97134
restore-keys: |
98135
${{ runner.os }}-nuget
99136
100-
- name: Initialize CodeQL
101-
uses: github/codeql-action/init@v2
102-
with:
103-
languages: ${{ matrix.language }}
104-
105-
- name: Install NuGetDefense
106-
run: dotnet tool install --global NuGetDefense.Tool
137+
- name: Nuget Vulnerabiilty Scan
138+
run: |
139+
dotnet list package --vulnerable 2>&1 | tee vulnerable.txt
140+
echo "Analyzing dotnet list package command log output..."
141+
sh -c "! grep 'has the following vulnerable packages' vulnerable.txt"
142+
working-directory: ./src
107143

108144
- name: Restore dependencies
109145
run: dotnet restore
@@ -120,17 +156,14 @@ jobs:
120156
sed -i "s/OSSINDEXAPI_USERNAME/$OSSINDEXAPI_USERNAME/g" NuGetDefense.json
121157
nugetdefense -p src/${{ env.SOLUTION }} --settings-file NuGetDefense.json
122158
123-
- name: Perform CodeQL Analysis
124-
uses: github/codeql-action/analyze@v2
125-
126159
- name: Secret detection
127160
uses: gitleaks/[email protected]
128161

129162
- name: Perform License Scanning
130163
run: license_finder -r
131164

132165
- name: Check License Header
133-
uses: apache/skywalking-eyes@main
166+
uses: apache/skywalking-eyes@v0.4.0
134167

135168
unit-test:
136169
runs-on: ubuntu-latest
@@ -448,7 +481,7 @@ jobs:
448481
release:
449482
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') ||contains(github.head_ref, 'release/') || contains(github.head_ref, 'feature/') || contains(github.head_ref, 'develop') }}
450483
runs-on: ubuntu-latest
451-
needs: [calc-version, unit-test, docs, integration-test]
484+
needs: [calc-version, unit-test, docs, integration-test, analyze]
452485
env:
453486
SEMVER: ${{ needs.calc-version.outputs.semVer }}
454487
PRERELEASELABEL: ${{ needs.calc-version.outputs.preReleaseLabel }}

doc/dependency_decisions.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@
7474
- :who: mocsharp
7575
:why: MIT (https://github.com/dotnet/dotNext/raw/master/LICENSE)
7676
:versions:
77-
- 4.7.3
77+
- 4.7.4
7878
:when: 2022-09-01 23:05:32.857032968 Z
7979
- - :approve
8080
- DotNext.Threading
8181
- :who: mocsharp
8282
:why: MIT (https://github.com/dotnet/dotNext/raw/master/LICENSE)
8383
:versions:
84-
- 4.7.3
84+
- 4.7.4
8585
:when: 2022-09-01 23:05:33.298402277 Z
8686
- - :approve
8787
- FluentAssertions
@@ -778,19 +778,13 @@
778778
:versions:
779779
- 4.5.0
780780
:when: 2022-08-16 23:06:19.647254594 Z
781-
- - :approve
782-
- Minio
783-
- :who: mocsharp
784-
:why: Apache-2.0 (https://github.com/minio/minio-dotnet/raw/master/LICENSE)
785-
:versions:
786-
- 4.0.4
787-
:when: 2022-08-16 23:06:20.140413803 Z
788781
- - :approve
789782
- Minio
790783
- :who: mocsharp
791784
:why: Apache-2.0 (https://github.com/minio/minio-dotnet/raw/master/LICENSE)
792785
:versions:
793786
- 4.0.5
787+
- 4.0.6
794788
:when: 2022-08-16 23:06:20.598551507 Z
795789
- - :approve
796790
- Monai.Deploy.Messaging
@@ -1816,7 +1810,7 @@
18161810
- :who: mocsharp
18171811
:why: MIT (https://github.com/coverlet-coverage/coverlet/raw/master/LICENSE)
18181812
:versions:
1819-
- 3.1.2
1813+
- 3.2.0
18201814
:when: 2022-08-16 23:07:29.112978564 Z
18211815
- - :approve
18221816
- fo-dicom
@@ -2363,21 +2357,21 @@
23632357
- :who: mocsharp
23642358
:why: BSD 3-Clause License (https://github.com/NLog/NLog/raw/dev/LICENSE.txt)
23652359
:versions:
2366-
- 5.0.4
2360+
- 5.0.5
23672361
:when: 2022-10-12 03:14:06.538744982 Z
23682362
- - :approve
23692363
- NLog.Extensions.Logging
23702364
- :who: mocsharp
23712365
:why: BSD 2-Clause Simplified License (https://github.com/NLog/NLog.Extensions.Logging/raw/master/LICENSE)
23722366
:versions:
2373-
- 5.0.4
2367+
- 5.1.0
23742368
:when: 2022-10-12 03:14:06.964203977 Z
23752369
- - :approve
23762370
- NLog.Web.AspNetCore
23772371
- :who: mocsharp
23782372
:why: BSD 3-Clause License (https://github.com/NLog/NLog.Web/raw/master/LICENSE)
23792373
:versions:
2380-
- 5.1.4
2374+
- 5.1.5
23812375
:when: 2022-10-12 03:14:07.396706995 Z
23822376
- - :approve
23832377
- fo-dicom.NLog

docs/compliance/third-party-licenses.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -746,14 +746,14 @@ SOFTWARE.
746746

747747

748748
<details>
749-
<summary>DotNext 4.7.1</summary>
749+
<summary>DotNext 4.7.4</summary>
750750

751751
## DotNext
752752

753-
- Version: 4.7.1
753+
- Version: 4.7.4
754754
- Authors: .NET Foundation and Contributors
755755
- Project URL: https://dotnet.github.io/dotNext/
756-
- Source: [NuGet](https://www.nuget.org/packages/DotNext/4.7.1)
756+
- Source: [NuGet](https://www.nuget.org/packages/DotNext/4.7.4)
757757
- License: [MIT](https://github.com/dotnet/dotNext/raw/master/LICENSE)
758758

759759

@@ -824,14 +824,14 @@ SOFTWARE.
824824

825825

826826
<details>
827-
<summary>DotNext.Threading 4.7.1</summary>
827+
<summary>DotNext.Threading 4.7.4</summary>
828828

829829
## DotNext.Threading
830830

831-
- Version: 4.7.1
831+
- Version: 4.7.4
832832
- Authors: .NET Foundation and Contributors
833833
- Project URL: https://dotnet.github.io/dotNext/
834-
- Source: [NuGet](https://www.nuget.org/packages/DotNext.Threading/4.7.1)
834+
- Source: [NuGet](https://www.nuget.org/packages/DotNext.Threading/4.7.4)
835835
- License: [MIT](https://github.com/dotnet/dotNext/raw/master/LICENSE)
836836

837837

@@ -7098,14 +7098,14 @@ Apache License
70987098

70997099

71007100
<details>
7101-
<summary>Minio 4.0.5</summary>
7101+
<summary>Minio 4.0.6</summary>
71027102

71037103
## Minio
71047104

7105-
- Version: 4.0.5
7105+
- Version: 4.0.6
71067106
- Authors: MinIO, Inc.
71077107
- Project URL: https://github.com/minio/minio-dotnet
7108-
- Source: [NuGet](https://www.nuget.org/packages/Minio/4.0.5)
7108+
- Source: [NuGet](https://www.nuget.org/packages/Minio/4.0.6)
71097109
- License: [Apache-2.0](https://github.com/minio/minio-dotnet/raw/master/LICENSE)
71107110

71117111

@@ -8791,14 +8791,14 @@ SOFTWARE.
87918791

87928792

87938793
<details>
8794-
<summary>NLog 5.0.4</summary>
8794+
<summary>NLog 5.0.5</summary>
87958795

87968796
## NLog
87978797

8798-
- Version: 5.0.4
8798+
- Version: 5.0.5
87998799
- Authors: Jarek Kowalski,Kim Christensen,Julian Verdurmen
88008800
- Project URL: https://nlog-project.org/
8801-
- Source: [NuGet](https://www.nuget.org/packages/NLog/5.0.4)
8801+
- Source: [NuGet](https://www.nuget.org/packages/NLog/5.0.5)
88028802
- License: [BSD 3-Clause License](https://github.com/NLog/NLog/raw/dev/LICENSE.txt)
88038803

88048804

@@ -8839,14 +8839,14 @@ THE POSSIBILITY OF SUCH DAMAGE.
88398839

88408840

88418841
<details>
8842-
<summary>NLog.Extensions.Logging 5.0.4</summary>
8842+
<summary>NLog.Extensions.Logging 5.1.0</summary>
88438843

88448844
## NLog.Extensions.Logging
88458845

8846-
- Version: 5.0.4
8846+
- Version: 5.1.0
88478847
- Authors: Microsoft,Julian Verdurmen
88488848
- Project URL: https://github.com/NLog/NLog.Extensions.Logging
8849-
- Source: [NuGet](https://www.nuget.org/packages/NLog.Extensions.Logging/5.0.4)
8849+
- Source: [NuGet](https://www.nuget.org/packages/NLog.Extensions.Logging/5.1.0)
88508850
- License: [BSD 2-Clause Simplified License](https://github.com/NLog/NLog.Extensions.Logging/raw/master/LICENSE)
88518851

88528852

@@ -8880,14 +8880,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88808880

88818881

88828882
<details>
8883-
<summary>NLog.Web.AspNetCore 5.1.4</summary>
8883+
<summary>NLog.Web.AspNetCore 5.1.5</summary>
88848884

88858885
## NLog.Web.AspNetCore
88868886

8887-
- Version: 5.1.4
8887+
- Version: 5.1.5
88888888
- Authors: Julian Verdurmen
88898889
- Project URL: https://github.com/NLog/NLog.Web
8890-
- Source: [NuGet](https://www.nuget.org/packages/NLog.Web.AspNetCore/5.1.4)
8890+
- Source: [NuGet](https://www.nuget.org/packages/NLog.Web.AspNetCore/5.1.5)
88918891
- License: [BSD 3-Clause License](https://github.com/NLog/NLog.Web/raw/master/LICENSE)
88928892

88938893

@@ -27675,14 +27675,14 @@ accept this license. If you do not accept the license, do not use the software.
2767527675

2767627676

2767727677
<details>
27678-
<summary>coverlet.collector 3.1.2</summary>
27678+
<summary>coverlet.collector 3.2.0</summary>
2767927679

2768027680
## coverlet.collector
2768127681

27682-
- Version: 3.1.2
27682+
- Version: 3.2.0
2768327683
- Authors: tonerdo
2768427684
- Project URL: https://github.com/coverlet-coverage/coverlet
27685-
- Source: [NuGet](https://www.nuget.org/packages/coverlet.collector/3.1.2)
27685+
- Source: [NuGet](https://www.nuget.org/packages/coverlet.collector/3.2.0)
2768627686
- License: [MIT](https://github.com/coverlet-coverage/coverlet/raw/master/LICENSE)
2768727687

2768827688

src/CLI/Monai.Deploy.InformaticsGateway.CLI.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020
<OutputType>Exe</OutputType>
2121
<TargetFramework>net6.0</TargetFramework>
2222
<PublishSingleFile>true</PublishSingleFile>
23-
<SelfContained>true</SelfContained>
2423
<PublishTrimmed>false</PublishTrimmed>
2524
<PublishReadyToRun>true</PublishReadyToRun>
26-
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
27-
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
2825
<AssemblyName>mig-cli</AssemblyName>
2926
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
3027
<CodeAnalysisRuleSet>..\.sonarlint\project-monai_monai-deploy-informatics-gatewaycsharp.ruleset</CodeAnalysisRuleSet>

src/InformaticsGateway/Services/Storage/ObjectUploadService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ObjectUploadService(
6969

7070
}
7171

72-
private async Task BackgroundProcessing(CancellationToken cancellationToken)
72+
private void BackgroundProcessing(CancellationToken cancellationToken)
7373
{
7474
_logger.ServiceRunning(ServiceName);
7575
var tasks = new List<Task>();
@@ -111,7 +111,7 @@ private async Task StartWorker(int thread, CancellationToken cancellationToken)
111111
}
112112
catch (OperationCanceledException ex)
113113
{
114-
_logger.ServiceCancelled(ServiceName);
114+
_logger.ServiceCancelledWithException(ServiceName, ex);
115115
break;
116116
}
117117
catch (Exception ex)
@@ -123,9 +123,9 @@ private async Task StartWorker(int thread, CancellationToken cancellationToken)
123123

124124
public Task StartAsync(CancellationToken cancellationToken)
125125
{
126-
var task = Task.Run(async () =>
126+
var task = Task.Run(() =>
127127
{
128-
await BackgroundProcessing(cancellationToken);
128+
BackgroundProcessing(cancellationToken);
129129
}, CancellationToken.None);
130130

131131
Status = ServiceStatus.Running;

src/InformaticsGateway/appsettings.Test.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
},
1212
"messaging": {
1313
"publisherSettings": {
14-
"endpoint": "172.18.0.4",
14+
"endpoint": "172.28.0.1",
1515
"username": "rabbitmq",
1616
"password": "rabbitmq",
1717
"virtualHost": "monaideploy",
1818
"exchange": "monaideploy"
1919
},
2020
"subscriberSettings": {
21-
"endpoint": "172.18.0.4",
21+
"endpoint": "172.28.0.1",
2222
"username": "rabbitmq",
2323
"password": "rabbitmq",
2424
"virtualHost": "monaideploy",
@@ -31,7 +31,7 @@
3131
"bucketName": "monai",
3232
"temporaryBucketName": "monai",
3333
"settings": {
34-
"endpoint": "172.18.0.2:9000",
34+
"endpoint": "172.28.0.1:9000",
3535
"accessKey": "minioadmin",
3636
"accessToken": "minioadmin",
3737
"securedConnection": false,
@@ -59,4 +59,4 @@
5959
}
6060
}
6161
}
62-
}
62+
}

tests/Integration.Test/StepDefinitions/AcrApiStepDefinitions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ public async Task ThenAStudyIsUploadedToTheStorageService()
193193
{
194194
var minioClient = new MinioClient()
195195
.WithEndpoint(_configuration.StorageServiceOptions.Endpoint)
196-
.WithCredentials(_configuration.StorageServiceOptions.AccessKey, _configuration.StorageServiceOptions.AccessToken);
196+
.WithCredentials(_configuration.StorageServiceOptions.AccessKey, _configuration.StorageServiceOptions.AccessToken)
197+
.Build();
197198

198199
var dicomSizes = _scenarioContext[KeyDicomHashes] as Dictionary<string, string>;
199200
_rabbitMqHooks.MessageWaitHandle.Wait(MessageWaitTimeSpan).Should().BeTrue();

tests/Integration.Test/StepDefinitions/ExportServicesStepDefinitions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public async Task GivenDICOMInstances(int studyCount, string modality)
118118

119119
var minioClient = new MinioClient()
120120
.WithEndpoint(_configuration.StorageServiceOptions.Endpoint)
121-
.WithCredentials(_configuration.StorageServiceOptions.AccessKey, _configuration.StorageServiceOptions.AccessToken);
121+
.WithCredentials(_configuration.StorageServiceOptions.AccessKey, _configuration.StorageServiceOptions.AccessToken)
122+
.Build();
122123

123124
_outputHelper.WriteLine($"Uploading {fileSpecs.FileCount} files to MinIO...");
124125
foreach (var file in fileSpecs.Files)

0 commit comments

Comments
 (0)