Skip to content

Breaking change: update StackExchange.Redis to 3.2.0 - #20047

Draft
Jose Perez Rodriguez (joperezr) wants to merge 1 commit into
mainfrom
joperezr-stackexchange-redis-3-migration
Draft

Breaking change: update StackExchange.Redis to 3.2.0#20047
Jose Perez Rodriguez (joperezr) wants to merge 1 commit into
mainfrom
joperezr-stackexchange-redis-3-migration

Conversation

@joperezr

Copy link
Copy Markdown
Member

Description

Updates StackExchange.Redis from 2.13.1 to 3.2.0 as a separate change so the customer-visible protocol default can be reviewed, released, and rolled back independently from routine third-party dependency updates.

StackExchange.Redis 3 rewrites its internal I/O implementation and defaults supported endpoints to RESP3. Aspire now explicitly preserves that default in its custom options provider, while continuing to honor protocol=resp2 and ConfigurationOptions.Protocol overrides.

Redis 3.2 also exposes experimental and compile-time-obsolete ConfigurationOptions properties that cannot be visited by the .NET configuration binding source generator. This change:

  • binds through an AOT-compatible forwarding options type containing supported settings;
  • excludes experimental, obsolete, and non-bindable settings from the generated configuration schema;
  • keeps IConnectionMultiplexer registration and Microsoft.Azure.StackExchangeRedis authentication behavior unchanged;
  • documents the RESP3 migration and RESP2 opt-out.

Dependency blocker

This draft is not ready to merge because the approved dotnet-public feed does not yet contain:

  • StackExchange.Redis 3.2.0 (nearest available version is 3.1.31)
  • RESPite 3.2.0, a new exact transitive dependency of StackExchange.Redis 3.2.0

The internal package migration queue is paused after pipeline run 3072323 failed its intermediate quarantine. No external feed or fallback source is added by this PR. The packages must be imported through the approved dotnet-migrate-package pipeline before this PR can restore in CI.

Validation

  • Built Aspire.StackExchange.Redis, distributed caching, and output caching for .NET 8, .NET 9, and .NET 10 using the published packages from nuget.org for pre-mirror validation.
  • Added focused tests for supported configuration binding, the RESP3 default, and the RESP2 opt-out across .NET 8, .NET 9, and .NET 10.
  • Ran Aspire.Microsoft.Azure.StackExchangeRedis.Tests across .NET 8, .NET 9, and .NET 10.
  • Built the Redis playground containing Redis, Garnet, and Valkey resources.
  • Confirmed an approved-feed-only restore fails specifically because StackExchange.Redis 3.2.0 is not mirrored.

Fixes # (issue)

Breaking changes

Old default: StackExchange.Redis 2.13 uses RESP2 for non-Azure-Managed-Redis endpoints and RESP3 for Azure Managed Redis endpoints.

New default: StackExchange.Redis 3 uses RESP3 for every endpoint that supports it. Servers that do not support RESP3 fall back to RESP2.

Most typed IDatabase and cache operations are transparent. Users are affected when they or a library process raw RedisResult values from:

  • Execute / ExecuteAsync
  • ScriptEvaluate / ScriptEvaluateAsync
  • Lua scripts, modules, or ad-hoc commands whose RESP3 reply shape differs from RESP2

RESP3 can return richer types or different structures, such as maps instead of nested arrays. Applications should validate raw command and script result handling under RESP3. StackExchange.Redis 3.2 also enforces AllowAdmin for admin commands issued through Execute / ExecuteAsync.

To temporarily preserve the previous protocol while migrating:

localhost:6379,protocol=resp2

or:

builder.AddRedisClient(
    "cache",
    configureOptions: options => options.Protocol = RedisProtocol.Resp2);

This opt-out should be applied only where raw result handling requires it; Aspire does not blanket-disable RESP3. Redis Enterprise requires a RESP3-capable version (7.2 or later). Garnet and Valkey support RESP3, but applications using product-specific commands should validate those commands independently.

Rollback is an independent revert of this PR, restoring the StackExchange.Redis 2.13.x package and its prior protocol defaults.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20047

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20047"

@joperezr Jose Perez Rodriguez (joperezr) added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Sep 10, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 10, 2026 19:20
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

Selects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching 'Directory.Packages.props' selects ALL

Advisory workflow impact (4)

  • Aspire.Deployment.EndToEnd.Tests (deployment workflow-only)
  • Aspire.EndToEnd.Tests (outerloop-only)
  • Aspire.Oracle.EntityFrameworkCore.Tests (outerloop-only)
  • deployment-e2e (schedule/dispatch-only)

Selection computed for commit 7577e32.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Required packages remain unavailable on the approved feed, preventing CI restore and verification.

Review tier: Balanced
Findings: None

What changed in this PR

Updates the Redis client integration to StackExchange.Redis 3.2.0 while preserving RESP3 defaults and RESP2 overrides.

Changes:

  • Adds AOT-compatible configuration forwarding and schema exclusions.
  • Documents RESP3 migration and opt-out behavior.
  • Adds protocol and configuration-binding tests.
File Description
Directory.Packages.props Updates StackExchange.Redis to 3.2.0.
AspireRedisExtensions.cs Adds RESP3 defaults and supported-option forwarding.
AssemblyInfo.cs Excludes unsupported schema properties.
ConfigurationSchema.json Adds newly supported Redis options.
README.md Documents RESP3 migration guidance.
AspireRedisProtocolTests.cs Tests binding and protocol selection.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-integrations Issues pertaining to Aspire Integrations packages breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants