dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.83k stars 457 forks source link

Give custom resources friendly names [Prev: Simplify SqlServerDatabase Resource Type] #5555

Open afscrome opened 2 months ago

afscrome commented 2 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

Project, Container and Executable resoruces have nice concice names in the Type column of the Resources page (and in the Resource Types filter).

image

Describe the solution you'd like

It would be nice if SqlServerDatabaseResource (and possibly other resources) could have a similarly concise name. (e.g. SqlDatabase or SqlServerDatabase)

Additional context

No response

maddymontaquila commented 2 months ago

Gonna close this as a dupe of #2595 since we'd ideally address this as part of that work. Great call though - completely agree 💯

maddymontaquila commented 2 months ago

Another option is to just make custom resources look nicer with a lil change so we could do that in the meantime

JamesNK commented 1 month ago

@mitchdenny @davidfowl Where does this name come from? Is it the type name? If so, could a fix be a simple as removing "Resource" suffix from the type name?

davidfowl commented 1 month ago

We can do that, but it seemed a little aggressive to assume 😄:

https://github.com/dotnet/aspire/blob/47e3e25e51c60627aa5fa9a4bf4aaeaf26402ce2/src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs#L348

JamesNK commented 1 month ago

What is the alternative? Add a ResourceTypeNameAnnotation?

davidfowl commented 1 month ago

Resources can already set it using WithInitialState