add WithModule extension methods to IResourceBuilder<RedisResource>#18025
add WithModule extension methods to IResourceBuilder<RedisResource>#18025aradalvand wants to merge 5 commits into
WithModule extension methods to IResourceBuilder<RedisResource>#18025Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18025Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18025" |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-class support for loading Redis modules via resource annotations so Redis containers can be started with --loadmodule entries.
Changes:
- Collect
RedisModuleAnnotationannotations to append--loadmodule <path>arguments when starting Redis - Add
WithModule(...)builder extensions for loading modules by preinstalled native module enum or explicit.sopath - Introduce
RedisNativeModulemapping to container module paths
|
@microsoft-github-policy-service agree |
1 similar comment
|
@microsoft-github-policy-service agree |
|
@aradalvand this doesn't build and there lots of AI comments on here.
Code samples help with this... I think we need to see this in action first to see if it works well locally and what happens when you attempt to deploy. Right now, it doesn't compile. |
Expose a single polyglot-only union overload for Redis WithModule, keep typed C# overloads public, and add test/polyglot coverage for the new API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
I submitted a bacth of fixes, including polyglot support |
Reject custom Redis module paths unless they are absolute container paths ending in .so, and cover invalid values in unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR Testing ReportPR Information
Verification RequestThis verifies the concerns raised in #18025 (comment):
CLI / Package Source UsedThe official dogfood installer was retried, but the selected PR workflow run still has no downloadable CLI artifacts: To complete the missing runtime validation, I built a local hive from the PR checkout at the tested commit and used that CLI/package layout for the AppHost SDK, Redis hosting package, DCP, dashboard, and local run. Local hive CLI version: Source Build and Unit VerificationScenario 1: Redis hosting project buildObjective: Confirm the PR compiles after the review fixes. ./restore.sh
dotnet build src/Aspire.Hosting.Redis/Aspire.Hosting.Redis.csproj --no-restore /p:SkipNativeBuild=trueResult: Scenario 2: Focused Redis
|
| Scenario | Status | Notes |
|---|---|---|
| Redis hosting project build | Passed | 0 warnings, 0 errors |
Focused WithModule tests |
Passed | 10 tests passed |
| Generated AppHost API usage | Passed | Native and custom module calls compile |
| Manifest publish output | Passed | Includes both --loadmodule args |
aspire publish pipeline |
Passed | 4/4 steps succeeded |
| Local Redis runtime startup | Passed | Redis 8.6 started with ReJSON loaded |
| Invalid path validation | Passed | Invalid paths fail fast |
| Official dogfood artifact install | Blocked externally | PR workflow currently has no CLI artifacts |
Overall Result
Verified with local PR-built hive. The PR now builds, the new API works in generated AppHost code, invalid input fails fast, publish/manifest output carries the Redis module arguments correctly, and Redis starts locally with the native JSON module loaded.
Ensure enums referenced only through AspireUnion alternatives are included in the scanned enum type set so polyglot SDK generation can emit them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
Adds
WithModuleextension methods toIResourceBuilder<RedisResource>so Redis containers can load Redis 8+ native modules or custom Redis module.sofiles.Fixes #9768
The public C# API keeps strongly typed overloads, while polyglot app hosts get a single exported
withModulemethod that accepts either aRedisNativeModulevalue or a custom module path.Custom module paths are validated as absolute container paths ending in
.so.Checklist
<remarks />and<code />elements on your triple slash comments?