Skip to content

[release/17.0] Rename the WithTags trait from Aspire_Dashboard_Tag to Aspire_Tag - #22127

Closed
Sébastien Ros (sebastienros) wants to merge 1 commit into
sebros/backport-21861-to-release-17.0from
sebros/backport-21881-to-release-17.0
Closed

Sébastien Ros (sebastienros) wants to merge 1 commit into
sebros/backport-21861-to-release-17.0from
sebros/backport-21881-to-release-17.0

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Backport of #21881 to release/17.0

/cc Sébastien Ros (@sebastienros)

Note

Part of a chain of dashboard backports. This PR targets the branch of #22126, so review only its own commit. Merge the chain in order; GitHub retargets each PR as its base merges.

Customer Impact

Testing

Risk

Regression?

…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)
@joperezr

Copy link
Copy Markdown
Member

Closing this individual backport because its changes are included in #22186, which consolidates all eight dashboard backports into one PR for release/17.0. This keeps review and CI validation together and avoids merging the same changes separately. Please track further work in #22186.

Jose Perez Rodriguez (joperezr) added a commit that referenced this pull request Nov 12, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants