Skip to content

Commit

Permalink
Bump Mongo client to v3, update DicomTypeTranslation (#2006)
Browse files Browse the repository at this point in the history
* Bump Mongo client to v3, add explicit hostname for lone Mongo cluster member to avoid DNS issues

* Update MongoExtractJobStoreTest.cs

Reset test extraction DB for each unit test

* Update MongoExtractJobStoreTest.cs

Reset MockSessionHandle each unit test too

* Update MongoExtractJobStoreTest.cs

Reset mock doc store when resetting mock Mongo client

* Try updating HIC.DicomTypeTranslation

* Update lock files

* Remove transitive fo-dicom version override

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jas88 and pre-commit-ci[bot] authored Nov 19, 2024
1 parent d41ce76 commit d2e7d24
Show file tree
Hide file tree
Showing 20 changed files with 337 additions and 525 deletions.
8 changes: 5 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="CsvHelper" Version="33.0.1" />
<PackageVersion Include="Equ" Version="2.3.0" />
<PackageVersion Include="HIC.DicomTypeTranslation" Version="4.1.3" />
<PackageVersion Include="fo-dicom" Version="5.1.4" />
<PackageVersion Include="fo-dicom.Imaging.ImageSharp" Version="5.1.4" />
<PackageVersion Include="HIC.DicomTypeTranslation" Version="4.1.5" />
<PackageVersion Include="HIC.FAnsiSql" Version="3.2.7" />
<PackageVersion Include="HIC.RDMP.Dicom" Version="7.1.0" />
<PackageVersion Include="HIC.RDMP.Plugin" Version="8.3.0" />
Expand All @@ -17,8 +19,8 @@
<PackageVersion Include="LineReader" Version="0.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageVersion Include="MongoDB.Bson" Version="2.30.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.30.0" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NLog" Version="5.3.4" />
<PackageVersion Include="RabbitMQ.Client" Version="6.8.1" />
Expand Down
2 changes: 2 additions & 0 deletions SmiServices.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CHANGELOG.md = CHANGELOG.md
docs\DataLoading.md = docs\DataLoading.md
data\microserviceConfigs\default.yaml = data\microserviceConfigs\default.yaml
.github\dependabot.yml = .github\dependabot.yml
Directory.Build.props = Directory.Build.props
global.json = global.json
Glossary.md = Glossary.md
PACKAGES.md = PACKAGES.md
.github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
README.md = README.md
SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
data\logging\Smi.NLog.config = data\logging\Smi.NLog.config
Expand Down
2 changes: 1 addition & 1 deletion bin/smi/startDockerLinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main() -> int:
cmd = (
docker, "exec",
"mongodb",
"/usr/bin/mongo", "--eval", "rs.initiate()",
"/usr/bin/mongo", "--eval", 'rs.initiate({_id:"rs0",members:[{_id:0,host:"localhost:27017"}]})',
)
C.run(cmd)

Expand Down
173 changes: 63 additions & 110 deletions src/SmiServices/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
},
"HIC.DicomTypeTranslation": {
"type": "Direct",
"requested": "[4.1.3, )",
"resolved": "4.1.3",
"contentHash": "Sbr7iijnajCjeHHXIAlM7nV4z69F6lEA2EGS4ZtvM9h+DYvZSysnLRWNiO3lNOnWqhx7Gl5z3bPGxVBz6J6YBQ==",
"requested": "[4.1.5, )",
"resolved": "4.1.5",
"contentHash": "w6mcvJLkl4l3/FbbyXAATQwttko8BKT2WPsiYHM6KKBjlAlJusjxDBXiEbAcF0ybi0QeDrEt6Y8K6GvipW/XjA==",
"dependencies": {
"HIC.FAnsiSql": "3.2.6",
"MongoDB.Driver": "2.28.0",
"NLog": "5.3.2",
"HIC.FAnsiSql": "3.2.7",
"MongoDB.Driver": "3.0.0",
"NLog": "5.3.4",
"Newtonsoft.Json": "13.0.3",
"YamlDotNet": "16.0.0",
"fo-dicom": "5.1.3"
"YamlDotNet": "16.1.3",
"fo-dicom": "5.1.4"
}
},
"HIC.FAnsiSql": {
Expand Down Expand Up @@ -152,24 +152,27 @@
},
"MongoDB.Bson": {
"type": "Direct",
"requested": "[2.30.0, )",
"resolved": "2.30.0",
"contentHash": "Gg0TQUT3IEntcqdug5a9P6d8iwL5CqOpQjVBCq1hxTbkjxdGdY6a2CPv7II44AO9GYUnORYsS6dDME2b7aqYyg==",
"requested": "[3.0.0, )",
"resolved": "3.0.0",
"contentHash": "qnPRJ58HXDh7C4oxTf6YB7BJhlCGJIa6TMXhzImw6zk44lrAomQXTB6AtoQ5lNJbkyrgQcT7+smsKFMnXmLXhw==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Runtime.CompilerServices.Unsafe": "5.0.0"
}
},
"MongoDB.Driver": {
"type": "Direct",
"requested": "[2.30.0, )",
"resolved": "2.30.0",
"contentHash": "BCG8cNF0+U3h5f/O9fu3ktrYhoESBDems1w06PExfYrn2KjHBHCBdvBRY1cIbysnZVjQAJjGtFV9XgW+hXt7Hg==",
"requested": "[3.0.0, )",
"resolved": "3.0.0",
"contentHash": "udcP8rOhyuhLDn3sGVdNUgQSXfKGPaIP4w09XVKf4xdy66YSXinhkIuQSuOeZVHdTFsG2PpUbRx2wyFm7E0EMg==",
"dependencies": {
"DnsClient": "1.6.1",
"Microsoft.Extensions.Logging.Abstractions": "2.0.0",
"MongoDB.Bson": "2.30.0",
"MongoDB.Driver.Core": "2.30.0",
"MongoDB.Libmongocrypt": "1.12.0"
"MongoDB.Bson": "3.0.0",
"SharpCompress": "0.30.1",
"Snappier": "1.0.0",
"System.Buffers": "4.5.1",
"ZstdSharp.Port": "0.7.3"
}
},
"Newtonsoft.Json": {
Expand Down Expand Up @@ -293,8 +296,8 @@
},
"CommunityToolkit.HighPerformance": {
"type": "Transitive",
"resolved": "8.2.2",
"contentHash": "+zIp8d3sbtYaRbM6hqDs4Ui/z34j7DcUmleruZlYLE4CVxXq+MO8XJyIs42vzeTYFX+k0Iq1dEbBUnQ4z/Gnrw=="
"resolved": "8.3.2",
"contentHash": "1Os81ua0FmIOtiSgOk5C1KBraQ3SDfxs/7BG4qDagm48nGplr//lAVqLH9I2TLDVqRFdhqTUaEITFA5Ho/Ovkw=="
},
"DnsClient": {
"type": "Transitive",
Expand Down Expand Up @@ -324,33 +327,6 @@
"resolved": "51.1.0",
"contentHash": "Vm3eGvHACns0zsKfCMCZdZSFKYu2ajV/GeRk4vfgy6d5AR+WqSUjaSWbbhkmS01A8OMjZHFLduPH7nxwGvlcpQ=="
},
"fo-dicom": {
"type": "Transitive",
"resolved": "5.1.3",
"contentHash": "MOV8novKkhcXa/vURDNwlXC387ZzOflTpAnp2Filn3c355T63jDGVF0WHg0ar3QBKl8efDBrzkX/l+vhsHmpMg==",
"dependencies": {
"CommunityToolkit.HighPerformance": "8.2.2",
"Microsoft.Bcl.AsyncInterfaces": "6.0.0",
"Microsoft.Bcl.HashCode": "1.1.1",
"Microsoft.Extensions.DependencyInjection": "6.0.1",
"Microsoft.Extensions.Logging": "6.0.0",
"Microsoft.Extensions.Options": "6.0.0",
"System.Buffers": "4.5.1",
"System.Text.Encoding.CodePages": "6.0.0",
"System.Text.Encodings.Web": "6.0.0",
"System.Text.Json": "6.0.9",
"System.Threading.Channels": "6.0.0"
}
},
"fo-dicom.Imaging.ImageSharp": {
"type": "Transitive",
"resolved": "5.1.3",
"contentHash": "nKpcbSfYNN9emzm3Q3NpWGxM5v8Eww3lvM7vWd9a+AmgKy8TtmcbHuZSPYqd6aMnTibEErXhDPkjts+fzbvYMQ==",
"dependencies": {
"SixLabors.ImageSharp": "3.1.4",
"fo-dicom": "5.1.3"
}
},
"HIC.SynthEHR": {
"type": "Transitive",
"resolved": "2.0.1",
Expand Down Expand Up @@ -389,8 +365,8 @@
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
"resolved": "8.0.0",
"contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw=="
},
"Microsoft.Bcl.HashCode": {
"type": "Transitive",
Expand Down Expand Up @@ -615,27 +591,6 @@
"System.Security.Principal.Windows": "5.0.0"
}
},
"MongoDB.Driver.Core": {
"type": "Transitive",
"resolved": "2.30.0",
"contentHash": "oepDgu24lo44SljuHmIQ99x6jHISnMC4tLfzQGniQg39xiMD8nxalm1HM9RDZcuZbbWa4F6YLt2AIhWkny3XWA==",
"dependencies": {
"AWSSDK.SecurityToken": "3.7.100.14",
"DnsClient": "1.6.1",
"Microsoft.Extensions.Logging.Abstractions": "2.0.0",
"MongoDB.Bson": "2.30.0",
"MongoDB.Libmongocrypt": "1.12.0",
"SharpCompress": "0.30.1",
"Snappier": "1.0.0",
"System.Buffers": "4.5.1",
"ZstdSharp.Port": "0.7.3"
}
},
"MongoDB.Libmongocrypt": {
"type": "Transitive",
"resolved": "1.12.0",
"contentHash": "B1X51jrtNacKvxKoaqWeknYeJfQS5aWf6BmVLT5JZerz3AUXFzv8edPskJYqBc3kLy1J2PWzMqqsnyb9g8FtcA=="
},
"MySqlConnector": {
"type": "Transitive",
"resolved": "2.3.7",
Expand Down Expand Up @@ -968,20 +923,13 @@
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "6.0.9",
"contentHash": "2j16oUgtIzl7Xtk7demG0i/v5aU/ZvULcAnJvPb63U3ZhXJ494UYcxuEj5Fs49i3XDrk5kU/8I+6l9zRCw3cJw==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "6.0.0"
}
"resolved": "8.0.5",
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg=="
},
"System.Threading.Channels": {
"type": "Transitive",
Expand Down Expand Up @@ -1026,6 +974,35 @@
"resolved": "0.7.3",
"contentHash": "U9Ix4l4cl58Kzz1rJzj5hoVTjmbx1qGMwzAcbv1j/d3NzrFaESIurQyg+ow4mivCgkE3S413y+U9k4WdnEIkRA=="
},
"fo-dicom": {
"type": "CentralTransitive",
"requested": "[5.1.4, )",
"resolved": "5.1.4",
"contentHash": "9tnbXaMmCu2FRM47TbYBwVo02pr2+7O5cPGcmLGVbdTH2hbe2AYgh6ce44zgjWJh0XDpLng8UM6OQbgqfzd9Fg==",
"dependencies": {
"CommunityToolkit.HighPerformance": "8.3.2",
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
"Microsoft.Bcl.HashCode": "1.1.1",
"Microsoft.Extensions.DependencyInjection": "6.0.1",
"Microsoft.Extensions.Logging": "6.0.0",
"Microsoft.Extensions.Options": "6.0.0",
"System.Buffers": "4.5.1",
"System.Text.Encoding.CodePages": "6.0.0",
"System.Text.Encodings.Web": "8.0.0",
"System.Text.Json": "8.0.5",
"System.Threading.Channels": "6.0.0"
}
},
"fo-dicom.Imaging.ImageSharp": {
"type": "CentralTransitive",
"requested": "[5.1.4, )",
"resolved": "5.1.3",
"contentHash": "nKpcbSfYNN9emzm3Q3NpWGxM5v8Eww3lvM7vWd9a+AmgKy8TtmcbHuZSPYqd6aMnTibEErXhDPkjts+fzbvYMQ==",
"dependencies": {
"SixLabors.ImageSharp": "3.1.4",
"fo-dicom": "5.1.3"
}
},
"Spectre.Console": {
"type": "CentralTransitive",
"requested": "[0.49.1, )",
Expand Down Expand Up @@ -1097,11 +1074,6 @@
"System.Security.Principal.Windows": "5.0.0"
}
},
"MongoDB.Libmongocrypt": {
"type": "Transitive",
"resolved": "1.12.0",
"contentHash": "B1X51jrtNacKvxKoaqWeknYeJfQS5aWf6BmVLT5JZerz3AUXFzv8edPskJYqBc3kLy1J2PWzMqqsnyb9g8FtcA=="
},
"runtime.any.System.Collections": {
"type": "Transitive",
"resolved": "4.3.0",
Expand Down Expand Up @@ -1521,11 +1493,8 @@
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
},
"System.Threading": {
"type": "Transitive",
Expand Down Expand Up @@ -1603,11 +1572,6 @@
"System.Security.Principal.Windows": "5.0.0"
}
},
"MongoDB.Libmongocrypt": {
"type": "Transitive",
"resolved": "1.12.0",
"contentHash": "B1X51jrtNacKvxKoaqWeknYeJfQS5aWf6BmVLT5JZerz3AUXFzv8edPskJYqBc3kLy1J2PWzMqqsnyb9g8FtcA=="
},
"runtime.any.System.Collections": {
"type": "Transitive",
"resolved": "4.3.0",
Expand Down Expand Up @@ -2027,11 +1991,8 @@
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
},
"System.Threading": {
"type": "Transitive",
Expand Down Expand Up @@ -2109,11 +2070,6 @@
"System.Security.Principal.Windows": "5.0.0"
}
},
"MongoDB.Libmongocrypt": {
"type": "Transitive",
"resolved": "1.12.0",
"contentHash": "B1X51jrtNacKvxKoaqWeknYeJfQS5aWf6BmVLT5JZerz3AUXFzv8edPskJYqBc3kLy1J2PWzMqqsnyb9g8FtcA=="
},
"runtime.any.System.Collections": {
"type": "Transitive",
"resolved": "4.3.0",
Expand Down Expand Up @@ -2443,11 +2399,8 @@
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
},
"System.Threading": {
"type": "Transitive",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void MapperSource_IntegrationTest(DatabaseType dbType)
Assert.That(guidTable?.GetRowCount(), Is.EqualTo(0), "No temporary guids should exist yet");
Assert.That(map.GetRowCount(), Is.EqualTo(1), "We should have a mapping table with 1 entry");
});
if (guidTable is null) return; // We've actually failed and aborted already at this point, but the compiler doesn't know that

