Skip to content

Add Mermaid resource graph export to the dashboard and CLI - #20746

Merged
Mitch Denny (mitchdenny) merged 6 commits into
mainfrom
mitchdenny-resource-graph-mermaid-export
Oct 6, 2026
Merged

Mitch Denny (mitchdenny) merged 6 commits into
mainfrom
mitchdenny-resource-graph-mermaid-export

Conversation

@mitchdenny

@mitchdenny Mitch Denny (mitchdenny) commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Description

Resource graphs are useful for documenting and sharing an application's topology, but currently cannot be exported from the dashboard or CLI. This adds Export as Mermaid to the graph controls, opening a large dialog with the generated source, Copy to clipboard, and Download as resources.mmd. It also adds aspire resources --format mermaid (and aspire describe --format mermaid) for direct file redirection.

The dashboard export reflects the graph's current filters and hidden-resource visibility. The CLI exports the selected AppHost's resource snapshot, respecting resource-name selection and --include-hidden. Both use the same serializer for deterministic ordering, generated node identifiers, and escaped labels, and preserve directed resource references and replica names. The dashboard reuses the existing text visualizer dialog in plaintext mode. CLI progress, errors, and informational messages stay on stderr so stdout contains only Mermaid source.

This intentionally includes source, copy, and download only; a rendered Mermaid preview is deferred, with no new browser dependency. Mermaid CLI output is snapshot-only and rejects --follow.

User-facing usage

Open Resources → Graph, apply any desired filters, and select the download icon in the lower-right graph controls. Copy the source into a Mermaid-enabled document, or download resources.mmd for use in a Mermaid editor.

From the CLI:

aspire resources --format mermaid >> file.txt
aspire describe --format mermaid > resources.mmd
aspire resources --format mermaid --include-hidden > all-resources.mmd

Each invocation exports one diagram. Appending repeated invocations with >> produces multiple diagrams, not a merged diagram.

The compiled command's help now includes:

--format <Json|Mermaid|Table>  Output format (Table, Json, or Mermaid)
--include-hidden             Include hidden resources in the output

Screenshots / Recordings

Graph controls with the new export action:

Resource graph with Export as Mermaid control

Export dialog showing the generated source and copy/download actions:

Mermaid export dialog

Screenshots use synthetic integration-test resources.

Validation

  • ./restore.sh — passed.
  • MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.DescribeCommandTests' --filter-class '*.BaseCommandTests' --filter-class '*.RootCommandTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 165 tests, including topology/escaping snapshots, filtering, replicas, format parsing, stderr routing, and first-run banner suppression.
  • MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj --no-launch-profile -- --filter-class '*.ResourceGraphMermaidExporterTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 3 tests; existing exporter snapshots remain unchanged after sharing the serializer.
  • MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Dashboard.Components.Tests/Aspire.Dashboard.Components.Tests.csproj --no-launch-profile -- --filter-method '*.ResourceGraph*' --filter-method '*.Render_TextVisualizer*' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' — passed, 29 tests.
  • MSBUILDTERMINALLOGGER=false dotnet build src/Aspire.Cli/Aspire.Cli.csproj /t:UpdateXlf --nologo — passed; regenerated localization files.
  • ./.dotnet/dotnet artifacts/bin/Aspire.Cli/Debug/net11.0/aspire.dll resources --help — passed; confirms the new format in compiled command help.
  • Browser verification using the existing dashboard Playwright fixture — passed: dialog source, clipboard contents, and downloaded filename/content match.
  • All three generated dashboard Mermaid snapshots parsed with the Mermaid parser, with expected node and edge counts.
  • git diff --check — passed.
  • Full repository build and full test suite were not run.

Security considerations

Resource display names are user-controlled. The shared exporter generates its own node identifiers and escapes label characters instead of interpolating raw names into Mermaid syntax. It exports only resource display names and references, not endpoint URLs, configuration values, or environment variables. Users should review resource names before sharing exported diagrams. No Mermaid source is executed or rendered in the dashboard or CLI.

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 App <[email protected]>
Copilot-Session: 717ed183-6459-4f56-bcd9-320a67093908
@github-actions

github-actions Bot commented Oct 5, 2026

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 -- 20746

Or

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

@github-actions

This comment has been minimized.

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.

Copilot review overview

🟡 Changes recommended

The export can produce an empty graph when clicked before asynchronous graph initialization completes.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds Mermaid export for the dashboard resource graph, reflecting current visibility and filters.

Changes:

  • Generates deterministic, escaped Mermaid flowcharts.
  • Adds an export dialog with copy and download actions.
  • Adds localization, documentation, and test coverage.
File Description
tests/​Aspire.Dashboard.Tests/​Model/​Snapshots/​ResourceGraphMermaidExporterTests.Export_ResourcesAndConnections.verified.mmd Snapshots resources and edges.
tests/​Aspire.Dashboard.Tests/​Model/​Snapshots/​ResourceGraphMermaidExporterTests.Export_EscapesLabelsAndUsesSafeIdentifiers.verified.mmd Snapshots escaping and identifiers.
tests/​Aspire.Dashboard.Tests/​Model/​Snapshots/​ResourceGraphMermaidExporterTests.Export_Empty.verified.mmd Snapshots an empty graph.
tests/​Aspire.Dashboard.Tests/​Model/​ResourceGraphMermaidExporterTests.cs Tests exporter behavior.
tests/​Aspire.Dashboard.Tests/​Aspire.Dashboard.Tests.csproj Adds Verify snapshot support.
tests/​Aspire.Dashboard.Components.Tests/​Shared/​ResourceSetupHelpers.cs Supports injected dialog services.
tests/​Aspire.Dashboard.Components.Tests/​Pages/​ResourcesTests.cs Tests filtered graph export.
tests/​Aspire.Dashboard.Components.Tests/​Controls/​TextVisualizerDialogTests.cs Tests copy and download behavior.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.zh-Hant.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.zh-Hans.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.tr.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.ru.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.pt-BR.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.pl.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.ko.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.ja.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.it.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.fr.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.es.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.de.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​xlf/​Resources.cs.xlf Adds localized resource entry.
src/​Aspire.Dashboard/​Resources/​Resources.resx Defines export button text.
src/​Aspire.Dashboard/​Resources/​Resources.Designer.cs Exposes the localized string.
src/​Aspire.Dashboard/​README.md Documents Mermaid export.
src/​Aspire.Dashboard/​Model/​ResourceGraph/​ResourceGraphMermaidExporter.cs Implements Mermaid generation.
src/​Aspire.Dashboard/​Components/​Pages/​Resources.razor.cs Opens the export dialog.
src/​Aspire.Dashboard/​Components/​Pages/​Resources.razor Adds the export control.
Files not reviewed (1)
  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 717ed183-6459-4f56-bcd9-320a67093908
@github-actions

github-actions Bot commented Oct 5, 2026

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.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 717ed183-6459-4f56-bcd9-320a67093908

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.

Copilot review overview

🟢 Approval recommended

The export logic, filtering behavior, escaping, accessibility, localization, and dialog actions are covered without unresolved issues.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Files not reviewed (1)
  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 717ed183-6459-4f56-bcd9-320a67093908
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 6, 2026 01:20
@mitchdenny Mitch Denny (mitchdenny) changed the title Add Mermaid export for the dashboard resource graph Add Mermaid resource graph export to the dashboard and CLI Oct 6, 2026
@github-actions

This comment has been minimized.

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.

Copilot review overview

🟡 Changes recommended

Replica selection loses unique names, and case-variant self-references produce unintended self-loops.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Files not reviewed (2)
  • src/Aspire.Cli/Resources/DescribeCommandStrings.Designer.cs: Generated file
  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

@github-actions

