dotnet / aspire

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

PythonAppResource should be in the Aspire.Hosting namespace #6631

Open DamianEdwards opened 4 days ago

DamianEdwards commented 4 days ago

Is there an existing issue for this?

Describe the bug

PythonAppResource is in the namespace Aspire.Hosting.Python, whereas NodeAppResource is directly in Aspire.Hosting. This is inconsistent, we should put PythonAppResource in Aspire.Hosting.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

eerhardt commented 4 days ago

I think NodeAppResource might be the outlier here. Mostly, we put the Resource classes in Aspire.Hosting.ApplicationModel. For Azure, they all are in Aspire.Hosting.Azure. Python, and Dapr each have Aspire.Hosting.XX.

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Dapr/DaprComponentResource.cs#L6-L11

A sample of other resource classes:

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Elasticsearch/ElasticsearchResource.cs#L4-L9

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Milvus/MilvusServerResource.cs#L6-L11

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.MongoDB/MongoDBServerResource.cs#L4-L10

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Redis/RedisResource.cs#L4-L10

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.RabbitMQ/RabbitMQServerResource.cs#L4-L9

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.PostgreSQL/PostgresServerResource.cs#L7-L12

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Qdrant/QdrantServerResource.cs#L4-L9

Milvus also appears to be an outlier.

eerhardt commented 4 days ago

All Azure resources are in Aspire.Hosting.Azure except the following:

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBResource.cs#L7-L12

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Azure.SignalR/AzureSignalRResource.cs#L6-L13

https://github.com/dotnet/aspire/blob/2e60ee60398402a51f15e17d1115587ed523510e/src/Aspire.Hosting.Azure.WebPubSub/AzureWebPubSubResource.cs#L6-L13

DamianEdwards commented 3 days ago

Hmm OK. Seems we haven't been particularly consistent with this ☹