Skip to content

Commit 3baf672

Browse files
feat: Add .NET 10 (#373)
* Add .NET 10 --------- Co-authored-by: Copilot <[email protected]>
1 parent 1715b39 commit 3baf672

File tree

8 files changed

+37
-18
lines changed

8 files changed

+37
-18
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
framework: [net8.0, net9.0]
29+
framework: [net8.0, net9.0, net10.0]
3030
os: [ubuntu-latest, windows-latest]
3131
runs-on: ${{ matrix.os }}
3232
name: scan-vulnerabilities/${{ matrix.os }}/${{ matrix.framework }}
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v5
3636
with:
3737
ref: ${{ github.event.inputs.ref || github.ref }}
3838
- name: Install dotnet SDKs
39-
uses: actions/setup-dotnet@v3
39+
uses: actions/setup-dotnet@v5
4040
with:
4141
dotnet-version: |
4242
8.0.x
4343
9.0.x
44+
10.0.x
4445
- name: Scan for Vulnerabilities
4546
shell: bash
4647
run: |
@@ -57,7 +58,7 @@ jobs:
5758
name: publish
5859
steps:
5960
- name: Checkout
60-
uses: actions/checkout@v3
61+
uses: actions/checkout@v5
6162
with:
6263
ref: ${{ github.event.inputs.ref || github.ref }}
6364
fetch-depth: 0
@@ -78,11 +79,12 @@ jobs:
7879
echo "version=${version}" >> $GITHUB_OUTPUT
7980
8081
- name: Install dotnet SDKs
81-
uses: actions/setup-dotnet@v3
82+
uses: actions/setup-dotnet@v5
8283
with:
8384
dotnet-version: |
8485
8.0.x
8586
9.0.x
87+
10.0.x
8688
8789
- name: Dotnet Pack
8890
shell: bash

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ jobs:
8484
strategy:
8585
fail-fast: false
8686
matrix:
87-
framework: [ net8.0, net9.0 ]
87+
framework: [ net8.0, net9.0, net10.0 ]
8888
test: [ Streams, PersistentSubscriptions, Operations, UserManagement, ProjectionManagement, Security, Diagnostics, Misc ]
8989

9090
runs-on: ubuntu-latest
9191

9292
steps:
9393
- name: Checkout
94-
uses: actions/checkout@v4
94+
uses: actions/checkout@v5
9595
with:
9696
fetch-depth: 0
9797

@@ -117,11 +117,12 @@ jobs:
117117
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
118118

119119
- name: Install dotnet SDKs
120-
uses: actions/setup-dotnet@v3
120+
uses: actions/setup-dotnet@v5
121121
with:
122122
dotnet-version: |
123123
8.0.x
124124
9.0.x
125+
10.0.x
125126
126127
- name: Run Tests
127128
shell: bash

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks>net48;net8.0;net9.0</TargetFrameworks>
3+
<TargetFrameworks>net48;net8.0;net9.0;net10.0</TargetFrameworks>
44
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
55
<Nullable>enable</Nullable>
66
<NullableContextOptions>enable</NullableContextOptions>

src/KurrentDB.Client/KurrentDB.Client.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<PackageReference Include="Grpc.Net.Client" Version="2.67.0"/>
1313
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0"/>
1414
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="9.0.0"/>
15-
<PackageReference Include="System.Linq.Async" Version="6.0.1"/>
1615
<PackageReference Include="OpenTelemetry.Api" Version="1.12.0"/>
1716

1817
<PackageReference Include="Grpc.StatusProto" Version="2.71.0" />
@@ -22,6 +21,8 @@
2221
<PrivateAssets>all</PrivateAssets>
2322
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2423
</PackageReference>
24+
25+
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.0" />
2526
</ItemGroup>
2627

2728
<ItemGroup>
@@ -73,4 +74,9 @@
7374
<ItemGroup>
7475
<None Remove="KurrentDB.Client.csproj.DotSettings"/>
7576
</ItemGroup>
77+
78+
<ItemGroup>
79+
<Compile Remove="Core\Common\Shims\Index.cs" />
80+
<Compile Remove="Core\Common\Shims\Range.cs" />
81+
</ItemGroup>
7682
</Project>

src/KurrentDB.Client/PersistentSubscriptions/PersistentSubscription.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal static async Task<PersistentSubscription> Confirm(
2828
.Messages
2929
.GetAsyncEnumerator(cancellationToken);
3030

31-
var result = await enumerator.MoveNextAsync(cancellationToken).ConfigureAwait(false);
31+
var result = await enumerator.MoveNextAsync().ConfigureAwait(false);
3232

3333
return (result, enumerator.Current) switch {
3434
(true, PersistentSubscriptionMessage.SubscriptionConfirmation (var subscriptionId)) =>
@@ -118,7 +118,7 @@ private async Task Subscribe() {
118118
_log.LogDebug("Persistent Subscription {subscriptionId} confirmed.", SubscriptionId);
119119

120120
try {
121-
while (await _enumerator.MoveNextAsync(_cts.Token).ConfigureAwait(false)) {
121+
while (await _enumerator.MoveNextAsync().ConfigureAwait(false)) {
122122
if (_enumerator.Current is not PersistentSubscriptionMessage.Event(var resolvedEvent, var retryCount)) {
123123
continue;
124124
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// ReSharper disable once CheckNamespace
2+
namespace KurrentDB.Client.Tests;
3+
4+
public static class AsyncEnumerableExtensions {
5+
public static async Task ForEachAwaitAsync<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, Task> action, CancellationToken cancellationToken = default) {
6+
await foreach (var element in source.WithCancellation(cancellationToken)) {
7+
await action(element);
8+
}
9+
}
10+
}

test/KurrentDB.Client.Tests/PersistentSubscriptions/SubscribeToAll/SubscribeToAllTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ public async Task connect_with_retries() {
209209
// Act
210210
var subscription = Fixture.Subscriptions.SubscribeToAll(group, userCredentials: TestCredentials.Root);
211211
var retryCount = await subscription.Messages.OfType<PersistentSubscriptionMessage.Event>()
212-
.SelectAwait(
213-
async e => {
212+
.Select(
213+
async (PersistentSubscriptionMessage.Event e, CancellationToken _) => {
214214
if (e.RetryCount > 4) {
215215
await subscription.Ack(e.ResolvedEvent);
216216
} else {
@@ -430,8 +430,8 @@ await Fixture.Subscriptions.CreateToAllAsync(
430430
}
431431

432432
await subscription!.Messages.OfType<PersistentSubscriptionMessage.Event>()
433-
.SelectAwait(
434-
async e => {
433+
.Select(
434+
async (PersistentSubscriptionMessage.Event e, CancellationToken ct) => {
435435
await subscription.Ack(e.ResolvedEvent);
436436
return e;
437437
}

test/KurrentDB.Client.Tests/PersistentSubscriptions/SubscribeToStream/SubscribeToStreamTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ await Fixture.Subscriptions.CreateToStreamAsync(
338338
await using var subscription = Fixture.Subscriptions.SubscribeToStream(stream, group, userCredentials: TestCredentials.Root);
339339
await Fixture.Streams.AppendToStreamAsync(stream, StreamState.NoStream, events);
340340
var retryCount = await subscription.Messages.OfType<PersistentSubscriptionMessage.Event>()
341-
.SelectAwait(
342-
async e => {
341+
.Select(
342+
async (PersistentSubscriptionMessage.Event e, CancellationToken _) => {
343343
if (e.RetryCount > 4) {
344344
await subscription.Ack(e.ResolvedEvent);
345345
} else {

0 commit comments

Comments
 (0)