Skip to content

Report configuration source availability in aspire doctor - #21677

Merged
James Newton-King (JamesNK) merged 2 commits into
jamesnk/config-source-brownfieldfrom
jamesnk/doctor-config-sources
Nov 2, 2026
Merged

James Newton-King (JamesNK) merged 2 commits into
jamesnk/config-source-brownfieldfrom
jamesnk/doctor-config-sources

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Description

Existing AppHosts do not currently tell users when an organization configuration source is available but has not been adopted. aspire doctor now reports machine source availability and the current AppHost's saved configuration-source choice, with a non-blocking suggestion to run aspire update when no choice has been recorded.

PR stack: main -> #21678 (brownfield adoption) -> this doctor PR.

Stacked PR: depends on #21678 and targets jamesnk/config-source-brownfield, which contains brownfield adoption and persisted configSource.optOut support. This PR adds only the doctor diagnostics and their supporting discovery extraction, tests, localization, and documentation.

  • Report environment-variable and Microsoft-employee source candidates, including their discovery origin.
  • Report an AppHost's saved binding or explicit opt-out without suggesting adoption.
  • Include stable diagnostic names and metadata in JSON output.
  • Reuse doctor's shallow AppHost discovery and extract candidate resolution without consent prompts, Git acquisition, remote-version checks, or configuration writes.

Project diagnostics currently inspect the nearest local configuration. Reporting and accounting for saved global source bindings remains follow-up work; a project using global defaults can still receive the local-adoption warning.

User-facing usage

aspire doctor
aspire doctor --format json

Relevant existing command help, also exercised by the doctor tests:

Usage:
  aspire doctor [options]

Options:
  --format <Json|Table>  Output format (Table or Json)

When a candidate is available and the AppHost has no recorded choice, doctor reports a warning with:

Run 'aspire update' to choose whether this AppHost should use the available configuration source.

JSON output includes the config-source environment check and, when applicable, the apphost-config-source check with a bound, optedOut, or unconfigured state. An explicit opt-out is reported as an intentional choice, not something to fix.

Screenshots / Recordings

This PR includes UI changes. Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally.

  • For before/after comparisons, place them side-by-side or label them clearly.
  • For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video).
  • If you cannot capture visuals now, note what scenario to test and mark this section as TODO.

TODO: Capture aspire doctor with ASPIRE_INIT_SOURCE_URL set in an AppHost with no saved source choice, showing availability, the adoption warning, and its suggested fix. Also capture saved-binding and explicit-opt-out states. No visual capture was made during this change.

Validation

Focused validation rerun after splitting the branches: passed, 52 succeeded, 0 failed, 0 skipped.

$env:MSBUILDTERMINALLOGGER='false'
dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.ConfigSourceCheckTests" --filter-class "*.DoctorCommandTests" --filter-class "*.EnvironmentCheckerTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Broader doctor, creation, and config-source regression coverage, run before splitting the same implementation into commits: passed, 784 succeeded, 0 failed, 2 skipped.

$env:MSBUILDTERMINALLOGGER='false'
dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.ConfigSourceCheckTests" --filter-class "*.DoctorCommandTests" --filter-class "*.EnvironmentCheckerTests" --filter-class "*.ConfigSourceServiceTests" --filter-class "*.ConfigSourceCommandTests" --filter-class "*.NewCommandLocalTemplateTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Localization regeneration: passed, 0 warnings and 0 errors.

dotnet build src\Aspire.Cli\Aspire.Cli.csproj /t:UpdateXlf

Doctor-only diff whitespace validation: passed.

git diff --check jamesnk/config-source-brownfield...jamesnk/doctor-config-sources

The full repository suite and manual visual verification were not run.

Fixes # (issue)

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 <223556219+Copilot@users.noreply.github.com>

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking: if employee detection fails or times out, the new diagnostic appears to report a green “No configuration source is available on this machine.” That could be misleading because availability is unknown rather than confirmed absent. Consider distinguishing inconclusive discovery from a genuine negative result, perhaps with a warning. Not blocking approval.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JamesNK
James Newton-King (JamesNK) merged commit d3b845e into jamesnk/config-source-brownfield Nov 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants