Skip to content

make this more readable.#117

Merged
jun92 merged 1 commit into
mainfrom
improve-a-bit-for-aspire-conf
May 20, 2026
Merged

make this more readable.#117
jun92 merged 1 commit into
mainfrom
improve-a-bit-for-aspire-conf

Conversation

@jun92
Copy link
Copy Markdown
Owner

@jun92 jun92 commented May 20, 2026

No description provided.

@jun92 jun92 added this to the Prototype milestone May 20, 2026
@jun92 jun92 self-assigned this May 20, 2026
@jun92 jun92 added the enhancement New feature or request label May 20, 2026
@jun92 jun92 added this to ABMGS May 20, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in ABMGS May 20, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Aspire AppHost to centralize project registration and renames the database connection string and resource name from "SyncnetPlatform" to "postgres" across the frontend and silo extensions. Feedback indicates that hardcoding the connection string name "postgres" in a generic method limits its reusability and suggests using a parameter instead. Furthermore, the reviewer noted that renaming the database resource to "postgres" is a regression in clarity and could lead to naming collisions, recommending more descriptive resource names.

builder.Services.AddDbContextPool<DbContextType>(opt =>
{
opt.UseNpgsql(builder.Configuration.GetConnectionString("SyncnetPlatform"), optionBuilder =>
opt.UseNpgsql(builder.Configuration.GetConnectionString("postgres"), optionBuilder =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the connection string name "postgres" inside the generic method RegisterDbContext<DbContextType> limits its reusability. If a different DbContext type is registered using this method, it will still attempt to use the same connection string. Consider making the connection string name a parameter or using a convention based on the type name to maintain the generic nature of the method.

Comment thread Source/AppHost/AppHost.cs
.WithReference(redis)
.WithReference(rdbms)
;
.AddDatabase("postgres", databaseName: "SyncnetPlatform");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Renaming the database resource from "SyncnetPlatform" to "postgres" is a regression in clarity. Resource names in Aspire should describe the purpose of the resource (e.g., "SyncnetDb") rather than the underlying technology. Using a generic name like "postgres" can lead to naming collisions if the application expands to use multiple PostgreSQL databases in the future. Additionally, naming the server "npgsql" and the database "postgres" is counter-intuitive.

@jun92 jun92 merged commit 0bca3fa into main May 20, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in ABMGS May 20, 2026
@jun92 jun92 deleted the improve-a-bit-for-aspire-conf branch May 20, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant