Move resource property metadata to producers#18202
Conversation
Move resource-specific dashboard property labels, highlighting, and ordering into resource snapshot metadata emitted by hosting/resource producers. Preserve dashboard-owned generic properties and flow sort order through the dashboard protocol so existing details ordering is retained. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18202Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18202" |
There was a problem hiding this comment.
Pull request overview
This PR follows up on issue #1644, moving resource-specific property metadata (display names, highlighting, sort order) from the dashboard's KnownPropertyLookup to the resource producers (hosting side). The dashboard now only owns generic resource behavior (state, health, timing, connection strings), while container, executable, project, parameter, and tool-specific property labels, visibility, and ordering are supplied by the resource snapshots.
Changes:
- Adds a
SortOrderproperty toResourcePropertySnapshotand plumbs it through the protobuf wire format and dashboard view models, with a fallback to the existingPriorityfor backward compatibility. - Introduces
ResourcePropertySnapshotMetadatato centralize DCP-produced property metadata (containers, executables, projects), and moves parameter/tool metadata intoParameterResource.CreateValueSnapshotPropertyandDotnetToolResource.CreateSnapshotPropertiesrespectively. - Simplifies
KnownPropertyLookupto only contain generic resource properties, removing the per-resource-type property lists, and updates the dashboard'sResourceDetailsordering to useSortOrderinstead ofPriority.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting/ApplicationModel/CustomResourceSnapshot.cs |
Adds SortOrder property to ResourcePropertySnapshot |
src/Aspire.Hosting/Dashboard/ResourcePropertySnapshotMetadata.cs |
New centralized metadata lookup for DCP resource properties |
src/Aspire.Hosting/Dashboard/ResourceSnapshot.cs |
Updates Properties tuple to include SortOrder |
src/Aspire.Hosting/Dashboard/GenericResourceSnapshot.cs |
Propagates SortOrder through the snapshot tuple |
src/Aspire.Hosting/Dashboard/proto/dashboard_service.proto |
Adds sort_order field to ResourceProperty message |
src/Aspire.Hosting/Dashboard/proto/Partials.cs |
Maps SortOrder to protobuf ResourceProperty |
src/Aspire.Hosting/Dcp/ResourceSnapshotBuilder.cs |
Uses ResourcePropertySnapshotMetadata.Create for all DCP snapshots |
src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs |
Applies container image metadata via ResourcePropertySnapshotMetadata.Get |
src/Aspire.Hosting/Orchestrator/ParameterProcessor.cs |
Uses ParameterResource.CreateValueSnapshotProperty |
src/Aspire.Hosting/ApplicationModel/ParameterResource.cs |
Adds CreateValueSnapshotProperty with display metadata |
src/Aspire.Hosting/ApplicationModel/DotnetToolResource.cs |
Adds CreateSnapshotProperties with tool property metadata |
src/Aspire.Hosting/DotnetToolResourceExtensions.cs |
Delegates to CreateSnapshotProperties |
src/Shared/CustomResourceSnapshotExtensions.cs |
Adds sortOrder parameter to SetResourceProperty |
src/Aspire.Dashboard/Model/KnownPropertyLookup.cs |
Removes type-specific property lists, retains only generic properties |
src/Aspire.Dashboard/Model/ResourceViewModel.cs |
Adds SortOrder to view models with fallback to Priority |
src/Aspire.Dashboard/Components/Controls/ResourceDetails.razor.cs |
Orders by SortOrder, handles parameter key dual-registration |
src/Aspire.Dashboard/ServiceClient/Partials.cs |
Reads SortOrder from protobuf property |
src/Aspire.Hosting/Resources/MessageStrings.resx |
New localized display name strings for resource properties |
src/Aspire.Hosting/Resources/MessageStrings.Designer.cs |
Auto-generated accessors for new resource strings |
src/Aspire.Hosting/Resources/xlf/*.xlf |
XLF translation entries for 13 locales |
tests/Aspire.Hosting.Tests/DotnetToolResourceTests.cs |
New test for tool snapshot property metadata |
tests/Aspire.Hosting.Tests/Dcp/ResourceSnapshotBuilderTests.cs |
New tests for container/executable/project display metadata |
tests/Aspire.Dashboard.Tests/Model/KnownPropertyLookupTests.cs |
New test verifying producer-supplied properties aren't known |
tests/Aspire.Dashboard.Tests/Model/ResourceViewModelTests.cs |
Tests producer-supplied metadata doesn't require known property |
tests/Aspire.Dashboard.Components.Tests/Controls/ResourceDetailsTests.cs |
Tests sort order for highlighted properties, parameter helper |
tests/Aspire.Hosting.Tests/Dashboard/DashboardServiceDataTerminalTests.cs |
Updates tuple type for SortOrder |
Copilot's findings
Files not reviewed (1)
- src/Aspire.Hosting/Resources/MessageStrings.Designer.cs: Generated file
- Files reviewed: 37/38 changed files
- Comments generated: 0
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
Test Scenarios ExecutedScenario 1: Artifact verificationObjective: Verify the dogfood CLI artifact for PR #18202 matches the latest PR head before testing behavior. Steps:
Evidence:
Observations:
Scenario 2: Resource details metadata smoke appObjective: Verify a fresh PR-hive Aspire app can produce resource-specific properties from hosting/resource producers for project, executable, container, parameter, and dotnet tool resources. Steps:
Evidence:
Observations:
Scenario 3: Dashboard details UI verificationObjective: Verify the dashboard displays the important resource-specific details with preserved ordering through producer-supplied metadata rather than dashboard hard-coded known-property lists. Steps:
Evidence:
Observations:
Scenario 4: Non-highlighted producer property remains hidden by defaultObjective: Verify producer-supplied properties that are not highlighted are not promoted into the dashboard default details view. Steps:
Evidence:
Expected Unhappy-Path Outcome:
Observations:
Scenario 5: Focused automated regression testsObjective: Verify the unit/component tests covering the changed hosting metadata and dashboard rendering paths pass on the PR branch. Steps:
Evidence:
Observations:
Summary
Overall ResultPR VERIFIED Recommendations
Artifacts
Uploaded ScreenshotsResources listProject detailsExecutable detailsContainer detailsTool detailsParameter detailsPR Comment Status
Cleanup / Inspection Status
|
JamesNK
left a comment
There was a problem hiding this comment.
Low-severity cleanup: 2 dead-code items identified (unused resourceType parameter, orphaned dashboard localization strings). No bugs, security, correctness, or convention issues found.
|
There's also a breaking change here since the dashboard no longer hardcodes the set of known properties per resource, |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
What is the situation where the app host SDK version and dashboard version are out of sync? I haven't run into that problem yet. |
There are 2 scenarios where this could happen:
|
|
Got it. We could keep the current behavior in the dashboard. But at that point I wonder if this is a useful change. There are situations it breaks, but what do we get out of it. |
|
I think we do the breaking change. Easy to bring back if everyone gets up running into this but we wil be doing more to make sure we push updates more aggressively. I want to get to a point where we are using all of these features ourselves (within reason). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
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 <223556219+Copilot@users.noreply.github.com>
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
❓ CLI E2E Tests unknown — 115 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #27563928254 |
PR Testing ReportPR Information
Artifact Version Verification
Changes Analyzed
Test Scenarios ExecutedScenario 1: Dogfood artifact verificationObjective: Verify the tested CLI artifact is built from PR #18202 head. Observations:
Scenario 2: Targeted automated validationObjective: Verify hosting metadata producers, dashboard model conversion, legacy fallback, producer-local sort normalization, and ResourceDetails rendering behavior. Commands: Observations:
Scenario 3: Minimal AppHost dashboard smoke testObjective: Verify a fresh PR-hive app can run with producer-supplied resource metadata and that the dashboard renders the relevant resource details. Observations:
Scenario 4: Starter template smoke retryObjective: Verify the broader Steps:
Observations:
Unhappy-Path CoverageOld built-in snapshot compatibilityObjective: Verify dashboards connected to old built-in resource servers do not lose labels/order/default visibility when metadata is absent. Custom resource safetyObjective: Verify built-in fallback metadata is not applied to custom resources just because they use a built-in property name. Producer metadata precedenceObjective: Verify producer metadata disables the temporary legacy fallback for a resource. ScreenshotsMinimal app resource listMinimal app parameter detailsMinimal app tool detailsStarter app retry resource listSummary
Overall ResultPR-specific behavior verified. The hosting/dashboard changes in PR #18202 were verified by targeted automated tests, a fresh minimal AppHost dashboard smoke test, and a retried |










Description
Follow-up to #1644 after PR #18132 added resource-supplied property display metadata.
This removes dashboard-owned, resource-specific property handling for built-in resource details where the resource/server side can now provide the metadata instead. The dashboard keeps ownership of generic resource properties such as display name, state, health, start/stop time, exit code, and connection string. Resource producers now provide labels, default highlighting, and ordering for resource-specific properties.
Producer metadata is emitted from:
ParameterResourcefor parameter values.DotnetToolResourcefor tool package/version details.Sort order is producer-local: producers use simple values such as
0,1, and2for their own properties. The dashboard normalizes producer-defined and legacy fallback sort orders after the generic dashboard-owned properties, preserving the previous details ordering without requiring producers to know a dashboard-specific starting constant.Compatibility
The protocol changes are additive metadata fields, so older dashboards ignore the new fields and newer dashboards handle missing metadata. To avoid a UX regression with old built-in resource servers, the dashboard includes a temporary legacy fallback for Project, Executable, Container, and Parameter snapshots that do not carry producer metadata. If producer metadata is present for a built-in resource, the dashboard trusts it and does not apply the fallback.
This is not expected to be a breaking change.
User-facing behavior
The resource details panel continues to show the important Project, Executable, Container, Parameter, and DotnetTool properties with the same labels, default visibility, and ordering as before. Unknown properties that producers mark as highlighted are shown by default. Parameter resources still show the custom
Value not setexperience.Manual Stress playground comparison was performed for
manual-project-args,manual-arg-source,manual-container-args,api-key, andmanual-dotnet-tool-args.Validation
Checklist
<remarks />and<code />elements on your triple slash comments?