Skip to content

Fix Console::execute signature usage#65

Merged
ChiragAgg5k merged 1 commit intomainfrom
fix/console-execute-signature
Feb 10, 2026
Merged

Fix Console::execute signature usage#65
ChiragAgg5k merged 1 commit intomainfrom
fix/console-execute-signature

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Feb 10, 2026

Summary

  • update Console::execute calls to new signature with stderr param
  • prefer stderr in error handling when present
  • keep existing timeout handling

Testing

  • not run (not requested)

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error reporting for Docker operations to provide more detailed and accurate error messages when commands fail.
  • Chores

    • Updated PHP package dependencies.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Walkthrough

This pull request updates the PHP package dependency constraint for utopia-php/console from version 0.0.* to 0.1.* in composer.json, and refactors error handling in DockerCLI.php to capture and utilize STDERR output across Docker operations. The DockerCLI changes introduce per-call STDERR capture by adding a $stderr variable passed to Console::execute calls, then modifying error reporting to prefer STDERR when available, with fallback to standard output. This pattern is applied consistently across multiple Docker operations including login, network management, pull, process listing, execution, and removal commands.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Fix Console::execute signature usage' directly reflects the main change: updating Console::execute calls to use a new signature with stderr parameter for improved error handling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/console-execute-signature

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/Orchestration/Adapter/DockerCLI.php`:
- Line 41: The docker network create invocation concatenates the name and flag
without a space causing e.g. "mynetwork--internal"; in the Console::execute call
in DockerCLI.php (the line using Console::execute('docker network create
'.$name.($internal ? '--internal' : ''), ...)), ensure a space precedes the flag
when $internal is true by adjusting the string concatenation so the flag is
joined as ' --internal' (or conditionally append " --internal") using the $name
and $internal variables; update only the argument to Console::execute to include
the space when appropriate.
- Line 26: The Console::execute calls in DockerCLI.php use the old signature and
incorrectly pass a $stderr variable as the 4th argument; update every
Console::execute invocation (including the one using $password, $output, $stderr
and the other ~12 calls) to the v0.1.1 signature by removing the $stderr
argument, pass an integer timeout (e.g. 60) as the 4th parameter, and treat
$output as the single combined stdout+stderr buffer (remove any logic that reads
$stderr separately or create combined output handling). Locate calls by
searching for Console::execute and adjust argument order for functions like the
docker login call and all other Console::execute usages in this file.
🧹 Nitpick comments (1)
src/Orchestration/Adapter/DockerCLI.php (1)

458-472: remove logic is sound but consider a separator for debugging clarity.

The $combinedOutput = $output.$stderr concatenation (line 465) works correctly because on success Docker prints the container name to stdout first. However, if this string ever appears in a thrown exception message (line 468), the lack of a separator between stdout and stderr content could make the error message harder to read.

♻️ Optional: add a separator for readability
-        $combinedOutput = $output.$stderr;
+        $combinedOutput = $output.(! empty($stderr) ? "\n".$stderr : '');

@ChiragAgg5k ChiragAgg5k merged commit 5a1168d into main Feb 10, 2026
7 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/console-execute-signature branch February 10, 2026 12:44
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