Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/specs/cli-output-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,18 @@ The JSON form includes secret values. Do not redirect it to logs or files unless
```json
{
"checks": [
{
"category": "environment",
"name": "operating-system",
"status": "pass",
"message": "Operating system: Linux Ubuntu 24.04",
"metadata": {
"osType": "Linux",
"displayName": "Linux Ubuntu",
"version": "24.04",
"description": "Ubuntu 24.04.2 LTS"
}
},
{
"category": "sdk",
"name": "dotnet-sdk",
Expand All @@ -442,7 +454,7 @@ The JSON form includes secret values. Do not redirect it to logs or files unless
}
],
"summary": {
"passed": 1,
"passed": 2,
"warnings": 1,
"failed": 0
}
Expand Down
1 change: 1 addition & 0 deletions src/Aspire.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ internal static async Task<IHost> BuildApplicationAsync(string[] args, CliStartu

// Environment checking services.
builder.Services.AddSingleton<IEnvironmentCheck, AspireVersionCheck>();
builder.Services.AddSingleton<IEnvironmentCheck, OperatingSystemCheck>();
builder.Services.AddSingleton<IEnvironmentCheck, WslEnvironmentCheck>();
builder.Services.AddSingleton<IEnvironmentCheck, DotNetSdkCheck>();
builder.Services.AddSingleton<IEnvironmentCheck, TypeScriptAppHostToolingCheck>();
Expand Down
9 changes: 9 additions & 0 deletions src/Aspire.Cli/Resources/DoctorCommandStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/Aspire.Cli/Resources/DoctorCommandStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
<data name="CheckingPrerequisites" xml:space="preserve">
<value>Checking Aspire environment...</value>
</data>
<data name="OperatingSystemMessageFormat" xml:space="preserve">
<value>Operating system: {0}</value>
<comment>{0} is the operating system display name and version, for example "Windows 10.0.22631", "macOS 26.0", or "Linux Ubuntu 24.04".</comment>
</data>
<data name="VersionUnknown" xml:space="preserve">
<value>unknown</value>
</data>
Expand Down
5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Aspire.Cli/Resources/xlf/DoctorCommandStrings.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 23 additions & 20 deletions src/Aspire.Cli/Utils/EnvironmentChecker/AspireVersionCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ internal sealed class AspireVersionCheck(
CliExecutionContext executionContext,
ILogger<AspireVersionCheck> logger) : IEnvironmentCheck
{
internal const string AppHostVersionCheckName = "apphost-version";
internal const string CliVersionCheckName = "cli-version";

// Version checks should appear first so users immediately see which Aspire bits
// produced the rest of the doctor output before reading environment diagnostics.
public int Order => 0;
Expand All @@ -49,8 +52,8 @@ await GetCliVersionCheckAsync(cancellationToken)

appHostVersionCheck = new EnvironmentCheckResult
{
Category = "apphost",
Name = "apphost-version",
Category = EnvironmentCheckCategories.AppHost,
Name = AppHostVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = DoctorCommandStrings.AppHostVersionCheckFailedMessage,
Details = ex.Message
Expand Down Expand Up @@ -88,8 +91,8 @@ private async Task<EnvironmentCheckResult> GetCliVersionCheckAsync(CancellationT
{
return new EnvironmentCheckResult
{
Category = "aspire",
Name = "cli-version",
Category = EnvironmentCheckCategories.Aspire,
Name = CliVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = FormatCliVersionMessage(currentVersion, identityChannel),
Details = $"{DoctorCommandStrings.CliVersionUpdateCheckFailedMessage}: {updateCheckError}",
Expand All @@ -101,8 +104,8 @@ private async Task<EnvironmentCheckResult> GetCliVersionCheckAsync(CancellationT
{
return new EnvironmentCheckResult
{
Category = "aspire",
Name = "cli-version",
Category = EnvironmentCheckCategories.Aspire,
Name = CliVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
// Both versions get their channel inline next to them so
// the message is unambiguous:
Expand All @@ -124,8 +127,8 @@ private async Task<EnvironmentCheckResult> GetCliVersionCheckAsync(CancellationT

return new EnvironmentCheckResult
{
Category = "aspire",
Name = "cli-version",
Category = EnvironmentCheckCategories.Aspire,
Name = CliVersionCheckName,
Status = EnvironmentCheckStatus.Pass,
Message = FormatCliVersionMessage(currentVersion, identityChannel),
Metadata = BuildCliVersionMetadata(currentVersion, latestVersion: null, status.UpdateCommand, updateCheckError: null, identityChannel, latestVersionChannel: null)
Expand All @@ -141,8 +144,8 @@ private async Task<EnvironmentCheckResult> GetCliVersionCheckAsync(CancellationT

return new EnvironmentCheckResult
{
Category = "aspire",
Name = "cli-version",
Category = EnvironmentCheckCategories.Aspire,
Name = CliVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = DoctorCommandStrings.CliVersionUpdateCheckFailedMessage,
Details = ex.Message,
Expand Down Expand Up @@ -226,8 +229,8 @@ private static string AppendChannelSuffix(string message, string? channel)
{
return new EnvironmentCheckResult
{
Category = "apphost",
Name = "apphost-version",
Category = EnvironmentCheckCategories.AppHost,
Name = AppHostVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = DoctorCommandStrings.AppHostVersionCheckFailedMessage,
Details = ex.Message
Expand All @@ -239,8 +242,8 @@ private static string AppendChannelSuffix(string message, string? channel)

return new EnvironmentCheckResult
{
Category = "apphost",
Name = "apphost-version",
Category = EnvironmentCheckCategories.AppHost,
Name = AppHostVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = DoctorCommandStrings.AppHostVersionCheckFailedMessage,
Details = ex.Message
Expand Down Expand Up @@ -273,8 +276,8 @@ private static string AppendChannelSuffix(string message, string? channel)
{
return new EnvironmentCheckResult
{
Category = "apphost",
Name = "apphost-version",
Category = EnvironmentCheckCategories.AppHost,
Name = AppHostVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = AppendChannelSuffix(
string.Format(CultureInfo.CurrentCulture, DoctorCommandStrings.AppHostVersionUnknownMessageFormat, relativePath),
Expand All @@ -285,8 +288,8 @@ private static string AppendChannelSuffix(string message, string? channel)

return new EnvironmentCheckResult
{
Category = "apphost",
Name = "apphost-version",
Category = EnvironmentCheckCategories.AppHost,
Name = AppHostVersionCheckName,
Status = EnvironmentCheckStatus.Pass,
// Channel goes inline next to the version, not at the
// end of the message: "AppHost version 13.0.0 (channel: stable) (path/to/AppHost.csproj)"
Expand All @@ -312,8 +315,8 @@ private static string AppendChannelSuffix(string message, string? channel)

return new EnvironmentCheckResult
{
Category = "apphost",
Name = "apphost-version",
Category = EnvironmentCheckCategories.AppHost,
Name = AppHostVersionCheckName,
Status = EnvironmentCheckStatus.Warning,
Message = DoctorCommandStrings.AppHostVersionCheckFailedMessage,
Details = ex.Message,
Expand Down
Loading
Loading