Fix removing resources without telemetry - #18829
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18829Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18829" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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/Metricstuple remains in_selectedRows. If the resource was only partially selected, the empty row can render unchecked whileAreNoneSelected()still enables the actions;GetSelectedResourcesAndDataTypes()can then promote that stale tuple toResourcebecauseAll(...)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.TelemetryExportServiceignoresAspireDataType.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));
This comment has been minimized.
This comment has been minimized.
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)
Selected jobs (4)
How these were chosen — grouped by what changed🔧 📦 affected project 📄 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Mitch Denny (mitchdenny)
left a comment
There was a problem hiding this comment.
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.
This comment has been minimized.
This comment has been minimized.
|
📝 Documentation has been drafted in microsoft/aspire.dev#1444 targeting Updated the Remove data section of
Note This draft PR needs human review before merging. |
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
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"git diff --checkFixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?