Enhance Docker container management with new commands and cleanup features.#18
Merged
gustavofreze merged 1 commit intomainfrom Apr 13, 2026
Merged
Enhance Docker container management with new commands and cleanup features.#18gustavofreze merged 1 commit intomainfrom
gustavofreze merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the library’s Docker container lifecycle support by introducing a dedicated Flyway container API and adding managed-resource cleanup (container removal + labeled network pruning), along with documentation and test updates.
Changes:
- Added
FlywayDockerContainer/FlywayContainerfor configuring and running Flyway commands against a MySQL source. - Introduced managed-resource cleanup via
ContainerStarted::remove()andContainerStarted::stopOnShutdown(), plus labeled network creation and pruning. - Updated unit/integration tests, README, and Makefile to reflect parallel image pulls, Flyway usage, and managed network labeling.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/bootstrap.php | Enables strict typing for the test bootstrap. |
| tests/Unit/MySQLDockerContainerTest.php | Adds unit coverage for new MySQL container API usage and cleanup delegation. |
| tests/Unit/Mocks/TestableFlywayDockerContainer.php | Test-only subclass to build Flyway containers with an injected mock client. |
| tests/Unit/Mocks/ClientMock.php | Extends the client mock to touch timeout-aware commands during execution. |
| tests/Unit/Internal/Commands/DockerCommandsTest.php | Adds unit tests asserting command-line generation for new/internal Docker commands. |
| tests/Unit/GenericDockerContainerTest.php | Updates network-create expectations and adds tests for remove/shutdown behaviors. |
| tests/Unit/FlywayDockerContainerTest.php | Adds comprehensive unit tests for Flyway container configuration and commands. |
| tests/Integration/DockerContainerTest.php | Migrates integration coverage to the new Flyway container API and shutdown cleanup. |
| src/MySQLDockerContainer.php | Refactors constructor to property promotion and preserves setup command behavior. |
| src/Internal/Containers/Started.php | Implements remove() and stopOnShutdown() for started containers. |
| src/Internal/Containers/Models/ContainerId.php | Reorders constants (no functional change). |
| src/Internal/Containers/Drivers/MySQL/MySQLStarted.php | Exposes remove() / stopOnShutdown() via the MySQL started wrapper. |
| src/Internal/Containers/Drivers/MySQL/MySQLCommands.php | Reorders constants (no functional change). |
| src/Internal/Commands/DockerRun.php | Adds a managed label and injects it into docker run invocations. |
| src/Internal/Commands/DockerRemove.php | Adds a docker rm --force --volumes command abstraction. |
| src/Internal/Commands/DockerNetworkPrune.php | Adds a labeled docker network prune command abstraction. |
| src/Internal/Commands/DockerNetworkCreate.php | Ensures auto-created networks are labeled for safe cleanup. |
| src/GenericDockerContainer.php | Refactors constructor to property promotion. |
| src/FlywayDockerContainer.php | New implementation providing Flyway-focused API over GenericDockerContainer. |
| src/FlywayContainer.php | New public contract defining the Flyway container API. |
| src/Contracts/ContainerStarted.php | Extends the public started-container contract with remove/shutdown cleanup methods. |
| README.md | Documents Flyway container usage, shutdown cleanup, and parallel image pulls; updates examples/wording. |
| Makefile | Labels the test network and removes unnecessary volume setup. |
| .claude/rules/code-style.md | Updates/clarifies code-style guidance around empty-string checks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.