Release/v1.1.0#39
Conversation
…ckRedisTrackerExtensionsState
…ockGrpcTrackerExtensionsState
…te parameters and streamline initialization
…net-10 Feature/upgrade to dotnet 10
…ency-injection-strategy Feature/improve dependency injection strategy
…move installation step
…ation-tests-to-dotnet-10 Feature/upgrade integration tests to dotnet 10
📝 WalkthroughWalkthroughUpdates projects to support .NET 10 across workflows and target frameworks. Refactors distributed lock extensions to use consolidated state containers replacing multiple static fields. Updates Docker images to stable .NET versions and migrates to docker compose CLI. Upgrades dependencies and integration test configurations. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/ReactiveLock.Tests/ReactiveLockRedisTrackerExtensions.cs (1)
32-47:⚠️ Potential issue | 🟡 MinorReset Redis extension state after this test.
This test leaves the static ExtensionsState populated because it never calls
UseDistributedRedisReactiveLockAsync, which can leak into other Redis tests and make them order-dependent. Consider clearing it in afinallyblock.♻️ Suggested cleanup
public async Task AddDistributedRedisReactiveLock_RegistersDependencies() { var services = new ServiceCollection(); services.AddSingleton(Mock.Of<IConnectionMultiplexer>()); services.AddSingleton(Mock.Of<IReactiveLockTrackerFactory>()); services.InitializeDistributedRedisReactiveLock("instance-x"); services.AddDistributedRedisReactiveLock("lock-x"); var provider = services.BuildServiceProvider(); - - // assert no registration failure - Assert.NotNull(provider.GetService<IConnectionMultiplexer>()); + try + { + // assert no registration failure + Assert.NotNull(provider.GetService<IConnectionMultiplexer>()); + } + finally + { + // clear static state for other tests + new ServiceCollection().InitializeDistributedRedisReactiveLock(string.Empty); + } }
🤖 Fix all issues with AI agents
In @.github/workflows/k6-test-single.yml:
- Around line 149-156: The "Append Docker Compose Logs" step runs an unguarded
`cd $PROJECT_FOLDER && docker compose logs` which can fail the job; remove that
unguarded invocation (or make it non-fatal) and rely on the guarded redirect
that appends to comment.md (the `cd $PROJECT_FOLDER && docker compose logs >>
comment.md || true` line) so the step never fails if `docker compose logs` exits
non-zero. Edit the step so only the guarded command runs (or add `|| true` /
`set +e` to the earlier call) to ensure the step cannot fail due to a non‑zero
exit from `docker compose logs`.
In `@src/ReactiveLock.Tests/ReactiveLockGrpcTrackerExtensionsTests.cs`:
- Around line 82-109: The test
AddDistributedGrpcReactiveLock_ThrowsWhenControllerAccessed initializes static
gRPC extension state but never clears it; wrap the Act & Assert in a try/finally
(or add a finally) and reset the static ExtensionsState (the class used by
InitializeDistributedGrpcReactiveLock/ AddDistributedGrpcReactiveLock) in the
finally so the static state is cleared after the test runs to avoid leaking into
other tests.
In `@test/integration/dotnet-csharp-grpc/src/backend/backend.csproj`:
- Line 15: Update the PackageReference for Microsoft.Extensions.Http.Polly in
the backend.csproj: locate the PackageReference element with
Include="Microsoft.Extensions.Http.Polly" and change its Version attribute from
"10.0.0" to "10.0.2" so the project uses the latest stable release.
In `@test/integration/dotnet-csharp-grpc/src/backend/Dockerfile`:
- Around line 9-16: The Dockerfile's aspnet base image reference ("FROM
mcr.microsoft.com/dotnet/aspnet:10.0.2-alpine3.22 AS base") uses a non-existent
tag; update that FROM line to a valid tag such as
"mcr.microsoft.com/dotnet/aspnet:10.0-alpine3.22" or
"mcr.microsoft.com/dotnet/aspnet:10.0-alpine" so the base image resolves,
keeping the existing SDK stage ("FROM
mcr.microsoft.com/dotnet/sdk:10.0.102-alpine3.22-aot AS build") and any
runtime-deps tags unchanged.
In `@test/integration/dotnet-csharp-redis/src/backend/backend.csproj`:
- Line 14: Update the Microsoft.Extensions.Http.Polly PackageReference version
from 10.0.0 to 10.0.2; locate the PackageReference element for
"Microsoft.Extensions.Http.Polly" in the project (the existing line with
PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.0") and
change the Version attribute to "10.0.2" so the project uses the latest stable
release.
In `@test/integration/dotnet-csharp-redis/src/backend/Dockerfile`:
- Line 9: The publish step is missing an explicit RuntimeIdentifier which can
cause inconsistent AOT builds; update the publish invocation (the dotnet publish
command referenced in the Dockerfile/build pipeline) to include
/p:RuntimeIdentifier=linux-musl-x64 or add
<RuntimeIdentifier>linux-musl-x64</RuntimeIdentifier> to the backend.csproj
alongside the existing <PublishAot>true</PublishAot> so the AOT SDK builds
target linux-musl explicitly; also plan to move off alpine3.22 to 3.23+ due to
end-of-support.
In
`@test/integration/dotnet-csharp-redis/src/backend/Service/PaymentSummaryService.cs`:
- Around line 52-54: The consumer is casting RedisValue to byte[] before
deserializing, but the producer serialized a string; in PaymentSummaryService
change the Select projection to treat the RedisValue as a string and call
JsonSerializer.Deserialize<PaymentInsertParameters>((string)v!,
JsonContext.Default.PaymentInsertParameters) (or use v.ToString()) instead of
casting to byte[] so the deserialization type matches the producer's
JsonSerializer.Serialize output.



Summary by CodeRabbit
New Features
Chores