From 55fe38c472548f22aa44368e77079961a5691633 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Mon, 28 Sep 2026 16:17:24 +0200 Subject: [PATCH] Show the error of a deployment on its own lines in `bref deployments:logs` The error was appended to the summary line, in parentheses. A deployment's error can now span several lines (the whole osls error, then a hint for known errors), which made that line hard to read. The summary stays on one line, and the error follows on its own lines, as `bref deploy` shows it. Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK --- src/Commands/DeploymentsLogs.php | 7 ++++--- tests/Commands/DeploymentsLogsTest.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Commands/DeploymentsLogs.php b/src/Commands/DeploymentsLogs.php index 3d8d1eb..40399c1 100644 --- a/src/Commands/DeploymentsLogs.php +++ b/src/Commands/DeploymentsLogs.php @@ -52,11 +52,12 @@ protected function show(InputInterface $input, OutputInterface $output): int foreach ($logs as $log) { $output->writeln($log['line'], OutputInterface::OUTPUT_RAW); } - $summary = "Deployment #$id: {$deployment['message']}"; + $stderr = $this->stderr($output); + $stderr->writeln("Deployment #$id: {$deployment['message']}", OutputInterface::OUTPUT_RAW); + // On its own lines, as `bref deploy` shows it: it can span several lines, and ends with a hint for known errors if ($deployment['error_message']) { - $summary .= " ({$deployment['error_message']})"; + $stderr->writeln(['', $deployment['error_message']], OutputInterface::OUTPUT_RAW); } - $this->stderr($output)->writeln($summary, OutputInterface::OUTPUT_RAW); return 0; } diff --git a/tests/Commands/DeploymentsLogsTest.php b/tests/Commands/DeploymentsLogsTest.php index 738789e..b9d9e3f 100644 --- a/tests/Commands/DeploymentsLogsTest.php +++ b/tests/Commands/DeploymentsLogsTest.php @@ -51,6 +51,6 @@ public function test_agents_get_the_logs_as_text_without_colors(): void $this->assertSame(0, $tester->getStatusCode(), $tester->getDisplay()); $this->assertSame("✔ Packaged\nUPDATE_FAILED AWS::Lambda::Function\n", $tester->getDisplay()); - $this->assertSame("Deployment #25: failed (The CloudFormation stack failed to update)\n", $tester->getErrorOutput()); + $this->assertSame("Deployment #25: failed\n\nThe CloudFormation stack failed to update\n", $tester->getErrorOutput()); } }