Skip to content

Refactor DockerCLI for console 0.2 commands#66

Open
TorstenDittmann wants to merge 3 commits intomainfrom
chore/console-0-2-structured-commands
Open

Refactor DockerCLI for console 0.2 commands#66
TorstenDittmann wants to merge 3 commits intomainfrom
chore/console-0-2-structured-commands

Conversation

@TorstenDittmann
Copy link
Copy Markdown
Contributor

Summary

  • update utopia-php/console to 0.2.* and refresh the lockfile
  • migrate DockerCLI from shell-string execution to structured Utopia\Command usage
  • keep compatibility with legacy pre-quoted command arguments while removing manual shell escaping

Validation

  • ./vendor/bin/pint --test
  • ./vendor/bin/phpstan analyse --level 6 src tests
  • ./vendor/bin/phpunit --configuration phpunit.xml tests/Orchestration/Adapter/DockerCLITest.php (fails locally because the test setup expects /usr/src/code/tests/Orchestration/Resources, which is not present in this workspace; opening the PR to run CI in the intended environment)

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 20, 2026

Greptile Summary

This PR migrates DockerCLI from manual shell-string construction to the structured Utopia\Command API introduced in utopia-php/console 0.2, and updates the lockfile accordingly. All Docker subcommands (run, exec, rm, pull, network, stats) are converted, legacy shell-escaping and the single-quote stripping from label values are removed, and two test-layer fixes (screen args as separate tokens, new label round-trip test) close the previously raised issues.

Confidence Score: 5/5

Safe to merge — all prior review concerns are addressed and no new issues were found

Every changed method uses the structured Command API correctly, the three previously raised bugs (normalizeCommandArgument, label single-quote strip, screen argv) have been fixed, the new O'Brien label regression test is well-formed, and a subtle old bug (escapeshellarg treating '0' as empty) is incidentally corrected. No P0/P1 findings remain.

No files require special attention

Important Files Changed

Filename Overview
src/Orchestration/Adapter/DockerCLI.php Core refactor from shell-string execution to structured Command objects; all methods migrated cleanly, no new logic issues introduced
tests/Orchestration/Base.php Adds regression test for single-quoted label values and fixes screen command to pass separate argv tokens — both changes are correct
composer.json Bumps utopia-php/console constraint from 0.1.* to 0.2.* to pick up the Command class
composer.lock Lockfile updated to utopia-php/console 0.2.1 and adds its new transitive dependency utopia-php/validators 0.2.0

Reviews (3): Last reviewed commit: "Fix structured command regressions" | Re-trigger Greptile

Comment thread src/Orchestration/Adapter/DockerCLI.php Outdated
Comment thread src/Orchestration/Adapter/DockerCLI.php
@TorstenDittmann
Copy link
Copy Markdown
Contributor Author

@greptile-apps please review the latest commit on this PR.

Comment thread tests/Orchestration/Base.php Outdated
@TorstenDittmann
Copy link
Copy Markdown
Contributor Author

@greptile-apps please review the latest commit on this PR (49a86d9). The screen argv regression is fixed, label quote stripping is removed, and a regression test was added for labels containing single quotes.

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