github-actions Bot commented Oct 6, 2026

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.

@mitchdenny

Copy link
Copy Markdown
Member Author

PR Testing Report

PR Information

  • PR: Add Mermaid resource graph export to the dashboard and CLI #20746 — Add Mermaid resource graph export to the dashboard and CLI
  • Head tested: 347b8bb9caebcef3ae6a036edfbafe5c168dd6ad
  • Completed: 2026-10-06T02:28Z
  • Environment: macOS arm64; isolated local installation and freshly generated applications.
  • Review: No concrete production-code bug identified. The persistent CLI E2E coverage gap is recorded below, not posted as a review finding.

Artifact Version Verification

  • Installed CLI: 17.0.0-pr.20746.g347b8bb9
  • Result: Verified against the live PR head before scenarios; head remained unchanged at completion.
  • Artifact producer: CI run 37398643497.
  • Installation: Successful; PR-specific package hive and bundle used. No HOME, authentication, shell profile, or repository dependency-manifest changes.
  • Generated AppHost: #:sdk [email protected], with AspireUseCliBundle=true.
testDir="$(mktemp -d -t aspire-pr20746-XXXXXX)"
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh |
  bash -s -- 20746 --install-path "$testDir" --skip-path --skip-extension
cliPath="$testDir/dogfood/pr-20746/bin/aspire"
hivePath="$testDir/hives/pr-20746/packages"
"$cliPath" --version

Result: Installation and version verification passed.

Final CI Results

All current-head checks finished: 249 passing, 6 skipped, 0 pending, 0 failing. Earlier failures in CLI/Ubuntu and Hosting.JavaScript/Windows subsequently passed on rerun; the final result above is not the earlier failed attempt.

Changes Analyzed

CLI command/output routing, shared Mermaid serialization, dashboard graph mapping/export dialog, localization, documentation, and focused tests. No hosting integration, extension, or CI infrastructure behavior was changed by this PR.

Test Scenarios Executed

Scenario Result Evidence / observations
Matching dogfood installation Passed Installed version contains the tested head's short SHA.
Fresh starter creation Passed Matching PR template hive used, with all noninteractive flags.
Starter AppHost startup Failed Generated Web project failed with CS0234: MermaidSmoke.Web.Components namespace missing. Mermaid scenarios did not run against this starter. Cause was not established or attributed to this PR.
Fresh empty AppHost startup Passed File-based PR AppHost started; empty graph exported as flowchart LR.
Controlled running topology Passed Two executable resources, frontend referencing backend, plus a synthetic parameter/environment value. Aspire readiness wait succeeded.
Actual >> redirection Passed Compiled PR CLI emitted unfenced Mermaid only to the output file.
Repeated append Passed File contents equal exactly two complete graph snapshots; diagrams are not merged.
Alias/case/equal-sign format Passed describe --format=MERMAID exactly matched resources --format mermaid byte-for-byte.
CLI resource-name filtering Passed Selecting frontend exported one node and no dangling edge.
Hidden-resource behavior Passed Default omitted aspire-dashboard; --include-hidden included it while preserving the frontend/backend relationship.
Parameter/value exclusion Passed Exact complete output contained resource names/relationship only, no parameter node, synthetic value, environment name, or endpoint URL.
Live dashboard source Passed Dialog source matched CLI graph, allowing only the CLI's extra trailing newline.
Actual browser clipboard Passed Clipboard read-back exactly equaled the dialog source.
Actual browser download Passed Suggested filename was resources.mmd; downloaded bytes exactly equaled the dialog source.
Live dashboard filtered graph Passed Typing frontend in a fresh page produced the same one-node export as CLI filtering.
Mermaid syntax Passed Real Mermaid parser accepted empty, topology, name-filtered, hidden-inclusive, and downloaded diagrams.
Mermaid plus --follow Passed Exit 1; clear validation error on stderr; stdout empty.
Missing resource Passed Exit 7; resource-not-found message on stderr; stdout empty.
No running selected AppHost Passed After exact-target stop: exit 0, informational stderr, empty stdout.

Fresh applications and readiness

"$cliPath" new aspire-starter --name MermaidSmoke --output "$testDir/MermaidSmoke" \
  --source "$hivePath" --version 17.0.0-pr.20746.g347b8bb9 \
  --test-framework None --use-redis-cache false --localhost-tld false \
  --suppress-agent-init --non-interactive
"$cliPath" start --non-interactive \
  --apphost "$testDir/MermaidSmoke/MermaidSmoke.AppHost/MermaidSmoke.AppHost.csproj" --format Json

Creation passed; startup returned exit 2 with the CS0234 errors described above. Rather than modifying the generated Blazor project to hide this failure, testing continued with a fresh empty application:

"$cliPath" new aspire-empty --name MermaidEmpty --output "$testDir/MermaidEmpty" \
  --source "$hivePath" --version 17.0.0-pr.20746.g347b8bb9 \
  --localhost-tld false --suppress-agent-init --non-interactive
apphost="$testDir/MermaidEmpty/apphost.cs"
"$cliPath" start --non-interactive --apphost "$apphost" --format Json

Both passed. The generated empty template uses apphost.cs, not an .AppHost.csproj. A first start using the assumed project path returned a clear path-not-found error; the generated path was inspected and used thereafter.

The empty application was stopped, then its temporary AppHost was extended with two /bin/sleep executable resources, one endpoint reference, and a synthetic parameter-backed environment variable. A temporary fixture first attempted a resource-reference overload that does not apply to executables; the fixture was corrected to use the backend's endpoint reference before successful execution. No PR code was changed.

"$cliPath" start --non-interactive --apphost "$apphost" --format Json
"$cliPath" wait frontend --status up --timeout 60 --apphost "$apphost" --non-interactive

Result: Both passed.

Compiled CLI export commands

"$cliPath" resources --apphost "$apphost" --format mermaid >> "$evidence/pr20746-topology.mmd"
"$cliPath" describe --apphost "$apphost" --format=MERMAID > "$evidence/pr20746-alias.mmd"
cmp "$evidence/pr20746-topology.mmd" "$evidence/pr20746-alias.mmd"
"$cliPath" resources frontend --apphost "$apphost" --format mermaid > "$evidence/pr20746-filter.mmd"
"$cliPath" resources --apphost "$apphost" --format mermaid --include-hidden > "$evidence/pr20746-hidden.mmd"
"$cliPath" resources --apphost "$apphost" --format mermaid >> "$evidence/pr20746-append.mmd"
"$cliPath" resources --apphost "$apphost" --format mermaid >> "$evidence/pr20746-append.mmd"

Result: Passed, with complete-content assertions. Human-readable stderr was captured separately.

flowchart LR
    resource0["backend"]
    resource1["frontend"]
    resource1 --> resource0
Loading

Browser and parser validation

An isolated Playwright/Chromium harness tested the actual dashboard launched by the PR bundle, including clipboard read-back and a real browser download. Mermaid was parsed in Chromium using the installed Mermaid module served only on localhost.

node "$evidence/pr20746-browser.cjs"

Result: Passed: source, clipboard, filename/content, filtered export, and all five parser inputs.

Initial harness attempts entered filter text while the previous dialog was closing and triggered dashboard navigation shortcuts. The filter assertion was rerun successfully in a fresh page with explicitly focused search input; those initial harness attempts are not counted as feature passes.

Negative commands and cleanup

"$cliPath" resources --apphost "$apphost" --format mermaid --follow
"$cliPath" resources nonexistent --apphost "$apphost" --format mermaid
"$cliPath" stop --non-interactive --apphost "$apphost"
"$cliPath" resources --apphost "$apphost" --format mermaid

Results: Expected exits 1, 7, 0, 0 respectively. Both invalid invocations and the no-running-AppHost invocation emitted zero stdout bytes. Only the test-created AppHost was stopped.

Supporting Source Validation — Historical, Not Artifact Scenarios

Previously completed on this same head: 165 CLI command/base/root tests, 3 dashboard serializer tests, and 29 graph/text-dialog component tests passed. Localization generation passed. These are supporting source-test results, not substitutes for the fresh artifact scenarios above.

Evidence

Report, browser harness, logs, output files, and inspected screenshots are saved in this session's artifact directory:

/Users/midenn/.copilot/session-state/717ed183-6459-4f56-bcd9-320a67093908/files

Key files: pr20746-install.log, pr20746-version.txt, pr20746-create.log, pr20746-start.stderr (starter failure), pr20746-wait.log, pr20746-output-assertions.log, pr20746-browser.log, pr20746-topology.mmd, pr20746-filter.mmd, pr20746-hidden.mmd, pr20746-append.mmd, and pr20746-dashboard-download.mmd.

Fresh screenshots: pr20746-live-graph.png, pr20746-live-dialog.png, and pr20746-filtered-dialog.png. These are local artifacts, not the historical screenshots already embedded in the PR description. Dashboard login tokens/authenticated URLs were not published.

Limitations and Recommendations

  • Persistent regression coverage gap: No committed CLI E2E test currently exercises the compiled redirected Mermaid invocation against a real AppHost, especially first-run output suppression. The manual artifact run verified actual shell redirection; add durable coverage for this contract.
  • Replica-specific topology, escaping edge cases, and first-run state reset were not re-exercised in these artifact scenarios. Existing focused source tests cover replicas/escaping/startup routing. User-level configuration was deliberately not reset.
  • Starter startup failed as recorded above. The successful empty-app scenarios verify Mermaid behavior, but do not establish that the generated starter builds successfully in this environment.
  • Rendering a Mermaid preview inside the export dialog remains intentionally deferred, per the earlier user decision; source/copy/download are the implemented scope.
  • Exact test AppHost was stopped; browser and parser server were closed. Temporary installation/app/tooling directories are cleaned after evidence preservation.

Overall Result

Mermaid CLI/dashboard artifact scenarios passed on the current PR head. CI is green. A separate starter smoke-test build failure remains unresolved, so this is not an unqualified end-to-end verification of every PR smoke scenario.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 717ed183-6459-4f56-bcd9-320a67093908
@mitchdenny

Copy link
Copy Markdown
Member Author

Fixed the case-variant self-reference issue noted in the review summary: Mermaid self-reference exclusion now uses the same case-insensitive resource-name comparison as relationship resolution. Added mixed-case Reference and WaitFor inputs to the topology regression tests; all 44 DescribeCommand tests pass with the existing snapshots unchanged. The single-replica label finding remains deferred by user decision; its thread is still open.

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 6, 2026 05:40
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 717ed183-6459-4f56-bcd9-320a67093908
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Tests selector

15 / 98 PR test projects · 5 PR jobs, from 58 changed files.

Selected PR test projects (15 / 98)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (5)

cli-starter-validation, extension-e2e, native-dashboard-validation, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 10 of the 15 selected test projects come from a single change — src/Aspire.Dashboard/Aspire.Dashboard.csproj.

