Skip to content

[release/13.5] Resolve dotnet paths in doctor checks - #19263

Merged
Jose Perez Rodriguez (joperezr) merged 6 commits into
release/13.5from
backport/pr-19232-to-release/13.5
Aug 12, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 6 commits into
release/13.5from
backport/pr-19232-to-release/13.5

Conversation

@aspire-repo-bot

@aspire-repo-bot aspire-repo-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Backport of #19232 to release/13.5

/cc James Newton-King (@JamesNK)

Customer Impact

The .NET SDK and deprecated-workload checks can launch an unresolved dotnet executable instead of the executable selected from PATH, making aspire doctor results unreliable in affected environments.

Testing

DotNetSdkInstallerTests and DeprecatedWorkloadCheckTests: 32 passed. Mutation verification confirmed both new tests fail with bare dotnet and pass with path resolution restored. Source PR CI passed.

Risk

Low. The change is localized to executable resolution for two doctor checks and preserves their existing process lifecycle and cancellation behavior.

Regression?

Unknown - please confirm.

Copilot AI balanced review requested due to automatic review settings August 12, 2026 02:10
@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 -- 19263

Or

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

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.

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

This PR updates CLI checks to invoke dotnet via a resolved executable path (including dotnet.exe on Windows), and adds tests to verify the resolved path is used.

Changes:

  • Resolve the dotnet executable path and pass it into process start info for SDK and workload checks
  • Introduce IEnvironment dependency and a process-start injectable delegate to improve testability
  • Add/adjust tests to assert the resolved dotnet path is used

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tests/Aspire.Cli.Tests/Utils/DeprecatedWorkloadCheckTests.cs Adds a test asserting DeprecatedWorkloadCheck uses the resolved dotnet path
tests/Aspire.Cli.Tests/DotNetSdkInstallerTests.cs Refactors installer construction in tests and adds a resolved-path assertion test
src/Aspire.Cli/Utils/EnvironmentChecker/DeprecatedWorkloadCheck.cs Uses resolved dotnet path and injects environment + start-process delegate
src/Aspire.Cli/DotNet/DotNetSdkInstaller.cs Adds executable path resolution and updates process start creation to use it

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

Comment on lines +124 to +125
internal static string ResolveDotNetPath(IEnvironment environment) =>
PathLookupHelper.ResolveExecutablePath(environment.IsWindows() ? "dotnet.exe" : "dotnet");
/// Users with this workload installed may encounter conflicts or confusion.
/// </remarks>
internal sealed class DeprecatedWorkloadCheck(ILogger<DeprecatedWorkloadCheck> logger) : IEnvironmentCheck
internal sealed class DeprecatedWorkloadCheck(ILogger<DeprecatedWorkloadCheck> logger, IEnvironment environment) : IEnvironmentCheck
var processInfo = new ProcessStartInfo
{
FileName = "dotnet",
FileName = DotNetSdkInstaller.ResolveDotNetPath(environment),
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

2 / 100 test projects · 5 jobs, from 4 changed files.

Selected test projects (2 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected jobs (5)

cli-starter, deployment-e2e, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/DotNetSdkInstallerTests.cs (changed test)
1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Utils/DeprecatedWorkloadCheckTests.cs (changed test)
1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter • affected project Aspire.Cli
• selected test Aspire.Cli.Tests
deployment-e2e affected project Aspire.Cli
extension-e2e src/Aspire.Cli/DotNet/DotNetSdkInstaller.cs, src/Aspire.Cli/Utils/EnvironmentChecker/DeprecatedWorkloadCheck.cs, tests/Aspire.Cli.Tests/DotNetSdkInstallerTests.cs, tests/Aspire.Cli.Tests/Utils/DeprecatedWorkloadCheckTests.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit b856688.

@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.

@joperezr

Copy link
Copy Markdown
Member

Good hardening improvement. Approved.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit b80778f into release/13.5 Aug 12, 2026
685 of 687 checks passed
@joperezr
Jose Perez Rodriguez (joperezr) deleted the backport/pr-19232-to-release/13.5 branch August 12, 2026 21:40
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.5 milestone Aug 12, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

Step 5 branch taken: "excluded → head_branch_is_backport, title_release_prefix, body_backport_marker, base_branch_is_release"

This PR is a backport and is out of scope for docs generation per Step 5's exclusion rule.

  • excluded: true in .pr-docs-check/signals.json
  • exclusion_reasons: head_branch_is_backport, title_release_prefix, body_backport_marker, base_branch_is_release
  • Triggered signals (informational only, does not override exclusion): pr_body_has_deprecation_marker (PR body mentions "deprecated-workload checks")

Documentation for this change, if needed, should be authored against the original forward PR (#19232) on the default branch, not duplicated here for the backport.

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-cli Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants