Repository navigation
Use home-based CLI cache and randomized socket paths - #15346
Conversation
Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15346Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15346" |
Code Review Comments🔴
|
|
The transient CI rerun workflow requested reruns for the following jobs after analyzing the failed attempt.
|
James Newton-King (JamesNK)
left a comment
There was a problem hiding this comment.
See inline comments. Main issues: missing homeDirectory passthrough in GetGlobalPackagesFolderPath, tautological test, and duplicated random hash logic.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Updates Aspire CLI pathing to use a stable home-based layout (~/.aspire/cli) for managed NuGet cache and runtime sockets, and refreshes backchannel socket naming to include a stable AppHost hash plus per-instance randomness.
Changes:
- Introduces
CliPathHelperto centralize~/.aspire/clisubpaths and create randomized socket paths. - Updates backchannel socket naming/parsing to support current + previous + legacy formats.
- Adjusts NuGet.config merge logic and tests to use the new CLI-local global packages folder layout.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs | Adds coverage for new CLI home paths and randomized socket naming. |
| tests/Aspire.Cli.Tests/Utils/AppHostHelperTests.cs | Extends socket parsing tests for current/previous backchannel formats. |
| tests/Aspire.Cli.Tests/Packaging/PackagingServiceTests.cs | Updates expectations for globalPackagesFolder to new CLI-local cache location. |
| src/Shared/BackchannelConstants.cs | Switches AppHost hash to xxHash-based stable ID and adds per-instance socket randomness; updates matching/parsing helpers. |
| src/Aspire.Cli/Utils/CliPathHelper.cs | New helper for CLI home/runtime/socket/NuGet cache paths + randomized socket creation. |
| src/Aspire.Cli/Utils/AppHostHelper.cs | Updates docs to reflect the new socket naming shape. |
| src/Aspire.Cli/Projects/AppHostServerProject.cs | Uses CliPathHelper.CreateSocketPath("apphost.sock") instead of temp/deterministic paths. |
| src/Aspire.Cli/Program.cs | Uses CliPathHelper.GetAspireHomeDirectory() for ~/.aspire resolution. |
| src/Aspire.Cli/Packaging/NuGetConfigMerger.cs | Computes per-channel global packages folder under ~/.aspire/cli/nuget/packages/{id} and threads optional home override through. |
| src/Aspire.Cli/DotNet/DotNetCliRunner.cs | Uses CliPathHelper.CreateSocketPath("cli.sock") for CLI-managed runtime sockets. |
| src/Aspire.Cli/Aspire.Cli.csproj | Adds System.IO.Hashing package reference to support xxHash usage. |
Co-authored-by: Copilot <[email protected]>
|
Addressed the compatibility concerns from #15346 (comment) in 8c771c5. |
Co-authored-by: Copilot <[email protected]>
I don't think this is a real problem. SHA256 never shipped, no? It's true this PR breaks compatibility but not with a released version. |
James Newton-King (JamesNK)
left a comment
There was a problem hiding this comment.
LGTM — just one minor indentation nit on the XML doc.
|
James Newton-King (@JamesNK) I didn't realize that, I trusted the comment, will check and react then |
I approved PR, but this should be fixed before merge. |
So this was added in b645e6f7f which I believe was not shipped (Jan 23rd) |
Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Follow-up: I removed the legacy SHA-256 discovery fallback in d247f31 after verifying that the SHA-256 socket format never shipped in a tagged 13.x release. The format existed on release/13.2, but it is not contained in any shipped v13.* tag, so we do not need a cross-version fallback for released CLI/AppHost combinations. |
Jose Perez Rodriguez (joperezr)
left a comment
There was a problem hiding this comment.
This looks good to me. Let me know when ready to merge.
Co-authored-by: Copilot <[email protected]>
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
🎬 CLI E2E Test Recordings — 53 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23300548423 |
1fab1b1
into
release/13.2
Description
Updates the Aspire CLI to keep its managed NuGet package cache and runtime socket paths under
~/.aspire/cliinstead of temp locations.This also makes the socket layout explicit:
~/.aspire/cli/runtime/sockets/with randomized names such ascli.sock.{id}andapphost.sock.{id}.~/.aspire/cli/backchannels/auxi.sock.{appHostHash}.{instanceId}.{pid}.The stable
{appHostHash}is derived with xxHash so the CLI can cheaply rediscover sockets for the same AppHost path without treating the value as a security boundary. The per-instance{instanceId}is random so socket names are not deterministic across runs, which reduces collisions and makes them harder to guess than a path-only scheme while keeping the overall path short.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: