symfony/console exception "Incorrectly nested style tag found."
Expected Behavior
If a Surf command produces output, it should be shown on the console.
Sidenote: The conditions for Surf to show output are as far as I know:
Either of
- command exits unsuccessful
- command outputs something to
stderr surfis run with-v
Actual Behavior
If the output contains style tags or parts of it symfony/console tries to interpret them and might throw a \Symfony\Component\Console\Exception\InvalidArgumentException('Incorrectly nested style tag found.').
That exception triggers a depoyment rollback.
Steps to Reproduce the Problem
The actual use case was displaying some HTML in a smoke test.
This simple task reproduces what happened:
$deployment->getWorkflow()
->defineTask(
'TestSymfonyTask',
LocalShellTask::class,
[
'command' => [
'echo "123</info>"',
],
]
)
Specifications
- Surf Version: 2.3.2
- Application:
- PHP Version: 7.4
- Platform: Linux
- Environment (CI): ddev
- Deployment configuration:
What is the expected behavior? <info> is a console style command.
It should output the command output unchanged since there might just be these style tags in between some output but you don't want them to be interpreted in any way.
It has the potential to break if it gets fed arbitrary output.
I will take care of it in the next couple of weeks because i have some deadlines coming up which are more important for me right now - or you fix it yourself ;)
I am going to close this issue due to inactivity. Just by reading i would guess this has nothing to do with Surf but with Symfony Console.
It's not a biggy but IMHO the output of commands should be escaped if the output interpretes these tags.