Skip to content

Migrate executor to console 0.2 commands#228

Open
TorstenDittmann wants to merge 11 commits into
mainfrom
feat/console-0-2-structured-commands
Open

Migrate executor to console 0.2 commands#228
TorstenDittmann wants to merge 11 commits into
mainfrom
feat/console-0-2-structured-commands

Conversation

@TorstenDittmann
Copy link
Copy Markdown
Contributor

Summary

  • update utopia-php/console to 0.2.* and point utopia-php/orchestration at utopia-php/orchestration#66 until the compatible release is available
  • migrate direct Console::execute() usage to structured Utopia\Command objects and pass the new stderr argument required by console 0.2
  • replace repeated e2e archive setup shell strings with structured command helpers to match the new command API

Validation

  • composer analyze
  • composer test:unit (fails locally: missing ext-swoole / Swoole\Table in this environment)

@TorstenDittmann TorstenDittmann marked this pull request as ready for review May 25, 2026 20:55
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR migrates Console::execute() calls from raw shell strings to structured Utopia\Command objects (utopia-php/console 0.2), and bumps utopia-php/orchestration to 0.20 which requires the new console version. The argument-safety concern is addressed: single Command instances are passed to proc_open as an argv array (no shell expansion), and composed commands via Command::and() use escapeshellarg() internally when serialised to a string.

  • Docker.php: two Console::execute() calls (docker container inspect and tail -F) are rewritten as structured Command objects with no change to observable runtime behaviour.
  • ExecutorTest.php: repeated inline tar/zip shell strings are consolidated into createTarArchive / createZipArchive helpers that use copy() + unlink() instead of rename(), avoiding cross-device failures previously flagged in review.
  • composer.json / composer.lock: utopia-php/console bumped to 0.2.1, utopia-php/orchestration to 0.20.0, along with routine transitive dev-dependency updates.

Confidence Score: 5/5

Safe to merge; the Command API migration is correct and the archive helpers are a clean consolidation of previously scattered inline shell strings.

The two changed source paths (Docker.php and ExecutorTest.php) are straightforward mechanical refactors. Argument safety in the new Command API is verified: single-Command calls go through proc_open argv array (no shell interpretation), and composed commands use escapeshellarg() internally. The only findings are minor temp-file cleanup gaps in test helpers that don't affect production code.

No files require special attention.

Important Files Changed

Filename Overview
src/Executor/Runner/Docker.php Replaces raw shell-string Console::execute() calls with structured Command objects; argument safety is preserved (single-Command calls use proc_open argv array, no shell expansion needed).
tests/e2e/ExecutorTest.php Extracts repeated archive-creation shell strings into createTarArchive/createZipArchive helpers using Command::and(); copies to destination instead of rename() (cross-device safe). Minor: temp files are not cleaned up if an assertion throws before unlink() in either helper.
composer.json Bumps utopia-php/console to 0.2.* and utopia-php/orchestration to 0.20.* to pick up the new Command API.
composer.lock Lock file regenerated for the new dependency versions; no unexpected additions.
.gitignore Adds .DS_Store to prevent macOS metadata files from being committed.

Reviews (4): Last reviewed commit: "Fix zip archive temp path in e2e tests" | Re-trigger Greptile

Comment thread tests/e2e/ExecutorTest.php
Comment thread tests/e2e/ExecutorTest.php
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.

1 participant