Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/Aspire.Cli/Commands/PipelineCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ var cs when IsCompletionStateWarning(cs) => ConsoleActivityLogger.ActivityState.
logger.SetStepDurations(durationRecords);

// Provide final result to logger and print its structured summary.
logger.SetFinalResult(!hasErrors);
logger.SetFinalResult(!hasErrors, this.Name);
logger.WriteSummary();

// Visual bell
Expand Down
13 changes: 12 additions & 1 deletion src/Aspire.Cli/Utils/ConsoleActivityLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,31 @@ public void WriteSummary()
if (!string.IsNullOrEmpty(_finalStatusHeader))
{
AnsiConsole.MarkupLine(_finalStatusHeader!);

// If pipeline failed, show help message about using --log-level debug
if (_finalStatusHeader.Contains("PIPELINE FAILED") && !string.IsNullOrEmpty(_commandName))
Copy link
Member

Choose a reason for hiding this comment

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

@copilot instead of doing this crude Contains check, we should store the bool from the call to SetFinalResult in a field and use it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Changed to use _pipelineSucceeded boolean field instead of string Contains check. (e8bed6c)

{
var helpMessage = _enableColor
? $"[dim]For more details, re-run with: aspire {_commandName} --log-level debug[/]"
: $"For more details, re-run with: aspire {_commandName} --log-level debug";
AnsiConsole.MarkupLine(helpMessage);
}
}
AnsiConsole.MarkupLine(line);
AnsiConsole.WriteLine(); // Ensure final newline after deployment summary
}
}

private string? _finalStatusHeader;
private string? _commandName;

/// <summary>
/// Sets the final deployment result lines to be displayed in the summary (e.g., DEPLOYMENT FAILED ...).
/// Optional usage so existing callers remain compatible.
/// </summary>
public void SetFinalResult(bool succeeded)
public void SetFinalResult(bool succeeded, string? commandName = null)
{
_commandName = commandName;
// Always show only a single final header line with symbol; no per-step duplication.
if (succeeded)
{
Expand Down
Loading