Skip to content

feat(redis): add AddRedisConfigurationOptionsProvider factory overload - #87

Merged
cosmin-staicu merged 1 commit into
mainfrom
feat/redis-config-provider-factory
Jul 17, 2026
Merged

feat(redis): add AddRedisConfigurationOptionsProvider factory overload#87
cosmin-staicu merged 1 commit into
mainfrom
feat/redis-config-provider-factory

Conversation

@cosmin-staicu

Copy link
Copy Markdown
Member

Summary

Adds a first-class way to inject a custom IRedisConfigurationOptionsProvider via a factory delegate, instead of the current workaround (manually pre-registering your provider so the default TryAdd registration backs off).

builder.AddRedisConfigurationOptionsProvider(sp => new MyConfigProvider(
    sp.GetRequiredService<ILoggerFactory>(),
    sp.GetRequiredService<IOptions<RedisConnectionOptions>>()));

Changes

  • New RedisCollectionExtensions.AddRedisConfigurationOptionsProvider(this ICachingBuilder, Func<IServiceProvider, IRedisConfigurationOptionsProvider>). It uses Services.Replace, so it is order-independent relative to AddRedisConnection — the supplied factory always wins whether called before or after (the default is registered with TryAddTransient). Null factory throws ArgumentNullException.
  • PublicAPI.Unshipped.txt updated for the new public method.
  • CHANGELOG entry under [Unreleased] / Added.

Notes

This is the config-options provider (builds the ConfigurationOptions from RedisConnectionOptions). It's independent of the connection-multiplexer factory hooks (RedisConnectionOptions.ConnectionMultiplexerFactoryType / ConnectionFactory) and of IRedisConnectionConfigurator (the per-connect ConfigurationOptions mutation hook for auth). This just makes replacing the provider a documented one-liner rather than a DI-ordering trick.

Test plan

  • Unit tests added/updated
  • Integration tests pass locally (dotnet test)
  • CHANGELOG.md updated

New RedisConfigurationOptionsProviderFactoryTests covers: factory wins when registered after AddRedisConnection, 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

  • I signed off my commits per the DCO (git commit -s).
  • I am contributing on behalf of my employer, or in the course of employment / using employer resources.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the needs-cla-review A maintainer should assess whether a signed CLA is required (see CONTRIBUTING.md) label Jul 16, 2026
@github-actions

Copy link
Copy Markdown

🔎 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

  • adds public API surface (PublicAPI.Unshipped.txt in src/UiPath.Caching)

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.

  • If a CLA is needed → add the cla-required label (a contributor comment with signing steps is posted automatically).
  • If it is not needed → replace needs-cla-review with cla-not-required so later pushes don't re-flag it.

@sonarqubecloud

Copy link
Copy Markdown

@cosmin-staicu
cosmin-staicu merged commit bb053c1 into main Jul 17, 2026
10 checks passed
@cosmin-staicu
cosmin-staicu deleted the feat/redis-config-provider-factory branch July 17, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cla-review A maintainer should assess whether a signed CLA is required (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants