Skip to content

Fix removing resources without telemetry - #18829

Merged
Mitch Denny (mitchdenny) merged 5 commits into
mainfrom
fix/manage-data-empty-resource-selection
Jul 21, 2026
Merged

Fix removing resources without telemetry#18829
Mitch Denny (mitchdenny) merged 5 commits into
mainfrom
fix/manage-data-empty-resource-selection

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

Resources that remain known to the dashboard after all of their telemetry signals are cleared could not be selected on the Manage logs and telemetry page. This prevented users from removing those empty resources.

This change gives resources without data-type rows an explicit resource-level selection state. Their checkbox and grid row can now toggle selection, and Remove selected removes the resource. The Stress playground also emits structured logs from external-log-source, a service name unrelated to the AppHost resource model, so the telemetry-only resource flow can be exercised manually.

User-facing usage

Open Settings > Resource logs and telemetry > Manage. A resource with no remaining data types can now be selected using either its checkbox or its row and removed with Remove selected.

Screenshots / Recordings

remove-empty-resource

Validation

  • dotnet test --project tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-launch-profile -- --filter-class "*.ManageDataDialogTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • Manually verified in Chromium against the locally built dashboard that both the checkbox and empty row toggle selection and that Remove selected deletes the resource.
  • git diff --check

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

Copilot AI review requested due to automatic review settings July 20, 2026 06:47
@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 -- 18829

Or

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

@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.

Pull request overview

Adds selection/removal support for telemetry-only resources after all signals are cleared.

Changes:

  • Tracks resource-level selection for empty telemetry resources.
  • Adds regression coverage for row selection and removal.
  • Emits structured logs from an external Stress resource.

Reviewed changes

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

File Description
ManageDataDialog.razor.cs Handles empty-resource selection.
ManageDataDialogTests.cs Tests empty-resource removal.
TelemetryStresser.cs Emits external structured logs.

Comment thread src/Aspire.Dashboard/Components/Dialogs/ManageDataDialog.razor.cs
Comment thread src/Aspire.Dashboard/Components/Dialogs/ManageDataDialog.razor.cs
Copilot AI review requested due to automatic review settings July 21, 2026 02:33
@JamesNK
James Newton-King (JamesNK) marked this pull request as ready for review July 21, 2026 02:33
@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.

Pull request overview

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

Comments suppressed due to low confidence (2)

src/Aspire.Dashboard/Components/Dialogs/ManageDataDialog.razor.cs:672

  • Clear the resource's existing selections here, not just the new resource marker. When a telemetry-only resource transitions from signals to no signals, the old StructuredLogs/Traces/Metrics tuple remains in _selectedRows. If the resource was only partially selected, the empty row can render unchecked while AreNoneSelected() still enables the actions; GetSelectedResourcesAndDataTypes() can then promote that stale tuple to Resource because All(...) is vacuously true for the empty list, so Remove selected may delete a visually unchecked resource. Resetting all selections before adding the currently available rows keeps the UI and action payload aligned.
        _selectedRows.Remove((resourceName, AspireDataType.Resource));

src/Aspire.Dashboard/Components/Dialogs/ManageDataDialog.razor.cs:676

  • This resource-only marker also makes AreNoneSelected() false, so selecting an empty resource enables Export selected. TelemetryExportService ignores AspireDataType.Resource, meaning the action downloads an empty archive even though the UI reports a selection. Keep resource-only selection valid for removal, but exclude it when determining whether export is enabled (or export resource metadata for this marker).
        if (dataRows.Count == 0)
        {
            _selectedRows.Add((resourceName, AspireDataType.Resource));

Copilot AI review requested due to automatic review settings July 21, 2026 02:39

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/Aspire.Dashboard/Components/Dialogs/ManageDataDialog.razor Outdated
@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings July 21, 2026 02:50

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

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

Copilot AI review requested due to automatic review settings July 21, 2026 03:00

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

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

@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.

7 / 100 test projects · 4 jobs, from 4 changed files.

Selected test projects (7 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.RemoteHost.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/Components/Dialogs/ManageDataDialog.razor (changed source)
5 via the project graph: Aspire.Dashboard.Tests, Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests (2 hops), Aspire.Managed.Tests (2 hops), Aspire.Playground.Tests (2 hops)

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

📄 playground/Stress/Stress.TelemetryService/TelemetryStresser.cs (changed)
1 directly: Aspire.Playground.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Dialogs/ManageDataDialogTests.cs (changed test)
1 directly: Aspire.Dashboard.Components.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/Components/Dialogs/ManageDataDialog.razor, src/Aspire.Dashboard/Components/Dialogs/ManageDataDialog.razor.cs
• affected project Aspire.Dashboard
polyglot affected project Aspire.Managed

Selection computed for commit 876647d.

@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.

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the logic end-to-end and ran the dashboard component tests locally (all pass). The fix correctly gives data-less resources a resource-level selection state, prunes stale selections when signals are cleared externally, and keeps Export disabled for removal-only selections. Good regression coverage. LGTM.

@mitchdenny
Mitch Denny (mitchdenny) merged commit 4f1eb9c into main Jul 21, 2026
674 of 678 checks passed
@mitchdenny
Mitch Denny (mitchdenny) deleted the fix/manage-data-empty-resource-selection branch July 21, 2026 07:44
@github-actions github-actions Bot added this to the 13.5 milestone Jul 21, 2026
@aspire-repo-bot

This comment has been minimized.

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1444 targeting release/13.5.

Updated the Remove data section of dashboard/explore.mdx to document that resources with no remaining data types can now be selected (via checkbox or row) and removed with Remove selected, matching the fix in the source PR.

  • Modified: src/frontend/src/content/docs/dashboard/explore.mdx

Note

This draft PR needs human review before merging.

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.

3 participants