Skip to content

Conversation

@ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented Jul 4, 2025

closes #11058

Summary by CodeRabbit

  • New Features

    • Added support for S3-compatible storage using MinIO, with streamlined configuration and package integration.
  • Improvements

    • Updated the format for MinIO S3 connection strings in configuration files to use standard key-value pairs.
    • Enhanced blob storage service registration for improved flexibility and maintainability.
    • Simplified and modernized container setup for Azurite and MinIO in development environments.
    • Improved URL handling in sitemap endpoints for more accurate base URL generation.
  • Dependency Updates

    • Upgraded Pomelo.EntityFrameworkCore.MySql and Twilio package versions.

@ysmoradi ysmoradi requested review from Copilot and msynk July 4, 2025 16:49
@coderabbitai
Copy link

coderabbitai bot commented Jul 4, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The 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

File(s) Change Summary
.../Directory.Packages.props Added conditional package for Minio, updated versions for Pomelo.EntityFrameworkCore.MySql and Twilio.
.../Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj Added conditional package reference for CommunityToolkit.Aspire.Hosting.Minio based on filesStorage property.
.../Server/Boilerplate.Server.AppHost/Program.cs Refactored MinIO and Azurite container setup; switched to AddMinioContainer and updated connection string usage.
.../Server/Boilerplate.Server.Api/Program.Services.cs Generalized connection string parsing; updated MinIO S3 and Azure Blob service registration logic.
.../Server/Boilerplate.Server.Api/appsettings.json
.../Server/Boilerplate.Server.Web/appsettings.json
Updated MinIO S3 connection string format to key-value pairs; removed bucket/serviceUrl.
.../Server/Boilerplate.Server.Web/Endpoints/SiteMapsEndpoint.cs Replaced GetWebAppUrl() with GetBaseUrl() for sitemap endpoint responses.

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
Loading

Assessment against linked issues

Objective Addressed Explanation
Improve Aspire configuration in boilerplate template (#11058)
Refactor MinIO setup and connection string handling for clarity and maintainability (#11058)
Update package references and conditional logic for S3/MinIO support (#11058)
Generalize connection string parsing for storage providers (#11058)

Poem

In the warren of code, a MinIO hops in,
With keys and endpoints, let storage begin!
Connection strings pruned, containers now neat,
Aspire’s new toolkit makes S3 support sweet.
Packages updated, the garden in bloom—
This bunny’s delighted, there’s plenty of room! 🐇✨

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in a Comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

Copilot AI left a 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 AddMinioContainer and 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

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0427e3a and 8d5442d.

📒 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.Minio follows 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 correct

Verified that the GetBaseUrl() extension is defined in
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Shared/Extensions/HttpRequestExtensions.cs
returning a Uri, so calls like new Uri(baseUrl, u) in SiteMapsEndpoint.cs resolve 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 AddMinioContainer with 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 WithReference with 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.Minio is properly configured to include the package when both aspire and filesStorage conditions 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.0 to 9.0.0-preview.3.efcore.9.0.0 appears to be a routine update to a newer preview version.


115-115: Twilio package version update.

The package version update from 7.11.3 to 7.11.4 appears 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 GetValue method 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 GetValue method is cleaner and more maintainable than the previous connection string parsing approach. The parameters (AccessKey, SecretKey, Endpoint) are now clearly defined.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Yaser Moradi <ysmoradi@outlook.com>
@msynk msynk merged commit 90efdc8 into bitfoundation:develop Jul 4, 2025
3 checks passed
@ysmoradi ysmoradi deleted the 11058 branch July 5, 2025 11:58
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.

Boilerplate project template aspire configuration needs improvements

2 participants