From c2834dc3082add5270feb928d6c847b5e7e6520f Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Tue, 19 Nov 2024 09:29:46 +0100 Subject: [PATCH 1/8] chore(deps): upgrade packages to resolve security vulnerability warnings --- .../Atc.Cosmos.EventStore.csproj | 16 ++++++++-------- .../Atc.Cosmos.EventStore.Cqrs.Tests.csproj | 12 ++++++------ ...Atc.Cosmos.EventStore.IntegrationTests.csproj | 12 ++++++------ .../Atc.Cosmos.EventStore.Tests.csproj | 12 ++++++------ 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj b/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj index a60f81d..879c40f 100644 --- a/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj +++ b/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj @@ -16,14 +16,14 @@ - - - - - - - - + + + + + + + + diff --git a/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj b/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj index 344165f..ae9feff 100644 --- a/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj +++ b/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj @@ -6,15 +6,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj b/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj index 4dbcbbb..89045b5 100644 --- a/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj +++ b/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj @@ -6,15 +6,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj b/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj index 0ffa593..82fce1e 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj +++ b/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj @@ -6,15 +6,15 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 4397cce39aa472d0572c407f6f049b89532587c5 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Tue, 19 Nov 2024 09:30:06 +0100 Subject: [PATCH 2/8] chore: target .net 9.0 in test projects --- .../Atc.Cosmos.EventStore.Cqrs.Tests.csproj | 2 +- .../Atc.Cosmos.EventStore.IntegrationTests.csproj | 2 +- .../Atc.Cosmos.EventStore.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj b/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj index ae9feff..e77b84c 100644 --- a/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj +++ b/test/Atc.Cosmos.EventStore.Cqrs.Tests/Atc.Cosmos.EventStore.Cqrs.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net9.0 false diff --git a/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj b/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj index 89045b5..58afc86 100644 --- a/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj +++ b/test/Atc.Cosmos.EventStore.IntegrationTests/Atc.Cosmos.EventStore.IntegrationTests.csproj @@ -1,7 +1,7 @@ - net7.0 + net9.0 false diff --git a/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj b/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj index 82fce1e..5f3743f 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj +++ b/test/Atc.Cosmos.EventStore.Tests/Atc.Cosmos.EventStore.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net9.0 false From 9749f61f87d16226917bb082d35e80c3cd0763e3 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Tue, 19 Nov 2024 09:30:26 +0100 Subject: [PATCH 3/8] chore: switch to default code analysis mode --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 5a094fb..15612a6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -27,7 +27,7 @@ - AllEnabledByDefault + Default true latest true From aca86d24b3519fdf06c8e607c9e89848b1dbdf1c Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Tue, 19 Nov 2024 09:31:27 +0100 Subject: [PATCH 4/8] chore: resolve xunit warning regarding bypassing parallelization limits --- .../Streams/StreamInfoReaderTests.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/Atc.Cosmos.EventStore.Tests/Streams/StreamInfoReaderTests.cs b/test/Atc.Cosmos.EventStore.Tests/Streams/StreamInfoReaderTests.cs index dd5b655..5c3339b 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Streams/StreamInfoReaderTests.cs +++ b/test/Atc.Cosmos.EventStore.Tests/Streams/StreamInfoReaderTests.cs @@ -23,8 +23,7 @@ internal async Task Should_Convert_Into_StreamResponse( .ReturnsForAnyArgs(expectedMetadata); var info = await sut - .ReadAsync(streamId, cancellationToken) - .ConfigureAwait(false); + .ReadAsync(streamId, cancellationToken); info .State @@ -57,8 +56,7 @@ internal async Task Should_Read_Metadata_From_Stream( .ReturnsForAnyArgs(expectedMetadata); await sut - .ReadAsync(streamId, cancellationToken) - .ConfigureAwait(false); + .ReadAsync(streamId, cancellationToken); _ = metadataReader .Received(1) From d01ca2cacc0a9e4e37ea7c9f3f2b61eac027a907 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Wed, 20 Nov 2024 08:30:35 +0100 Subject: [PATCH 5/8] chore(deps): upgrade Microsoft.Azure.Cosmo to v3.46.0 --- src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj b/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj index 879c40f..0af316c 100644 --- a/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj +++ b/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj @@ -17,7 +17,7 @@ - + From b1958ff7a76803bd2ab8a93626ccc28ff652005d Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Wed, 20 Nov 2024 08:41:52 +0100 Subject: [PATCH 6/8] chore: disable newtonsoft.json check As suggested from a build error and from the release notes of the Cosmos SDK v3.46.0 See https://github.com/Azure/azure-cosmos-dotnet-v3/releases/tag/3.46.0 --- src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj b/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj index 0af316c..3dbece5 100644 --- a/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj +++ b/src/Atc.Cosmos.EventStore/Atc.Cosmos.EventStore.csproj @@ -9,6 +9,8 @@ true Portable $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true From 65d62b3ce7d94ca35039f2ebf266d4824c7df710 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Wed, 20 Nov 2024 08:56:01 +0100 Subject: [PATCH 7/8] chore: use .net 9.0 in builb agents --- .github/workflows/release-preview.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- .github/workflows/verification.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml index 6835c7b..4b73b27 100644 --- a/.github/workflows/release-preview.yml +++ b/.github/workflows/release-preview.yml @@ -28,10 +28,10 @@ jobs: - name: ⚙️ Setup GIT versioning uses: dotnet/nbgv@v0.4.0 - - name: ⚙️ Setup dotnet 7.0.x + - name: ⚙️ Setup dotnet 9.0.x uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0.x' + dotnet-version: '9.0.x' - name: 🛠️ Building library in release mode run: dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf90c5e..f1d686a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,10 +59,10 @@ jobs: with: setAllVars: true - - name: ⚙️ Setup dotnet 7.0.x + - name: ⚙️ Setup dotnet 9.0.x uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0.x' + dotnet-version: '9.0.x' - name: 🛠️ Update changelog uses: thomaseizinger/keep-a-changelog-new-release@1.2.1 diff --git a/.github/workflows/verification.yml b/.github/workflows/verification.yml index c1228c3..47f3240 100644 --- a/.github/workflows/verification.yml +++ b/.github/workflows/verification.yml @@ -33,10 +33,10 @@ jobs: with: setAllVars: true - - name: ⚙️ Setup dotnet 7.0.x + - name: ⚙️ Setup dotnet 9.0.x uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0.x' + dotnet-version: '9.0.x' - name: 🛠️ Building libraries in release mode run: dotnet build -c release -p:ContinuousIntegrationBuild=true From 53abb8636a2e7bc70fcbfd847553af4719820bc1 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Wed, 20 Nov 2024 09:09:09 +0100 Subject: [PATCH 8/8] fix: failing tests due to serialization indentation options --- .../Converters/EventDataConverterPipelineBuilderTests.cs | 3 +-- .../Converters/FaultedEventDataConverterTests.cs | 6 ++---- .../Converters/NamedEventConverterTests.cs | 3 +-- .../Converters/UnknownEventDataConverterTests.cs | 6 ++---- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/test/Atc.Cosmos.EventStore.Tests/Converters/EventDataConverterPipelineBuilderTests.cs b/test/Atc.Cosmos.EventStore.Tests/Converters/EventDataConverterPipelineBuilderTests.cs index a66c37e..2e24e07 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Converters/EventDataConverterPipelineBuilderTests.cs +++ b/test/Atc.Cosmos.EventStore.Tests/Converters/EventDataConverterPipelineBuilderTests.cs @@ -14,7 +14,6 @@ public class EventDataConverterPipelineBuilderTests [Theory, AutoNSubstituteData] internal void Should_Call_All_Converters_InReverseOrder( IEventMetadata metadata, - JsonSerializerOptions options, FakeEventDataConverter[] converters, FakeEventDataConverter converter, EventDataConverterPipelineBuilder sut) @@ -22,7 +21,7 @@ internal void Should_Call_All_Converters_InReverseOrder( .AddConverter(converter) .AddConverters(converters) .Build() - .Convert(metadata, doc.RootElement, options) + .Convert(metadata, doc.RootElement, new JsonSerializerOptions()) .Should() .Be(string.Join(string.Empty, new[] { converter }.Concat(converters).Select(c => c.Val))); } diff --git a/test/Atc.Cosmos.EventStore.Tests/Converters/FaultedEventDataConverterTests.cs b/test/Atc.Cosmos.EventStore.Tests/Converters/FaultedEventDataConverterTests.cs index 274b85f..937c431 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Converters/FaultedEventDataConverterTests.cs +++ b/test/Atc.Cosmos.EventStore.Tests/Converters/FaultedEventDataConverterTests.cs @@ -14,14 +14,13 @@ public class FaultedEventDataConverterTests [Theory, AutoNSubstituteData] internal void Should_Return_Converted_Value( IEventMetadata metadata, - JsonSerializerOptions options, string expected, FaultedEventDataConverter sut) => sut .Convert( metadata, doc.RootElement, - options, + new JsonSerializerOptions(), () => expected) .Should() .Be(expected); @@ -29,14 +28,13 @@ internal void Should_Return_Converted_Value( [Theory, AutoNSubstituteData] internal void Should_Return_FaultedEvent_When_Exception_IsThrown( IEventMetadata metadata, - JsonSerializerOptions options, KeyNotFoundException exception, FaultedEventDataConverter sut) => sut .Convert( metadata, doc.RootElement, - options, + new JsonSerializerOptions(), () => throw exception) .Should() .BeEquivalentTo( diff --git a/test/Atc.Cosmos.EventStore.Tests/Converters/NamedEventConverterTests.cs b/test/Atc.Cosmos.EventStore.Tests/Converters/NamedEventConverterTests.cs index 913e4ff..a731f7e 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Converters/NamedEventConverterTests.cs +++ b/test/Atc.Cosmos.EventStore.Tests/Converters/NamedEventConverterTests.cs @@ -18,7 +18,6 @@ public class NamedEventConverterTests internal void Should_Return_Value_FromNext_When_TypeName_IsNotFound( [Frozen] IEventTypeProvider typeProvider, IEventMetadata metadata, - JsonSerializerOptions options, string expected, NamedEventConverter sut) { @@ -30,7 +29,7 @@ internal void Should_Return_Value_FromNext_When_TypeName_IsNotFound( .Convert( metadata, doc.RootElement, - options, + new JsonSerializerOptions(), () => expected) .Should() .Be(expected); diff --git a/test/Atc.Cosmos.EventStore.Tests/Converters/UnknownEventDataConverterTests.cs b/test/Atc.Cosmos.EventStore.Tests/Converters/UnknownEventDataConverterTests.cs index 74529be..4651141 100644 --- a/test/Atc.Cosmos.EventStore.Tests/Converters/UnknownEventDataConverterTests.cs +++ b/test/Atc.Cosmos.EventStore.Tests/Converters/UnknownEventDataConverterTests.cs @@ -14,14 +14,13 @@ public class UnknownEventDataConverterTests [Theory, AutoNSubstituteData] internal void Should_Return_Converted_Value_Id_NotNull( IEventMetadata metadata, - JsonSerializerOptions options, string expected, UnknownEventDataConverter sut) => sut .Convert( metadata, doc.RootElement, - options, + new JsonSerializerOptions(), () => expected) .Should() .Be(expected); @@ -29,13 +28,12 @@ internal void Should_Return_Converted_Value_Id_NotNull( [Theory, AutoNSubstituteData] internal void Should_Return_UnknownEvent_When_Value_IsNot_Converted( IEventMetadata metadata, - JsonSerializerOptions options, UnknownEventDataConverter sut) => sut .Convert( metadata, doc.RootElement, - options, + new JsonSerializerOptions(), () => null) .Should() .BeEquivalentTo(