-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add secret/env based parameters to bit Boilerplate aspire (#11081) #11082
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 introduce secure, environment/secret-based password parameters for database and storage service configurations in the Bit Boilerplate Aspire setup. New secret parameters are added in configuration files and application code, and credentials are now explicitly passed to service builders. Sample connection strings and documentation comments are also updated. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AppHost
participant Config
participant DatabaseBuilder
participant StorageBuilder
User->>AppHost: Start application
AppHost->>Config: Read Parameters (passwords, usernames)
AppHost->>DatabaseBuilder: Pass secret password parameters for DBs
AppHost->>StorageBuilder: Pass secret credentials for MinIO
DatabaseBuilder-->>AppHost: DB configured with secret
StorageBuilder-->>AppHost: Storage configured with secret
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
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 adds environment/secret-based parameters for database and storage credentials, updates container image versions, and includes a sample placeholder for Cloudflare R2.
- Introduce a
Parameterssection in the AppHostappsettings.jsonfor MinIO, Postgres, SQL Server, and MySQL credentials. - Refactor
Program.csto usebuilder.AddParameter(withsecret: truewhere appropriate) for fetching credentials. - Bump the Aspire dashboard container to version
9.3and add a Cloudflare R2 sample placeholder in the Server API settings.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/appsettings.json | Added Parameters block with default credential values |
| src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs | Switched to AddParameter for SQL, Postgres, MySQL, and MinIO passwords |
| src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs | Updated aspire-dashboard image tag from 9.0 to 9.3 |
| src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json | Added MinIOS3ConnectionString__CloudflareR2Sample placeholder |
Comments suppressed due to low confidence (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json:25
- [nitpick] This sample value isn’t a valid connection string and could confuse consumers. Consider clearly marking it as a placeholder or removing it until actual support is available.
"MinIOS3ConnectionString__CloudflareR2Sample": "Not supported yet: https://github.com/robinrodricks/FluentStorage/issues/114",
...Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/appsettings.json
Show resolved
Hide resolved
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.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: 0
🧹 Nitpick comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/appsettings.json (1)
9-15: Good addition of parameter defaults for development.The new "Parameters" section provides appropriate default values for the secret parameters defined in Program.cs. The parameter names match correctly with the code implementation.
Consider adding a comment to clarify that these are development credentials:
"Parameters": { + "_Comment": "Development credentials - override with secure values in production", "MinIOUser": "minioadmin", "MinIOPassword": "minioadmin", "PostgresPassword": "AN|w$&n1l4oh", "SqlServerPassword": "Qjs|@&B1'u-K", "MySqlPassword": ">f_G[zD`l|i8" }
📜 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 (4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs(1 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs(2 hunks)src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/appsettings.json(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build and test
🔇 Additional comments (5)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs (1)
17-17: Confirm compatibility with Aspire dashboard v9.3The Docker image update from “9.0” to “9.3” is valid—the tags 9.0 through 9.3 all exist on MCR. Automated retrieval of release details via the GitHub API failed due to unexpected response format. Please manually verify that v9.3 introduces no breaking changes and test the dashboard integration locally before merging.
• File: src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs (line 17)
• Review the v9.3 release notes: https://github.com/dotnet/aspire/releases/tag/v9.3
• Run a local integration test with the updated image tag to ensure compatibilitysrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json (1)
25-25: Good addition of Cloudflare R2 sample entry.The new connection string entry clearly indicates that Cloudflare R2 is not yet supported and provides a helpful reference to the relevant GitHub issue. This will inform users about the current limitations.
Note: The static analysis parse errors are false positives caused by the template syntax (conditional comments like
//#if,//#elif,//#endif) that Biome doesn't recognize. These can be safely ignored.src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs (3)
8-8: Helpful comment addition.The comment directing users to check
appsettings.jsonfor credential settings is a good addition that improves developer experience.
11-12: Excellent implementation of secure database password parameters.The addition of secret parameters for database passwords is a significant security improvement. The parameters are correctly marked as
secret: trueand properly passed to the respective database builders.The implementation follows Aspire best practices:
- Parameters are defined as secrets to prevent exposure in logs
- Parameter names match those in
appsettings.json- Passwords are passed explicitly to the database builders
Also applies to: 20-21, 29-30
48-50: Good implementation of MinIO credential parameters.The MinIO credential parameters are properly implemented with the password marked as secret. The parameter names have been updated to be more descriptive (
MinIOUserandMinIOPassword).The implementation correctly:
- Separates username and password parameters
- Marks the password as secret for security
- Passes both credentials to the MinIO container builder
…te.Server.AppHost/Program.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Yaser Moradi <ysmoradi@outlook.com>
closes #11081
Summary by CodeRabbit
New Features
Chores