-
Notifications
You must be signed in to change notification settings - Fork 154
Add integration for Flyway #1077
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 a new Flyway integration for .NET Aspire, enabling database migration capabilities. Flyway is a popular database migration tool that supports multiple database systems. The integration includes the base Flyway hosting package and PostgreSQL-specific extensions as the first database implementation.
- Adds
CommunityToolkit.Aspire.Hosting.Flywaypackage with core Flyway resource definitions and configuration - Adds PostgreSQL extension methods (
WithFlywayMigrationandWithFlywayRepair) to the PostgreSQL.Extensions package - Includes comprehensive tests and four example projects demonstrating various usage scenarios
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 24 comments.
Show a summary per file
| File | Description |
|---|---|
| src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResource.cs | Defines the core FlywayResource as a ContainerResource |
| src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResourceConfiguration.cs | Configuration model for Flyway container image and migration scripts path |
| src/CommunityToolkit.Aspire.Hosting.Flyway/DistributedApplicationBuilderExtensions.cs | Extension methods to add Flyway resources to the application builder |
| src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResourceBuilderExtensions.cs | Extension method for telemetry opt-in configuration |
| src/CommunityToolkit.Aspire.Hosting.Flyway/README.md | Documentation for the base Flyway integration |
| src/CommunityToolkit.Aspire.Hosting.Flyway/CommunityToolkit.Aspire.Hosting.Flyway.csproj | Project file for the Flyway integration package |
| src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/PostgresDatabaseResourceBuilderExtensions.cs | PostgreSQL-specific extension methods for Flyway migration and repair |
| src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/README.md | Updated documentation including Flyway usage examples |
| src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.csproj | Added project reference to Flyway package |
| tests/CommunityToolkit.Aspire.Hosting.Flyway.Tests/* | Unit tests for core Flyway functionality |
| tests/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.Tests/ResourceCreationTests.cs | Tests for PostgreSQL Flyway integration |
| examples/flyway/* | Four example projects demonstrating basic usage, container configuration, custom configuration, and repair scenarios |
| CommunityToolkit.Aspire.slnx | Updated solution file to include new projects |
tests/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.Tests/ResourceCreationTests.cs
Outdated
Show resolved
Hide resolved
tests/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.Tests/ResourceCreationTests.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Flyway/DistributedApplicationBuilderExtensions.cs
Show resolved
Hide resolved
...ityToolkit.Aspire.Hosting.PostgreSQL.Extensions/PostgresDatabaseResourceBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
...ityToolkit.Aspire.Hosting.PostgreSQL.Extensions/PostgresDatabaseResourceBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
tests/CommunityToolkit.Aspire.Hosting.Flyway.Tests/FlywayResourceBuilderExtensionsTests.cs
Outdated
Show resolved
Hide resolved
tests/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.Tests/ResourceCreationTests.cs
Outdated
Show resolved
Hide resolved
tests/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.Tests/ResourceCreationTests.cs
Outdated
Show resolved
Hide resolved
35b2521 to
24ca8aa
Compare
aaronpowell
left a comment
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.
Overall it's pretty bang on, just a small change around how the container image is defined and used to ensure consistency, and you'll need to run generate-test-list-for-workflow.sh to update the tests workflow to ensure the tests are run.
src/CommunityToolkit.Aspire.Hosting.Flyway/DistributedApplicationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Flyway/FlywayResourceConfiguration.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Flyway/DistributedApplicationBuilderExtensions.cs
Show resolved
Hide resolved
Introduces CommunityToolkit.Aspire.Hosting.Flyway, enabling Flyway as a container resource. It includes the extension methods for adding and configuring Flyway, and it is the base for database-specific migrations integration.
Integrate Flyway database migration support into CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions.
Added four Flyway sample projects demonstrating basic usage, container configuration, custom resource configuration, and repair command.
Closes #1066
This PR adds the base Flyway integration and the first of several Flyway database resource integration, PostgreSQL.
PR Checklist
Other information
None.