Skip to content

Add Markdown support to pipeline logging and summaries#14957

Open
eerhardt wants to merge 9 commits intodotnet:release/13.2from
eerhardt:MarkDownInReporting
Open

Add Markdown support to pipeline logging and summaries#14957
eerhardt wants to merge 9 commits intodotnet:release/13.2from
eerhardt:MarkDownInReporting

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Mar 5, 2026

Description

Introduce MarkdownString and PipelineSummaryItem types to enable explicit Markdown formatting in pipeline logs and summaries. Update IReportingStep, IReportingTask, and related APIs with overloads and extensions for MarkdownString, allowing richer CLI output (e.g., clickable links, bold text) while preserving plain-text compatibility. Refactor summary storage and backchannel data to track Markdown formatting per item. Update ConsoleActivityLogger and tests to render Markdown appropriately. All changes are backward compatible for existing plain string usage.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14957

Or

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

eerhardt and others added 6 commits March 6, 2026 18:32
Introduce MarkdownString and PipelineSummaryItem types to enable explicit Markdown formatting in pipeline logs and summaries. Update IReportingStep, IReportingTask, and related APIs with overloads and extensions for MarkdownString, allowing richer CLI output (e.g., clickable links, bold text) while preserving plain-text compatibility. Refactor summary storage and backchannel data to track Markdown formatting per item. Update ConsoleActivityLogger and tests to render Markdown appropriately. All changes are backward compatible for existing plain string usage.
Add ArgumentNullException.ThrowIfNull guards for all MarkdownString
parameters in interface default implementations (IReportingStep,
IReportingTask) and concrete overrides (ReportingStep, ReportingTask)
to prevent NullReferenceException when callers pass null at runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Since IReportingStep is experimental, remove default interface method
bodies and make all new methods regular abstract interface members.
Update test fakes (FakeReportingStep, TestReportingStep) to implement
the new required methods.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Suppress CP0006 breaking change diagnostics for the 4 new abstract
interface members on IReportingStep (CreateTaskAsync, Log x2,
CompleteAsync with MarkdownString). These are intentional breaking
changes to an experimental API (ASPIREPIPELINES001).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ngStep

Add test coverage for EnableMarkdown flag propagation through:
- CreateTaskAsync(MarkdownString) -> EnableMarkdown = true
- UpdateAsync(MarkdownString) -> EnableMarkdown = true
- CompleteAsync(MarkdownString) on task -> EnableMarkdown = true
- CompleteAsync(MarkdownString) on step -> EnableMarkdown = true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove default interface method bodies from IReportingTask for
UpdateAsync(MarkdownString) and CompleteAsync(MarkdownString).
Update TestReportingTask to implement the new required methods.
Remove Azure-specific references from MarkdownString XML doc examples.
Regenerate API compat suppressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eerhardt eerhardt force-pushed the MarkDownInReporting branch from c100624 to 38f14ed Compare March 7, 2026 00:32
@eerhardt eerhardt marked this pull request as ready for review March 7, 2026 00:51
@eerhardt eerhardt requested a review from radical as a code owner March 7, 2026 00:51
Copilot AI review requested due to automatic review settings March 7, 2026 00:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces explicit Markdown support for pipeline logging and pipeline summaries by adding MarkdownString / PipelineSummaryItem types and threading a per-item/per-message “enable markdown” flag through the hosting backchannel into the CLI renderer.

Changes:

  • Add new pipeline-facing types (MarkdownString, PipelineSummaryItem) and update reporting/task/step APIs to accept them.
  • Refactor pipeline summary transport/storage from KeyValuePair<string,string> to typed items that carry Markdown metadata.
  • Update CLI rendering and unit tests to render Markdown-enabled items/messages differently from plain text.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/Shared/TestPipelineActivityReporter.cs Updates test reporter to accept new Markdown overloads and summary item type.
tests/Aspire.Hosting.Tests/Publishing/PipelineActivityReporterTests.cs Adjusts tests for overload ambiguity (null) and adds Markdown-specific coverage.
tests/Aspire.Hosting.Tests/Pipelines/PipelineSummaryTests.cs Updates summary tests for PipelineSummaryItem and Markdown flag behavior.
tests/Aspire.Hosting.Tests/Pipelines/PipelineLoggerProviderTests.cs Updates fake step logging APIs and suppresses obsolete usage where needed.
tests/Aspire.Cli.Tests/Utils/ConsoleActivityLoggerTests.cs Updates CLI summary tests to use backchannel summary item type + Markdown flags.
src/Aspire.Hosting/Publishing/PublishingExtensions.cs Adds Markdown overloads for Succeed/Warn/Fail/UpdateStatus helper extensions.
src/Aspire.Hosting/Pipelines/ReportingTask.cs Plumbs enableMarkdown through task update/complete calls via new overloads.
src/Aspire.Hosting/Pipelines/ReportingStep.cs Adds Markdown overloads for task creation/logging/completion; routes enableMarkdown to reporter.
src/Aspire.Hosting/Pipelines/PublishCompletionOptions.cs Changes pipeline summary option to typed items carrying Markdown flag.
src/Aspire.Hosting/Pipelines/PipelineSummaryItem.cs New public type representing a summary entry with Markdown metadata.
src/Aspire.Hosting/Pipelines/PipelineSummary.cs Stores typed items and adds Add(key, MarkdownString) overload; updates docs.
src/Aspire.Hosting/Pipelines/PipelineLoggerProvider.cs Uses new plain-text logging overload.
src/Aspire.Hosting/Pipelines/PipelineActivityReporter.cs Threads EnableMarkdown through step/task/log activities and maps summary items to backchannel items.
src/Aspire.Hosting/Pipelines/NullPipelineActivityReporter.cs Updates null reporter to implement new Markdown overloads.
src/Aspire.Hosting/Pipelines/MarkdownString.cs New public wrapper type to explicitly mark strings as Markdown-formatted.
src/Aspire.Hosting/Pipelines/IReportingTask.cs Adds Markdown overloads for task update/complete.
src/Aspire.Hosting/Pipelines/IReportingStep.cs Adds Markdown overloads for task creation/logging/completion; obsoletes the old boolean-flag log API.
src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs Updates diagnostics logging to use new plain-text overload.
src/Aspire.Hosting/CompatibilitySuppressions.xml Adds API compatibility suppressions for newly added interface members.
src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs Updates publishing activity data to carry typed pipeline summary items with Markdown metadata.
src/Aspire.Hosting.Docker/DockerComposeServiceResource.cs Switches Markdown logging to MarkdownString overloads.
src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs Adds Markdown-aware summary entry (portal link) via MarkdownString.
src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebSiteResource.cs Switches success logging to MarkdownString overload.
src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentResource.cs Updates error logging to use the new plain-text overload.
src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppResource.cs Switches success logging to MarkdownString overloads.
src/Aspire.Cli/Utils/ConsoleActivityLogger.cs Renders summary items differently depending on Markdown flag and color/interactive mode.
src/Aspire.Cli/Backchannel/BackchannelJsonSerializerContext.cs Removes old List<KeyValuePair<string,string>> serialization entry (needs updating for new type).

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.

3 participants