Refactor Docker container commands and add image pull functionality.#17
Merged
gustavofreze merged 1 commit intomainfrom Apr 13, 2026
Merged
Refactor Docker container commands and add image pull functionality.#17gustavofreze merged 1 commit intomainfrom
gustavofreze merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the internal Docker command/inspection flow, adds optional background image pulling before container start, and updates unit/integration tests + documentation to match the new APIs and naming.
Changes:
- Add
pullImage()to containers (and document it) to start image pulls beforerun()/runIfNotExists(). - Refactor container inspection/lookup into dedicated internal collaborators (
ContainerLookup,ContainerInspection) and add automatic network creation. - Update mocks/fixtures/tests to new parameter naming and to cover the new behaviors.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Waits/ContainerWaitForTimeTest.php | Update microtime()/assertion style to new conventions. |
| tests/Unit/Waits/ContainerWaitForDependencyTest.php | Update microtime()/assertion style to new conventions. |
| tests/Unit/MySQLDockerContainerTest.php | Update fixtures/mocks usage; add tests for env var + image pull; adjust MySQL setup expectations. |
| tests/Unit/Mocks/InspectResponseFixture.php | Rename env to environment; move container id helpers; adjust fixture builder signature. |
| tests/Unit/Mocks/ClientMock.php | Rename parameters for clarity; refactor execute routing. |
| tests/Unit/Internal/Client/DockerClientTest.php | Rename locals and modernize assertions. |
| tests/Unit/GenericDockerContainerTest.php | Update mocks/fixtures; validate network-create behavior; add pull-image test. |
| tests/Integration/DockerContainerTest.php | Rename locals and modernize assertions. |
| src/Waits/ContainerWaitForDependency.php | Replace named-arg microtime() usage with positional calls. |
| src/MySQLDockerContainer.php | Add pullImage() and refactor DB setup into single command; reorder run/runIfNotExists. |
| src/Internal/Containers/Started.php | Reorder constructor-promoted properties. |
| src/Internal/Containers/Drivers/MySQL/MySQLStarted.php | Update http_build_query call style. |
| src/Internal/Containers/Drivers/MySQL/MySQLCommands.php | Consolidate DB setup (create DB + grants) into a single command string. |
| src/Internal/Containers/ContainerLookup.php | New: centralize inspect-by-id + Started creation. |
| src/Internal/Containers/ContainerInspection.php | Rename/relocate inspect parsing into ContainerInspection with to*() methods. |
| src/Internal/Commands/DockerRun.php | Minor refactor: constructor arg order, null-check style, variable naming. |
| src/Internal/Commands/DockerPull.php | New: docker pull command object. |
| src/Internal/Commands/DockerNetworkCreate.php | New: `docker network create ... |
| src/Internal/Commands/DockerCopy.php | Change factory/constructor argument order. |
| src/Internal/CommandHandler/ContainerCommandHandler.php | Refactor: delegate lookup/inspection; create network before run; simplify execute(). |
| src/Internal/Client/DockerClient.php | Use named args for Symfony Process methods. |
| src/GenericDockerContainer.php | Add background image pull orchestration and reorder methods. |
| src/DockerContainer.php | Add pullImage() to public interface; clarify network behavior docs. |
| README.md | Rework TOC and usage docs; document pulling images, stopping, executing, wait strategies, and MySQL section. |
| .github/workflows/ci.yml | Make tests depend on build job rather than auto-review. |
| .github/copilot-instructions.md | New: repository Copilot guidance pointing to .claude rules. |
| .claude/rules/testing.md | New: PHPUnit/BDD and coverage/mutation rules. |
| .claude/rules/domain.md | New: domain modeling and public/internal boundary rules. |
| .claude/rules/documentation.md | New: README/documentation standards. |
| .claude/rules/code-style.md | New: semantic PHP style rules (naming, null checks, args, etc.). |
| .claude/CLAUDE.md | New: project meta + commands and rule references. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.