Fix #164: Stream command output#350
Merged
Merged
Conversation
There was a problem hiding this comment.
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
ProcessOutputhelper to standardize real-time streaming of process output viaOutputManager. - 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests
Fixes #164