feat(redis): add AddRedisConfigurationOptionsProvider factory overload - #87
Merged
Merged
Conversation
Adds a first-class way to plug in a custom IRedisConfigurationOptionsProvider via a factory delegate, instead of manually pre-registering it so the default TryAdd registration backs off. Uses Services.Replace, so it is order-independent relative to AddRedisConnection — the supplied factory always wins whether called before or after. Full suite green on net8.0 and net10.0 (1178/1178 each). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
cosmin-staicu
requested review from
alinahornet,
cosminvlad,
litheon,
lucianaparaschivei and
razvalex
as code owners
July 16, 2026 20:57
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
|
alinahornet
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds a first-class way to inject a custom
IRedisConfigurationOptionsProvidervia a factory delegate, instead of the current workaround (manually pre-registering your provider so the defaultTryAddregistration backs off).Changes
RedisCollectionExtensions.AddRedisConfigurationOptionsProvider(this ICachingBuilder, Func<IServiceProvider, IRedisConfigurationOptionsProvider>). It usesServices.Replace, so it is order-independent relative toAddRedisConnection— the supplied factory always wins whether called before or after (the default is registered withTryAddTransient). Null factory throwsArgumentNullException.PublicAPI.Unshipped.txtupdated for the new public method.[Unreleased] / Added.Notes
This is the config-options provider (builds the
ConfigurationOptionsfromRedisConnectionOptions). It's independent of the connection-multiplexer factory hooks (RedisConnectionOptions.ConnectionMultiplexerFactoryType/ConnectionFactory) and ofIRedisConnectionConfigurator(the per-connectConfigurationOptionsmutation hook for auth). This just makes replacing the provider a documented one-liner rather than a DI-ordering trick.Test plan
dotnet test)New
RedisConfigurationOptionsProviderFactoryTestscovers: factory wins when registered afterAddRedisConnection, factory wins when registered before, default provider used when no factory registered, and null-factory throws. Full suite green on net8.0 and net10.0 (1178/1178 each).Linked issues
Fixes #
Contributor declaration
git commit -s).🤖 Generated with Claude Code