Skip to content

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

Closed
Jose Perez Rodriguez (joperezr) wants to merge 2 commits into
mainfrom
joperezr-stackexchange-redis-3-migration
Closed

Jose Perez Rodriguez (joperezr) wants to merge 2 commits 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

@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

This comment has been minimized.

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.

@martincostello

Copy link
Copy Markdown
Contributor

FYI 3.2.0 contains some changes that break the OTel instrumentation package you have vendored. See 1.18.0-beta.3.

Resolve the StackExchange.Redis version conflict by retaining 3.2.0 while preserving all updates from main.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 684636d4-d7b1-4d3f-b91d-a338854bc778
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 22, 2026 18:14
@joperezr

Copy link
Copy Markdown
Member Author

PR #20047 merge-resolution validation

Resolution

  • Original PR head: 7577e324f671667a28a12fdbdb1f9b6920a36ef0.
  • Base merged and tested: d6bd440a74f3445fcc7a26b1ea055d7967cd0b0e (main).
  • Pushed merge commit: 719b21df38f27f223edc57e2ed6715296435c2db.
  • The only conflict was in Directory.Packages.props: retained this PR's intended StackExchange.Redis 3.2.0 upgrade rather than main's 2.13.17.
  • Preserved all other main changes. The resulting diff against the merged base contains only the original six PR files.
  • No unresolved index entries or whitespace errors in the PR diff; dependency XML and configuration schema JSON parse successfully.

Source validation

Tested the merged source directly, not an older dogfood artifact.

Coverage .NET 8 .NET 9 .NET 10 Result
Redis configuration binding, RESP3 default, RESP2 override, and null/empty argument validation 9 9 9 Passed
Azure Redis authentication, keyed/unkeyed registration, and non-Azure no-op behavior 3 3 3 Passed

All 36 selected tests passed. Quarantined and outerloop tests were excluded. The builds included the Redis client, distributed caching, output caching, and Azure Redis integrations.

The initial test invocation failed because the test runner duplicated a relative project path. Retrying with absolute project paths succeeded without source changes.

Remaining dependency caveat

Restore succeeded using the unchanged repository feed configuration, but the local package cache already contained StackExchange.Redis 3.2.0 and RESPite 3.2.0 originally downloaded from nuget.org. This is not evidence that clean CI restore is unblocked.

A direct check confirmed StackExchange.Redis 3.2.0 is now available on dotnet-public, but the feed returned package-not-found for RESPite. The PR's previously documented dependency-mirroring blocker therefore remains relevant. No feed changes, package workarounds, or imports were made.

Restore/build also reported existing NU1903 warnings for test dependency SSH.NET 2024.2.0.

Local evidence

  • redis-merge-restore.log
  • redis-merge-tests.log
  • redis-merge-azure-tests.log

No temporary application, server, or container was created.

@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


Selection computed for commit 719b21d.

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

🟡 Changes recommended

The approved feed still lacks required packages, and the migration documentation inaccurately characterizes RESP2 as restoring all v2 behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)


StackExchange.Redis 3 uses RESP3 by default for endpoints that support it. Typed operations are generally transparent, but applications that process `RedisResult` values from `Execute`, `ExecuteAsync`, `ScriptEvaluate`, or `ScriptEvaluateAsync` may observe different result types and structures.

To retain the StackExchange.Redis 2 behavior while migrating result-processing code, set `protocol=resp2` in the connection string:
@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.

3 participants