guidTable.Insert(new Dictionary<string, object>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public void SetupProducer_InvalidBackoffProvider_Throws()
// Act
// Assert
var exc = Assert.Throws<ArgumentException>(() => broker.SetupProducer(producerOptions));
Assert.That(exc.Message, Is.EqualTo("Could not parse 'Foo' to a valid BackoffProviderType"));
Assert.That(exc?.Message, Is.EqualTo("Could not parse 'Foo' to a valid BackoffProviderType"));
}

[Test]
Expand Down
4 changes: 2 additions & 2 deletions tests/SmiServices.IntegrationTests/Common/OptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void GlobalOptionsFactory_Load_EmptyFile_ThrowsWithUsefulMessage()
var globalOptionsFactory = new GlobalOptionsFactory();

var exc = Assert.Throws<Exception>(() => globalOptionsFactory.Load(nameof(GlobalOptionsFactory_Load_EmptyFile_ThrowsWithUsefulMessage), "foo.yaml", fileSystem));
Assert.That(exc.Message, Is.EqualTo("Did not deserialize a GlobalOptions object from the provided YAML file. Does it contain at least one valid key?"));
Assert.That(exc?.Message, Is.EqualTo("Did not deserialize a GlobalOptions object from the provided YAML file. Does it contain at least one valid key?"));
}

