feat: add redis connect callback, upgrade dot10 from preview#755
feat: add redis connect callback, upgrade dot10 from preview#755
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds a Redis connection callback feature while also updating several package versions and making StackExchange.Redis API compatibility changes.
Key Changes
- Added
connectConfigcallback parameter to Redis cache initialization methods, allowing custom configuration of the Redis connection after it's established - Updated various package versions including Aliyun SDKs, EFCore providers, and DistributedLock packages to use centralized version variables
- Updated StackExchange.Redis API usage to explicitly wrap channel strings in
RedisChannelobjects withPatternMode.Auto
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Updated MicrosoftPackageVersion for .NET 10.0 and replaced IdentityModelPackageVersion with NewtonsoftJsonVersion |
| Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj | Updated Aliyun SDK package versions |
| Masa.Contrib.RulesEngine.MicrosoftRulesEngine.csproj | Replaced hardcoded Newtonsoft.Json version with centralized version variable |
| Masa.Contrib.Data.EFCore.SqlServer.csproj | Added Azure.Identity and Microsoft.Identity.Client packages conditionally for .NET 7.0 |
| Masa.Contrib.Data.EFCore.Pomelo.MySql.csproj | Updated Pomelo.EntityFrameworkCore.MySql version patterns for .NET 9.0 and .NET 10.0 |
| Masa.Contrib.Data.EFCore.Oracle.csproj | Removed conditional version selection for .NET 10.0, now uses MicrosoftPackageVersion for all targets |
| Masa.Contrib.Data.EFCore.Cosmos.csproj | Added conditional Newtonsoft.Json dependency for .NET 6.0-8.0 |
| Masa.Contrib.Data.DistributedLock.Medallion.*.csproj (8 files) | Updated DistributedLock package versions to use centralized MedallionDistributedLockPackageVersion variable |
| MasaConfigurationExtensions.cs | Added connectConfig parameter to UseDcc extension methods |
| RedisCacheClientBase.cs | Added connectConfig callback invocation during Redis connection initialization; changed connection field type to ConnectionMultiplexer |
| RedisCacheClient.cs | Added connectConfig parameter; updated null checks to use EqualityComparer; wrapped channel strings in RedisChannel objects; added null safety improvements |
| RedisConfigurationOptions.cs | Updated ChannelPrefix assignment to wrap in RedisChannel object |
| RedisValueExtensions.cs | Added null-forgiving operator for byte array cast |
| DistributedCacheBuilderExtensions.cs | Added connectConfig parameter to all UseStackExchangeRedisCache overloads |
| ComponentConfigUtils.cs | Added null-forgiving operator for rootSectionName |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ntrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj
Outdated
Show resolved
Hide resolved
...ntrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj
Outdated
Show resolved
Hide resolved
...ntrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj
Outdated
Show resolved
Hide resolved
...ata.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj
Outdated
Show resolved
Hide resolved
| <MicrosoftPackageVersion Condition="'$(TargetFramework)' == 'net8.0'">8.*</MicrosoftPackageVersion> | ||
| <MicrosoftPackageVersion Condition="'$(TargetFramework)' == 'net9.0'">9.*</MicrosoftPackageVersion> | ||
| <MicrosoftPackageVersion Condition="'$(TargetFramework)' == 'net10.0'">10.0.0-preview.*</MicrosoftPackageVersion> | ||
| <MicrosoftPackageVersion Condition="'$(TargetFramework)' == 'net10.0'">10.*</MicrosoftPackageVersion> |
There was a problem hiding this comment.
The PR title indicates "feat: add redis connect callback", but this PR also includes numerous package version updates (Aliyun SDK, EFCore providers, DistributedLock packages, etc.) and StackExchange.Redis API compatibility changes (RedisChannel wrapper). These changes appear unrelated to the redis connection callback feature. Consider either updating the PR title to reflect all changes, or splitting these changes into separate PRs for better maintainability and easier review.
...hing/Distributed/Masa.Contrib.Caching.Distributed.StackExchangeRedis/RedisCacheClientBase.cs
Outdated
Show resolved
Hide resolved
| <DaprPackageVersion>1.10.0</DaprPackageVersion> | ||
| <GoogleProtobufPackageVersion>3.19.1</GoogleProtobufPackageVersion> | ||
| <MedallionDistributedLockPackageVersion>1.0.4</MedallionDistributedLockPackageVersion> | ||
| <MedallionDistributedLockPackageVersion>1.0.*</MedallionDistributedLockPackageVersion> |
There was a problem hiding this comment.
The change to MedallionDistributedLockPackageVersion from a fixed version (1.0.4) to a floating range (1.0.*) introduces supply chain risk because future builds will automatically consume any new 1.0.x release without explicit review. If an attacker compromises the package publisher or distribution channel, a malicious 1.0.x version could be pulled into your builds and run with access to your application's secrets and data. Prefer pinning this dependency to a specific, vetted version and updating it deliberately as part of a controlled dependency management process.
|



No description provided.