Skip to content

Add Adminer support for MySql #686

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

Merged
merged 2 commits into from
May 20, 2025
Merged

Conversation

Alirexaa
Copy link
Member

Contributes to #643

This pull request introduces a new integration for MySQL hosting with Adminer support in the CommunityToolkit.Aspire project. It includes updates to workflows, solution files, examples, and tests to support the new functionality. The most important changes are grouped below by theme.

Workflow and Solution Updates:

  • Updated .github/workflows/tests.yaml to include new MySQL-related tests (Hosting.MySql.Extensions.Tests) and reorganized test entries for consistency. [1] [2]
  • Added new projects for MySQL hosting and extensions to the CommunityToolkit.Aspire.sln solution file, including CommunityToolkit.Aspire.Hosting.MySql.Extensions and related test and example projects. [1] [2] [3]

MySQL Integration:

  • Created a new project CommunityToolkit.Aspire.Hosting.MySql.Extensions with a WithAdminer extension method to integrate Adminer for MySQL hosting. This includes support for configuring Adminer containers and managing MySQL server resources. [1] [2]
  • Added a README.md file for the MySQL extensions project, providing documentation and usage examples.

Examples:

  • Added a new example project (examples/mysql-ext) demonstrating the MySQL integration with Adminer, including configuration files like Program.cs, appsettings.json, and launchSettings.json. [1] [2] [3] [4]

Tests:

  • Updated existing Adminer tests to include MySQL scenarios, validating that Adminer correctly supports multiple database types. [1] [2] [3]
  • Added a new test project CommunityToolkit.Aspire.Hosting.MySql.Extensions.Tests to verify the functionality of the MySQL integration, including a test to ensure the Adminer resource starts and responds correctly. [1] [2]

Dependency Updates:

  • Updated Directory.Packages.props to include the new Aspire.Hosting.MySql package version.
  • Updated project dependencies across related files to reference the new MySQL extensions project.

PR Checklist

  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

@Alirexaa Alirexaa requested review from aaronpowell and Copilot May 16, 2025 12:21
Copy link
Contributor

@Copilot 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 introduces MySQL hosting integration with Adminer support for the Aspire project. It adds new MySQL extensions, updates tests and examples to verify the Adminer functionality, revises project and solution files, and adjusts the CI workflow to include MySQL tests.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/CommunityToolkit.Aspire.Hosting.MySql.Extensions.Tests/ResourceCreationTests.cs Adds tests for verifying environment annotations and Adminer configuration for MySQL resources.
tests/CommunityToolkit.Aspire.Hosting.Adminer.Tests/AddAdminerTests.cs Updates tests to include MySQL resource scenarios within multi-database Adminer configurations.
src/CommunityToolkit.Aspire.Hosting.MySql.Extensions/MySqlBuilderExtensions.cs Implements the Adminer integration extension method and environment configuration logic for MySQL hosting.
README.md, .csproj, examples/, Directory.Packages.props, CommunityToolkit.Aspire.sln Add project references, documentation, and configuration updates to support the new MySQL integration.
.github/workflows/tests.yaml Updates test workflows to include MySQL integration tests.
Comments suppressed due to low confidence (1)

src/CommunityToolkit.Aspire.Hosting.MySql.Extensions/MySqlBuilderExtensions.cs:59

  • [nitpick] Consider renaming 'new_servers' to 'newServers' to follow C# naming conventions for local variables.
var new_servers = mysqlInstances.ToDictionary(

@Alirexaa Alirexaa added this to the 9.5 milestone May 16, 2025
@Alirexaa Alirexaa temporarily deployed to azure-artifacts May 16, 2025 12:32 — with GitHub Actions Inactive
Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.EventStore 100% 100% 46
CommunityToolkit.Aspire.GoFeatureFlag 100% 97% 74
CommunityToolkit.Aspire.Hosting.ActiveMQ 80% 40% 100
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.Adminer 73% 50% 20
CommunityToolkit.Aspire.Hosting.Azure.Dapr 67% 50% 828
CommunityToolkit.Aspire.Hosting.Azure.Dapr.Redis 97% 88% 36
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 100% 100% 22
CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps 100% 100% 28
CommunityToolkit.Aspire.Hosting.Bun 82% 71% 54
CommunityToolkit.Aspire.Hosting.Dapr 63% 51% 724
CommunityToolkit.Aspire.Hosting.DbGate 94% 50% 18
CommunityToolkit.Aspire.Hosting.Deno 84% 75% 72
CommunityToolkit.Aspire.Hosting.EventStore 94% 100% 18
CommunityToolkit.Aspire.Hosting.GoFeatureFlag 93% 50% 18
CommunityToolkit.Aspire.Hosting.Golang 94% 50% 16
CommunityToolkit.Aspire.Hosting.Java 69% 72% 120
CommunityToolkit.Aspire.Hosting.k6 58% 12% 20
CommunityToolkit.Aspire.Hosting.LavinMQ 78% 50% 18
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.MailPit 91% 50% 14
CommunityToolkit.Aspire.Hosting.Meilisearch 73% 57% 50
CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 96% 83% 36
CommunityToolkit.Aspire.Hosting.MySql.Extensions 100% 94% 40
CommunityToolkit.Aspire.Hosting.Ngrok 52% 35% 82
CommunityToolkit.Aspire.Hosting.NodeJS.Extensions 90% 69% 96
CommunityToolkit.Aspire.Hosting.Ollama 67% 69% 162
CommunityToolkit.Aspire.Hosting.PapercutSmtp 92% 50% 10
CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions 98% 88% 92
CommunityToolkit.Aspire.Hosting.Python.Extensions 68% 55% 90
CommunityToolkit.Aspire.Hosting.RavenDB 63% 49% 136
CommunityToolkit.Aspire.Hosting.Redis.Extensions 100% 80% 40
CommunityToolkit.Aspire.Hosting.Rust 94% 83% 16
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 75% 62% 130
CommunityToolkit.Aspire.Hosting.Sqlite 97% 91% 54
CommunityToolkit.Aspire.Hosting.SqlServer.Extensions 100% 85% 76
CommunityToolkit.Aspire.MassTransit.RabbitMQ 100% 100% 30
CommunityToolkit.Aspire.Meilisearch 97% 92% 68
CommunityToolkit.Aspire.Microsoft.Data.Sqlite 37% 27% 194
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite 51% 50% 92
CommunityToolkit.Aspire.OllamaSharp 71% 64% 98
CommunityToolkit.Aspire.RavenDB.Client 60% 53% 237
Summary 71% (6486 / 9101) 58% (1997 / 3458) 4103

Minimum allowed line rate is 60%

@Alirexaa Alirexaa temporarily deployed to azure-artifacts May 19, 2025 20:02 — with GitHub Actions Inactive
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.

2 participants