-
-
Notifications
You must be signed in to change notification settings - Fork 254
Improve Boilerplate aspire configuration (#11058) #11059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes update the boilerplate template's Aspire configuration, including package references, service registration logic, and connection string formats for MinIO S3 and Azure Blob Storage. The MinIO container setup is refactored for clarity and maintainability, and helper methods for extracting connection string values are introduced. Some configuration values and method calls are updated for consistency. Changes
Sequence Diagram(s)sequenceDiagram
participant AppHost as Boilerplate.Server.AppHost
participant MinIO as MinIO Container
participant Api as Boilerplate.Server.Api
participant Config as appsettings.json
participant Storage as Blob Storage Service
AppHost->>MinIO: AddMinioContainer(rootUser, rootPassword)
AppHost->>Api: WithReference("MinIOS3ConnectionString")
Api->>Config: Read "MinIOS3ConnectionString"
Api->>Api: GetValue(connectionString, key)
Api->>Storage: Register MinIO blob storage with extracted Endpoint, AccessKey, SecretKey
Assessment against linked issues
Poem
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the boilerplate’s Aspire configuration by standardizing MinIO support, updating connection formats, and aligning package versions.
- Switches MinIOS3ConnectionString format across settings and container setup
- Replaces manual MinIO container registration with
AddMinioContainerand refactors blob-storage service registration - Adds and bumps related package versions (Minio hosting, Pomelo, Twilio)
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/.../Boilerplate.Server.Web/appsettings.json | Updated MinIOS3ConnectionString to new Endpoint;AccessKey;SecretKey format |
| src/.../Endpoints/SiteMapsEndpoint.cs | Replaced GetWebAppUrl() with GetBaseUrl() for URL building |
| src/.../Boilerplate.Server.AppHost/Program.cs | Simplified Azurite and MinIO container setup; added AddMinioContainer |
| src/.../Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj | Added CommunityToolkit.Aspire.Hosting.Minio package reference |
| src/.../Boilerplate.Server.Api/appsettings.json | Aligned MinIOS3ConnectionString in API settings |
| src/.../Boilerplate.Server.Api/Program.Services.cs | Refactored blob-storage registration; unified connection parsing with GetValue |
| src/Directory.Packages.props | Added Minio package version entry and bumped Pomelo & Twilio versions |
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting
📒 Files selected for processing (7)
src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props(3 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs(3 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/SiteMapsEndpoint.cs(3 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/appsettings.json(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build and test
🔇 Additional comments (13)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj (1)
18-18: LGTM! Package reference correctly added for MinIO support.The conditional package reference for
CommunityToolkit.Aspire.Hosting.Miniofollows the established pattern and appropriately includes the MinIO hosting package when S3 storage is configured.src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json (1)
21-21: Improved connection string format for better parsing.The new semicolon-separated key-value format (
Endpoint,AccessKey,SecretKey) is cleaner and easier to parse than the previous URI-like format. This change aligns well with the MinIO client initialization refactoring mentioned in the AI summary.Note: The static analysis errors about JSON parsing are false positives caused by the conditional compilation directives in this template file and can be safely ignored.
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/appsettings.json (1)
9-9: Consistent connection string format across projects.The MinIO connection string format change matches the one in the API project, ensuring consistency across the server projects. This standardization will make configuration management easier.
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/SiteMapsEndpoint.cs (1)
35-35: Approve method rename: GetBaseUrl() is available and correctVerified that the
GetBaseUrl()extension is defined in
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Shared/Extensions/HttpRequestExtensions.cs
returning aUri, so calls likenew Uri(baseUrl, u)inSiteMapsEndpoint.csresolve correctly. No further action required.src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs (3)
36-36: Simplified Azurite configuration.Removing the explicit port settings and keeping only the data volume configuration makes the Azurite setup cleaner and more maintainable.
41-43: Excellent refactoring of MinIO container setup.The refactoring from verbose manual container configuration to using
AddMinioContainerwith parameters is a significant improvement:
- Much cleaner and more readable code
- Proper secret handling for the password parameter
- Leverages the community toolkit's dedicated MinIO support
64-64: Improved container reference pattern.Using
WithReferencewith named connection strings is cleaner than setting environment variables directly. This approach provides better integration with Aspire's configuration system and aligns with the new connection string format.Also applies to: 79-79
src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props (3)
46-46: New MinIO package addition looks good.The conditional package reference for
CommunityToolkit.Aspire.Hosting.Miniois properly configured to include the package when bothaspireandfilesStorageconditions are met for S3 storage.
88-88: MySQL EF Core package version update.The package version update from
9.0.0-preview.2.efcore.9.0.0to9.0.0-preview.3.efcore.9.0.0appears to be a routine update to a newer preview version.
115-115: Twilio package version update.The package version update from
7.11.3to7.11.4appears to be a routine patch update.src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs (3)
88-93: Local file storage configuration looks good.The local file storage configuration is now properly structured with clear conditional compilation directives and maintains the existing Docker volume detection logic.
97-98: Azure Blob Storage configuration improvement.The refactoring to use the new
GetValuemethod for extracting the account key improves code consistency. The special handling for the development storage connection string is preserved correctly.
104-105: S3/MinIO storage configuration refactoring.The explicit parameter extraction approach using the
GetValuemethod is cleaner and more maintainable than the previous connection string parsing approach. The parameters (AccessKey,SecretKey,Endpoint) are now clearly defined.
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Yaser Moradi <ysmoradi@outlook.com>
closes #11058
Summary by CodeRabbit
New Features
Improvements
Dependency Updates