🔧 src/Aspire.Dashboard/Aspire.Dashboard.csproj (changed source)
→ 10 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

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

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🧪 tests/Aspire.Cli.Tests/Commands/BaseCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/DescribeCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/RootCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_EscapesLabels.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_ExportsTopology_args=describe_includeHidden=False.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_ExportsTopology_args=resources_includeHidden=False.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_ExportsTopology_args=resources_includeHidden=True.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_FiltersResources_resource=cache.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_FiltersResources_resource=empty.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_PreservesSelectedReplicaNames_resource=API-2.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/DescribeCommandTests.DescribeCommand_MermaidFormat_PreservesSelectedReplicaNames_resource=api-1.verified.mmd (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/TextVisualizerDialogTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/ResourcesTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Shared/ResourceSetupHelpers.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/ResourceGraphMermaidExporterTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/Snapshots/ResourceGraphMermaidExporterTests.Export_Empty.verified.mmd (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/Snapshots/ResourceGraphMermaidExporterTests.Export_EscapesLabelsAndUsesSafeIdentifiers.verified.mmd (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Model/Snapshots/ResourceGraphMermaidExporterTests.Export_ResourcesAndConnections.verified.mmd (changed test)
→ 1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Aspire.Cli.csproj, src/Aspire.Cli/Commands/BaseCommand.cs, src/Aspire.Cli/Commands/DescribeCommand.cs, src/Aspire.Cli/Program.cs, src/Aspire.Cli/Resources/DescribeCommandStrings.Designer.cs, src/Aspire.Cli/Resources/DescribeCommandStrings.resx, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/DescribeCommandStrings.zh-Hant.xlf, src/Aspire.Dashboard/Aspire.Dashboard.csproj, src/Aspire.Dashboard/Components/Pages/Resources.razor, src/Aspire.Dashboard/Components/Pages/Resources.razor.cs, src/Aspire.Dashboard/Model/ResourceGraph/ResourceGraphMermaidExporter.cs, src/Aspire.Dashboard/Resources/Resources.Designer.cs, src/Aspire.Dashboard/Resources/Resources.resx, src/Aspire.Dashboard/Resources/xlf/Resources.cs.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.de.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.es.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.fr.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.it.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ja.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ko.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.pl.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.pt-BR.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ru.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.tr.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hans.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hant.xlf
• affected project Aspire.Cli
native-dashboard-validation affected project Aspire.Dashboard
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 0579e78.

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.

Copilot review overview

🟢 Approval recommended

The implementation is coherent across dashboard and CLI surfaces with focused coverage for filtering, escaping, replicas, output routing, and interaction behavior.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Files not reviewed (2)
  • src/Aspire.Cli/Resources/DescribeCommandStrings.Designer.cs: Generated file
  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

@mitchdenny
Mitch Denny (mitchdenny) merged commit c2a257b into main Oct 6, 2026
255 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 6, 2026
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Oct 6, 2026
Documents microsoft/aspire#20746, which adds an Export as Mermaid action to
the dashboard resource graph and a --format mermaid option to aspire
describe / aspire resources.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1829

Generated by PR Documentation Check · copilot · auto · 61.6 AIC · ⌖ 14.5 AIC · ⊞ 20.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1829 targeting release/17.0.

Documented the new Mermaid resource-graph export added by #20746.

Triggered signals and evidence covered:

  • cli_command_file_changed / cli_option_added / cli_resource_strings_changed: DescribeCommand.cs adds Option<ResourceOutputFormat>("--format") with a new Mermaid value, and DescribeCommandStrings.resx updates JsonOptionDescription to "Output format (Table, Json, or Mermaid)".
  • dashboard_user_facing_page_changed: Resources.razor/.razor.cs add an Export as Mermaid button (ExportResourceGraphAsync) in the graph controls that opens the existing text-visualizer dialog with the generated diagram.
  • pr_body_has_cli_flag_mention / pr_body_has_user_facing_section: PR body's "User-facing usage" section documents aspire resources --format mermaid >> file.txt and aspire describe --format mermaid > resources.mmd.

Changes made:

  • reference/cli/commands/aspire-describe.mdx: expanded the --format option description to include Mermaid, its flowchart LR output shape, exclusions (parameters/endpoints/state), stderr-only progress messages, and that --follow isn't supported; added a new example exporting Mermaid output.
  • dashboard/explore.mdx: added a paragraph (plus a cross-reference Aside to the CLI command) describing the Export as Mermaid graph control, what it includes/excludes, and the copy/download actions, in the existing graph-view section.

Note

This draft PR needs human review before merging.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants