Skip to content

Refactor Docker container commands and add image pull functionality.#17

Merged
gustavofreze merged 1 commit intomainfrom
feature/develop
Apr 13, 2026
Merged

Refactor Docker container commands and add image pull functionality.#17
gustavofreze merged 1 commit intomainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 13, 2026 16:54
Copy link
Copy Markdown

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 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 before run()/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.

@gustavofreze gustavofreze merged commit 0c0f2e4 into main Apr 13, 2026
10 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch April 13, 2026 17:37
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