Repository navigation
Rename the WithTags trait from Aspire_Dashboard_Tag to Aspire_Tag - #21881
Conversation
Tags set with WithTags are not dashboard-only: they also reach `aspire describe --format json` as the resource.trait.<name> property. Drop the Dashboard scope from the reserved trait name while keeping the Aspire_ prefix so it cannot collide with user traits added with WithTrait. Aspire_Dashboard_Position keeps its name since only the dashboard uses it.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21881Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21881" |
Tests selector55 / 101 PR test projects · 5 PR jobs, from 10 changed files. Selected PR test projects (55 / 101)
Selected PR jobs (5)
How these were chosen — grouped by what changed
🔧 show 41
🧪 🔧 🔧 📦 affected project 📦 affected project 📦 affected project 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the reserved tag-trait rename.
No open issues 🎉
What changed in this PR
Renames the reserved WithTags trait from Aspire_Dashboard_Tag to Aspire_Tag, reflecting its use across dashboard and CLI tooling rather than only the dashboard.
Changes:
- Updates the shared constant, hosting tag creation and validation, and dashboard consumers.
- Updates existing hosting and dashboard tests to use the new trait name.
- Clarifies CLI tag output and browser-local tag storage in the persistence specification.
| File | Description |
|---|---|
tests/Aspire.Hosting.Tests/ResourceTraitBuilderTests.cs |
Updates tag validation and snapshot expectations. |
tests/Aspire.Hosting.Tests/Dashboard/DashboardServiceDataTerminalTests.cs |
Updates the serialized tag property expectation. |
tests/Aspire.Dashboard.Tests/Model/ResourceTagStoreTests.cs |
Uses the renamed trait in tag-merging coverage. |
tests/Aspire.Dashboard.Playwright.Tests/Integration/Playwright/ResourcePaneResponsiveTests.cs |
Updates browser-test resource fixtures. |
tests/Aspire.Dashboard.Components.Tests/Layout/ResourcesLayoutTests.cs |
Updates tag-grouping and relationship fixtures. |
tests/Aspire.Dashboard.Components.Tests/Controls/ResourceDetailsTests.cs |
Updates the tag display fixture. |
src/Shared/Model/KnownProperties.cs |
Renames the reserved trait and explains its scope. |
src/Aspire.Hosting/ResourceTraitBuilderExtensions.cs |
Makes WithTags emit the renamed trait. |
src/Aspire.Hosting/ApplicationModel/TraitAnnotation.cs |
Applies tag validation to the new name and generalizes its message. |
src/Aspire.Dashboard/Model/ResourceViewModel.cs |
Reads and localizes the renamed trait. |
docs/specs/dashboard-persistence.md |
Documents the new name, CLI output, and browser-local storage. |
Review effort: Balanced
|
✅ No documentation update needed. Proven false positive. Triggered signal: |
…1881) ## Description Renames the reserved trait used by `WithTags` from `Aspire_Dashboard_Tag` to `Aspire_Tag`. AppHost tags aren't dashboard-only. The CLI backchannel adds traits to resource snapshots the same way the dashboard does, so `aspire describe --format json` already includes them: ```json "properties": { "resource.trait.Aspire_Tag": ["frontend", "critical"] } ``` With the old name, tools reading that output had to know a dashboard-scoped name for something that isn't dashboard-specific, and the method name (`WithTags`) and the trait name didn't match in scope. ### What changed - `KnownResourceTraits.DashboardTag = "Aspire_Dashboard_Tag"` → `KnownResourceTraits.Tag = "Aspire_Tag"`, with a comment explaining the naming. - The `Aspire_` prefix stays so the reserved name can't collide with user traits added through `WithTrait` (a bare `tag` would pick up tag validation and dashboard tag behavior). - `Aspire_Dashboard_Position` / `WithDashboardPosition` are unchanged: only the dashboard uses a position, so the name matches the scope. - The `TraitAnnotation` validation message now says "Tags must…" instead of "Dashboard tags must…". - `docs/specs/dashboard-persistence.md` uses the new name, says that the tags appear in `aspire describe`, and no longer says that user-added tags live in the settings database (they're in browser local storage since #21840). - The resource string key `ResourceTraitDashboardTags` keeps its name. Renaming it would mean editing the resx and Designer files and regenerating the `.xlf` files, and users never see the key. ### Reviewer notes - **No compatibility shim.** The trait was added in #21412 and isn't in any release tag yet, so nothing shipped reads the old name. ### Validation - `Aspire.Hosting.Tests` (`ResourceTraitBuilderTests`, `DashboardServiceDataTerminalTests`): 16 passed. - `Aspire.Dashboard.Tests` (`ResourceTagStoreTests`): 20 passed. - `Aspire.Dashboard.Components.Tests` (`ResourcesLayoutTests`, `ResourceDetailsTests`): 168 passed. - `Aspire.Dashboard.Playwright.Tests` builds. Its tests weren't run locally. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com> (cherry picked from commit 09f1aba)
…1881) ## Description Renames the reserved trait used by `WithTags` from `Aspire_Dashboard_Tag` to `Aspire_Tag`. AppHost tags aren't dashboard-only. The CLI backchannel adds traits to resource snapshots the same way the dashboard does, so `aspire describe --format json` already includes them: ```json "properties": { "resource.trait.Aspire_Tag": ["frontend", "critical"] } ``` With the old name, tools reading that output had to know a dashboard-scoped name for something that isn't dashboard-specific, and the method name (`WithTags`) and the trait name didn't match in scope. ### What changed - `KnownResourceTraits.DashboardTag = "Aspire_Dashboard_Tag"` → `KnownResourceTraits.Tag = "Aspire_Tag"`, with a comment explaining the naming. - The `Aspire_` prefix stays so the reserved name can't collide with user traits added through `WithTrait` (a bare `tag` would pick up tag validation and dashboard tag behavior). - `Aspire_Dashboard_Position` / `WithDashboardPosition` are unchanged: only the dashboard uses a position, so the name matches the scope. - The `TraitAnnotation` validation message now says "Tags must…" instead of "Dashboard tags must…". - `docs/specs/dashboard-persistence.md` uses the new name, says that the tags appear in `aspire describe`, and no longer says that user-added tags live in the settings database (they're in browser local storage since #21840). - The resource string key `ResourceTraitDashboardTags` keeps its name. Renaming it would mean editing the resx and Designer files and regenerating the `.xlf` files, and users never see the key. ### Reviewer notes - **No compatibility shim.** The trait was added in #21412 and isn't in any release tag yet, so nothing shipped reads the old name. ### Validation - `Aspire.Hosting.Tests` (`ResourceTraitBuilderTests`, `DashboardServiceDataTerminalTests`): 16 passed. - `Aspire.Dashboard.Tests` (`ResourceTagStoreTests`): 20 passed. - `Aspire.Dashboard.Components.Tests` (`ResourcesLayoutTests`, `ResourceDetailsTests`): 168 passed. - `Aspire.Dashboard.Playwright.Tests` builds. Its tests weren't run locally. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com> (cherry picked from commit 09f1aba)
Addresses the review feedback from #21412 (Modernize the dashboard experience) that was deferred to the tracking issue #21421. Each item was checked against the current code first. Item 17 was already fixed, and every other item is addressed here. The design questions are answered in a comment below. Fixes #21421 | Items | Change | |---|---| | 1, 3, 6 | Replaces `WithDashboardPosition` with `WithDisplayOrder`, backed by its own `DisplayOrderAnnotation` and transported as `resource.displayOrder`. Like `ResourceUrlAnnotation.DisplayOrder`, it's a relative sort key: higher values appear first and resources without one count as 0. The API isn't in a release yet. Polyglot snapshots and AppHosts are updated. | | 2 | Keeps traits as resource properties, as decided in the review, and corrects the comment that described them. | | 4 | Moves tag validation out of the `TraitAnnotation` constructor into `WithTrait`, which `WithTags` goes through. An `int` parameter covers display order validation. | | 5 | Replaces `unresolved_parameter_names` with a generic `related_resource_names` on the notification message, keeping field number 5. The dashboard offers to show the related resources in place of the primary button, and the parameter form still accepts the notification. | | 7 | Restores the `CircularBuffer` removal checks under `#if DEBUG`, for buffers up to 1,024 items, so large console log buffers don't bring back the CPU cost. | | 8, 20 | Recordings don't mount a live terminal. The missing-parameters form is read-only for recordings and doesn't accept the live AppHost's prompt. | | 9 | `ParameterOverview` and `MissingParametersPanel` edit their own copy of the shared command inputs. | | 10 | Keeps generated input names when a prompt has a dynamically loaded input, because callbacks can read `AllInputs` regardless of `DependsOnInputs`. Names that aren't unique are still renamed, because the prompt can't be shown otherwise, and every other input keeps its name. Each prompt input also carries the parameter it is for (`InteractionInput.related_resource_name`), and the parameter form matches inputs by that field rather than by name. A generated name can then match another, already resolved parameter without the form editing the wrong input. | | 11, 19 | The inline form forwards `UpdateStateOnChange`. Without an active interaction, its file button runs the set-parameter command. | | 12 | Sums delta counter observations per bucket. Repeated delta numbers are no longer merged at ingestion, because that lost their times, and the SQLite rollup now sums them by observation time instead of keeping the largest, without overflowing. Delta numbers are selected by their end, so one that arrives out of order isn't lost. Rollups and chart totals stay finite without depending on the order of the values, so a sum too large for a double no longer stops the chart from rendering, and chart intervals compare times in nanoseconds like the rollup query. Cloning metric values keeps their count, and delta counter cards show the latest change. | | 13 | Preserves negative levels. The main metrics chart shares this calculation, so it's corrected too. | | 14, 15 | A recording's activity window ends at its last request, or its last error log if it has no requests, and has its own labels. In the summary layout, the live window now refreshes every 30 seconds. | | 16 | Scopes the overview's pending refresh flag to the selection, and queues a refresh after console filter changes cancel one. Adds an internal `TelemetryRefreshDelayAsync` seam so a test can hold a refresh open. | | 18 | Ctrl-click after "select all" no longer adds a resource kind that's switched off. | | 21, 22 | Display orders come from the requesting run rather than the store, and moves use the displayed tie-break. | | 23 | Localizes the trace back button. `main` has since localized the activity and insights strings, so this PR only adds the recording-specific ones. | - `Aspire.Dashboard.Tests`: 2,655 passed - `Aspire.Dashboard.Components.Tests`: 1,384 passed, after merging `main` - `Aspire.Hosting.Tests`, limited to the trait, parameter processor, dashboard service and interaction service test classes: 257 passed - Code generation tests for TypeScript, Python, Go, Java and Rust: 412 passed, before the last review fixes, which didn't change exported API - `TestShop.AppHost` builds The regression tests for items 14, 15 and 16 were checked by temporarily undoing each fix and confirming they failed. Not covered: the polyglot AppHosts were renamed but not run, and nothing was checked in a browser. - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [ ] Yes - [x] No. Not needed for `WithDisplayOrder` and `DisplayOrderAnnotation`, as decided in the review. - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [x] 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 - [x] No --------- Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com> (cherry picked from commit 727eaa7) Adapted for release/17.0, which doesn't have the dashboard changes this built on in main (#21840, #21861, #21880, #21881, #21943): - Tags keep release/17.0's Aspire_Dashboard_Tag name (KnownResourceTraits.DashboardTag); the Aspire_Tag rename is #21881. - ResourceOrderStore keeps its SQLite storage. The AppHost display order semantics, GetPositions(resources) and TryMove(..., resources) are ported onto it, and the store no longer keeps AppHost positions itself. - ResourceOrderStoreTests: the four new display order tests run against the SQLite store, with a new store instance standing in for a restart. - Tests for code that isn't on release/17.0 aren't brought over (ParameterFormReplacedAndPromptShownAgain, Standalone_RemovedTelemetrySource). - Resources.Designer.cs and the Go TwoPassScanningGeneratedAspire snapshot are regenerated against release/17.0.
Combines the stacked dashboard backports into one PR for `release/17.0`. The commits are cherry-picked in stack order, one per source PR, onto the current `release/17.0` tip: 1. #22125: Store dashboard tags, resource order and metric pins in browser local storage (#21840) 2. #22126: Add dashboard resource-selector dropdown (#21861) 3. #22127: Rename the WithTags trait from Aspire_Dashboard_Tag to Aspire_Tag (#21881) 4. #22128: Restore single-line compact rows in the dashboard resource list (#21880) 5. #22129: Allocate the next dashboard run ID when two dashboards start in the same millisecond (#21913) 6. #22130: Simplify the dashboard around its two main jobs (#21943) 7. #22131: Return 400 for OTLP JSON requests with malformed ids (#21436) 8. #22132: Address deferred review feedback for the modern dashboard (#21766) ## Conflict resolution The stack was cut from an older `release/17.0`. Since then, #22123 (Harden Go SDK runtime) landed and regenerated `TwoPassScanningGeneratedAspire.verified.go`. That conflicted with #21766, which replaces `WithDashboardPosition` with `WithDisplayOrder`. The resolution drops `WithDashboardPosition` and regenerates the snapshot with the current Go generator, so `WithDisplayOrder` now uses the hardened `s.Err()` pattern. The other seven commits applied cleanly. ## Validation All `Aspire.Hosting.CodeGeneration.*.Tests` projects pass locally (Go, Java, Python, Rust, TypeScript). --------- Co-authored-by: Sébastien Ros <1165805+sebastienros@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: James Newton-King <james@newtonking.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: David Fowler <davidfowl@gmail.com> Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Maddy Montaquila <maddyleger1@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Maddy Montaquila <maddy@MadBook-Pro-20.local> Co-authored-by: Taha Koçal <tahakocalgs@gmail.com> Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Description
Renames the reserved trait used by
WithTagsfromAspire_Dashboard_TagtoAspire_Tag.AppHost tags aren't dashboard-only. The CLI backchannel adds traits to resource snapshots the same way the dashboard does, so
aspire describe --format jsonalready includes them:With the old name, tools reading that output had to know a dashboard-scoped name for something that isn't dashboard-specific, and the method name (
WithTags) and the trait name didn't match in scope.What changed
KnownResourceTraits.DashboardTag = "Aspire_Dashboard_Tag"→KnownResourceTraits.Tag = "Aspire_Tag", with a comment explaining the naming.Aspire_prefix stays so the reserved name can't collide with user traits added throughWithTrait(a baretagwould pick up tag validation and dashboard tag behavior).Aspire_Dashboard_Position/WithDashboardPositionare unchanged: only the dashboard uses a position, so the name matches the scope.TraitAnnotationvalidation message now says "Tags must…" instead of "Dashboard tags must…".docs/specs/dashboard-persistence.mduses the new name, says that the tags appear inaspire describe, and no longer says that user-added tags live in the settings database (they're in browser local storage since Store dashboard tags, resource order and metric pins in browser local storage #21840).ResourceTraitDashboardTagskeeps its name. Renaming it would mean editing the resx and Designer files and regenerating the.xlffiles, and users never see the key.Reviewer notes
Validation
Aspire.Hosting.Tests(ResourceTraitBuilderTests,DashboardServiceDataTerminalTests): 16 passed.Aspire.Dashboard.Tests(ResourceTagStoreTests): 20 passed.Aspire.Dashboard.Components.Tests(ResourcesLayoutTests,ResourceDetailsTests): 168 passed.Aspire.Dashboard.Playwright.Testsbuilds. Its tests weren't run locally.Checklist