[Test]
Expand All @@ -102,7 +102,7 @@ public void GlobalOptionsFactory_Load_MissingFile_ThrowsWithUsefulMessage()
var globalOptionsFactory = new GlobalOptionsFactory();

var exc = Assert.Throws<ArgumentException>(() => globalOptionsFactory.Load(nameof(GlobalOptionsFactory_Load_EmptyFile_ThrowsWithUsefulMessage), "foo.yaml", fileSystem));
Assert.That(exc.Message, Is.EqualTo("Could not find config file 'foo.yaml'"));
Assert.That(exc?.Message, Is.EqualTo("Could not find config file 'foo.yaml'"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ public void Test_Cache1Hit1Miss(DatabaseType dbType)
{
Assert.That(swapper.GetSubstitutionFor("0202020202", out reason), Is.EqualTo(answer2));

Assert.That(guidTable.GetRowCount(), Is.EqualTo(1));
Assert.That(guidTable.GetDataTable().Rows[0]["CHI"], Is.EqualTo("0202020202"));
Assert.That(guidTable.GetDataTable().Rows[0]["guid"], Is.EqualTo(answer2));
Assert.That(guidTable?.GetRowCount(), Is.EqualTo(1));
Assert.That(guidTable?.GetDataTable().Rows[0]["CHI"], Is.EqualTo("0202020202"));
Assert.That(guidTable?.GetDataTable().Rows[0]["guid"], Is.EqualTo(answer2));
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void Test_WhereField_NotFound()

TestContext.Out.WriteLine(ex?.Message);

Assert.That(ex.Message, Is.EqualTo("Could not find any tables to update that matched the field set UpdateValuesMessage: WhereFields=Blarg WriteIntoFields=PatientID"));
Assert.That(ex?.Message, Is.EqualTo("Could not find any tables to update that matched the field set UpdateValuesMessage: WhereFields=Blarg WriteIntoFields=PatientID"));
}

[Test]
Expand All @@ -171,7 +171,7 @@ public void Test_WriteIntoFields_NotFound()

TestContext.Out.WriteLine(ex?.Message);

Assert.That(ex.Message, Is.EqualTo("Could not find any tables to update that matched the field set UpdateValuesMessage: WhereFields=PatientID WriteIntoFields=Blarg"));
Assert.That(ex?.Message, Is.EqualTo("Could not find any tables to update that matched the field set UpdateValuesMessage: WhereFields=PatientID WriteIntoFields=Blarg"));
}


Expand Down
Loading

0 comments on commit d2e7d24

Please sign in to comment.