-
Notifications
You must be signed in to change notification settings - Fork 98
Add DbGate support for MySql #695
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
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 support for integrating DbGate with MySQL resources by introducing a new WithDbGate extension method, updating documentation and examples, and extending test coverage to validate the new functionality.
- Added the WithDbGate extension method in MySqlBuilderExtensions to configure DbGate container resources.
- Updated tests, documentation, and project references to support the new DbGate integration with MySQL.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/CommunityToolkit.Aspire.Hosting.MySql.Extensions.Tests/ResourceCreationTests.cs | Added multiple tests to validate annotations and configuration for DbGate integration. |
tests/CommunityToolkit.Aspire.Hosting.DbGate.Tests/AddDbGateTests.cs | Updated tests to include MySQL resource annotations and resource naming changes. |
src/CommunityToolkit.Aspire.Hosting.MySql.Extensions/README.md | Updated README to reflect support for DbGate alongside Adminer. |
src/CommunityToolkit.Aspire.Hosting.MySql.Extensions/MySqlBuilderExtensions.cs | Introduced the WithDbGate extension method and configuration logic for MySQL resources. |
src/CommunityToolkit.Aspire.Hosting.DbGate/DbGateContainerImageTags.cs | Adjusted XML documentation from summary to remarks for consistency. |
examples/mysql-ext/CommunityToolkit.Aspire.Hosting.MySql.Extensions.AppHost/Program.cs | Updated sample to demonstrate DbGate usage with custom host port. |
examples/dbgate/CommunityToolkit.Aspire.Hosting.DbGate.AppHost/Program.cs | Added example usage of DbGate with multiple MySQL resources. |
examples/dbgate/CommunityToolkit.Aspire.Hosting.DbGate.AppHost/CommunityToolkit.Aspire.Hosting.DbGate.AppHost.csproj | Included project reference for MySQL Extensions to support DbGate integration. |
Comments suppressed due to low confidence (2)
src/CommunityToolkit.Aspire.Hosting.MySql.Extensions/MySqlBuilderExtensions.cs:101
- The early exit based on the existence of 'LABEL_mysql1' may skip configuration for additional MySQL instances when multiple WithDbGate calls occur; consider revising the logic to aggregate annotations from all resources or add detailed documentation explaining this behavior.
if (context.EnvironmentVariables.ContainsKey("LABEL_mysql" + counter))
src/CommunityToolkit.Aspire.Hosting.MySql.Extensions/MySqlBuilderExtensions.cs:126
- [nitpick] Consider renaming the local variable 'CONNECTIONS' to follow camelCase (e.g., 'existingConnections') since it is not a constant.
string CONNECTIONS = context.EnvironmentVariables.GetValueOrDefault("CONNECTIONS")?.ToString() ?? string.Empty;
Minimum allowed line rate is |
**Contributes #415 **
This pull request introduces support for integrating DbGate with MySQL resources. It includes updates to the core functionality, examples, documentation, and tests to enable and validate this feature. The most important changes are grouped below:
Core Functionality Enhancements:
WithDbGate
extension method inMySqlBuilderExtensions
to integrate DbGate with MySQL resources. This method configures environment variables and supports multiple MySQL instances.DbGateContainerImageTags
to use<remarks>
instead of<summary>
for better documentation consistency.Example Updates:
examples/dbgate/CommunityToolkit.Aspire.Hosting.DbGate.AppHost/Program.cs
to demonstrate the use ofWithDbGate
with multiple MySQL instances.examples/mysql-ext/CommunityToolkit.Aspire.Hosting.MySql.Extensions.AppHost/Program.cs
to include a DbGate configuration example alongside Adminer.Documentation Improvements:
CommunityToolkit.Aspire.Hosting.MySql.Extensions
to include DbGate as a supported tool for MySQL interaction, with updated usage examples. [1] [2]Testing Additions:
AddDbGateTests
andResourceCreationTests
to validate the integration of DbGate with MySQL resources, including environment variable configurations, container image tags, and support for multiple instances. [1] [2] [3]Dependency Updates:
CommunityToolkit.Aspire.Hosting.DbGate
inCommunityToolkit.Aspire.Hosting.MySql.Extensions.csproj
to enable the new functionality.PR Checklist
Other information