Skip to content

Fix dashboard graph rendering for multi-path icons - #19579

Merged
Adam Ratzman (adamint) merged 1 commit into
mainfrom
sebros/fix-dashboard-graph-multiple-roots
Aug 21, 2026
Merged

Fix dashboard graph rendering for multi-path icons#19579
Adam Ratzman (adamint) merged 1 commit into
mainfrom
sebros/fix-dashboard-graph-multiple-roots

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Description

The Dashboard Graph view crashes when an AppHost uses AddBlobs because its DocumentMultiple icon contains multiple sibling SVG paths, while the graph mapper expects one XML root.

This parses Fluent UI icon content as an SVG fragment and combines each path's data into one compound SVG path, preserving the existing graph DTO and JavaScript rendering contract.

User-facing usage

AppHosts with Azure Blob resources can switch to Graph view without breaking the dashboard circuit:

var storage = builder.AddAzureStorage("storage")
    .RunAsEmulator();

storage.AddBlobs("blobs");

Targeted ResourceGraphMapperTests cover both single-path icons and the multi-path DocumentMultiple icon.

Fixes: #19489

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 <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 21, 2026 21:17
@github-actions

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

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

8 / 102 test projects · 4 jobs, from 2 changed files.

Selected test projects (8 / 102)

Aspire.Cli.EndToEnd.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Testing.Tests, Aspire.Managed.Tests, Aspire.Playground.Tests

Selected jobs (4)

cli-starter, deployment-e2e, extension-e2e, polyglot


How these were chosen — grouped by what changed

🔧 src/Aspire.Dashboard/Model/ResourceGraph/ResourceGraphMapper.cs (changed source)
6 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Managed.Tests (2 hops), Aspire.Playground.Tests (2 hops)

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

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

Job reasons

Job Triggered by
cli-starter • affected project Aspire.Managed
• selected test Aspire.Cli.EndToEnd.Tests
deployment-e2e affected project Aspire.Managed
extension-e2e src/Aspire.Dashboard/Model/ResourceGraph/ResourceGraphMapper.cs
• affected project Aspire.Dashboard
polyglot affected project Aspire.Managed

Selection computed for commit 1673909.

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.

Pull request overview

Fixes Graph view crashes caused by Fluent UI icons containing multiple sibling SVG paths.

Changes:

  • Parses icon content as an SVG fragment and combines path data.
  • Adds regression tests for single-path and multi-path icons.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Aspire.Dashboard/Model/ResourceGraph/ResourceGraphMapper.cs Supports compound icon paths.
tests/Aspire.Dashboard.Tests/Model/ResourceGraphMapperTests.cs Tests both icon shapes.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@sebastienros

Copy link
Copy Markdown
Contributor Author

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: 1673909da134614a1f1374602ed242ec26ece46c
  • Installed Version: 13.6.0-pr.19579.g1673909d
  • Status: PASS - the installed dogfood CLI matches the PR head.

Changes Analyzed

Files Changed

  • src/Aspire.Dashboard/Model/ResourceGraph/ResourceGraphMapper.cs
  • tests/Aspire.Dashboard.Tests/Model/ResourceGraphMapperTests.cs

Change Categories

  • CLI changes
  • Hosting integration changes
  • Dashboard changes
  • Template changes
  • Client/component changes
  • VS Code extension changes
  • Test changes
  • CI infrastructure changes

Test Scenarios Executed

Scenario 1: Reproduce the bug before the fix

Objective: Prove the PR base has the exact failure reported in issue #19489.

Coverage Type: Regression baseline

Status: PASS - bug reproduced.

Steps:

  1. Created an isolated source worktree at base commit c1d2831a.
  2. Added a temporary focused test that calls ResourceGraphMapper.GetIconPathData with the real Icons.Filled.Size24.DocumentMultiple icon.
  3. Ran only that test through Microsoft.Testing.Platform.

Observed:

The test failed at ResourceGraphMapper.cs:90 with:

System.Xml.XmlException: There are multiple root elements. Line 1, position 142.

This matches the issue stack trace and confirms the base code cannot parse the icon assigned by AddBlobs.

Evidence:

  • evidence/pre-fix-repro.log
  • evidence/pre-fix-test-exit-code.txt

Scenario 2: Validate the post-fix mapper

Objective: Confirm the PR handles both existing single-path icons and DocumentMultiple.

Coverage Type: Focused unit regression

Status: PASS

Steps:

  1. Ran ResourceGraphMapperTests at PR head.
  2. Excluded quarantined and outerloop tests.

Observed:

All 9 focused tests passed, including the single-path and three-path icon cases.

Evidence:

  • evidence/post-fix-tests.log

Scenario 3: Render AddBlobs in the Dashboard Graph view

Objective: Verify the user-visible issue is fixed in the PR dogfood Dashboard.

Coverage Type: Happy path, browser E2E

Status: PASS

Steps:

  1. Created a fresh C# aspire-empty AppHost from the PR package hive.
  2. Added Aspire.Hosting.Azure.Storage at the PR version.
  3. Added the issue's Azure Storage emulator and storage.AddBlobs("blobs") resource graph.
  4. Started the AppHost with the verified PR CLI.
  5. Opened the Dashboard with Playwright Firefox and selected Graph view.

Observed:

  • The graph rendered 3 nodes: blobs, azure-environment, and storage.
  • The blobs node had non-empty combined SVG path data.
  • No reconnect dialog was visible.
  • A clean browser session reported no console errors.
  • The final AppHost log contained no XmlException, multiple root elements, or unhandled circuit exception.

The local machine did not have a trusted development certificate, so the final browser scenario used the generated AppHost's HTTP launch profile with ASPIRE_ALLOW_UNSECURED_TRANSPORT=true. This changes only local test transport; the PR's graph parsing and rendering path is unchanged.

Evidence:

  • evidence/final-clean-graph-result.txt
  • evidence/final-graph-view.png
  • evidence/final-browser-console-errors.txt
  • evidence/final-graph-exception-scan.txt
  • evidence/final-apphost.log
  • evidence/final-resources.json

Scenario 4: Repeated navigation and circuit recovery boundary

Objective: Confirm Graph view does not poison the Blazor circuit after rendering the multi-path icon.

Coverage Type: Boundary/recovery

Status: PASS

Steps:

  1. Switched between Resources and Graph views 3 times.
  2. Verified all 3 graph nodes rendered after every switch.
  3. Returned to Resources and opened the blobs resource details.

Observed:

  • Every Graph view rendered all expected nodes.
  • Blob resource details opened successfully.
  • The Dashboard remained responsive with no visible reconnect dialog.

Evidence:

  • evidence/recovery-navigation-result.txt
  • evidence/resource-details-after-graph.png

Summary

Scenario Status Notes
Pre-fix reproduction PASS Exact multiple root elements exception reproduced
Post-fix mapper tests PASS 9/9 focused tests passed
Dashboard Graph view PASS All 3 nodes rendered, including blobs
Repeated navigation/details PASS Circuit remained responsive

Overall Result

PR VERIFIED

The bug reproduces on the PR base and is fixed at the PR head in both focused mapper coverage and a real dogfood Dashboard browser scenario.

@adamint
Adam Ratzman (adamint) enabled auto-merge (squash) August 21, 2026 22:04
@sebastienros

Copy link
Copy Markdown
Contributor Author

/backport to release/13.5

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.5 (link to workflow run)

@github-actions

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.

This was referenced Aug 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Graph view crashes with 'multiple root elements' on AddBlobs

5 participants