Skip to content

Fix #164: Stream command output#350

Merged
samdark merged 2 commits into
masterfrom
issue-164-stream-process-output
Jun 2, 2026
Merged

Fix #164: Stream command output#350
samdark merged 2 commits into
masterfrom
issue-164-stream-process-output

Conversation

@samdark
Copy link
Copy Markdown
Member

@samdark samdark commented May 30, 2026

Summary

  • add a shared ProcessOutput helper for streaming Symfony Process output through the existing console output manager
  • stream long-running package commands instead of printing buffered output after completion
  • add a regression test proving process output is received before the child process finishes

Tests

  • vendor/bin/phpunit
  • vendor/bin/phpcs src/App/Component/Console/ProcessOutput.php tests/App/Component/Console/ProcessOutputTest.php src/App/Component/Git/GitWorkingCopy.php src/App/Command/ExecCommand.php src/App/Command/Git/CheckoutCommand.php src/App/Command/Git/PushCommand.php src/App/Command/Git/CommitCommand.php src/App/Command/Git/PullCommand.php src/App/Command/Git/RequestPullCommand.php src/App/Command/LintCommand.php src/App/Command/TestCommand.php src/App/Command/UpdateCommand.php src/App/PackageService.php --standard=PSR12

Fixes #164

Copilot AI review requested due to automatic review settings May 30, 2026 11:33
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 addresses issue #164 by introducing a shared helper to stream Symfony\Component\Process\Process output through the existing OutputManager, so long-running commands emit output incrementally instead of only after completion.

Changes:

  • Added ProcessOutput helper to standardize real-time streaming of process output via OutputManager.
  • Updated multiple commands/services to use streaming (git, composer, phpunit, phpcs, etc.) rather than printing buffered output after the process finishes.
  • Added a regression test to ensure output is observable before the child process completes.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/App/Component/Console/ProcessOutputTest.php Adds a regression test proving streamed output arrives before process completion.
src/App/Component/Console/ProcessOutput.php Introduces a shared callback/runner for streaming Process output into OutputManager.
src/App/PackageService.php Switches git clone and composer install/update to streamed output.
src/App/Component/Git/GitWorkingCopy.php Adds callback-capable execution (runWithOutput) to allow streaming git command output.
src/App/Command/ExecCommand.php Replaces inline streaming callback with the shared ProcessOutput helper.
src/App/Command/UpdateCommand.php Streams git pull output in real time.
src/App/Command/TestCommand.php Streams composer test / phpunit output in real time.
src/App/Command/LintCommand.php Streams phpcs output in real time.
src/App/Command/Git/PullCommand.php Streams git pull output in real time.
src/App/Command/Git/PushCommand.php Streams git push output via GitWorkingCopy::runWithOutput.
src/App/Command/Git/CheckoutCommand.php Streams git checkout output via GitWorkingCopy::runWithOutput.
src/App/Command/Git/CommitCommand.php Streams git commit output in real time.
src/App/Command/Git/RequestPullCommand.php Streams PR-creation process output in real time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

->run();
$process->setTimeout(null);

ProcessOutput::run($process, $io);
Comment on lines +19 to +20
$sentinel = tempnam(sys_get_temp_dir(), 'yii-dev-tool-process-output-');
unlink($sentinel);
->run();
$process->setTimeout(null);

ProcessOutput::run($process, $io);
Comment on lines +19 to +20
$sentinel = tempnam(sys_get_temp_dir(), 'yii-dev-tool-process-output-');
unlink($sentinel);
->run();
$process->setTimeout(null);

ProcessOutput::run($process, $io);
Comment on lines +19 to +20
$sentinel = tempnam(sys_get_temp_dir(), 'yii-dev-tool-process-output-');
unlink($sentinel);
@samdark samdark merged commit cc28f2f into master Jun 2, 2026
6 checks passed
@samdark samdark deleted the issue-164-stream-process-output branch June 2, 2026 20:07
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.

Output all commands immediately without waiting for completion

2 participants