From dd51fb8fdc6b823a88554af622be86c0044e603e Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Sat, 14 Nov 2026 15:20:11 +0100 Subject: [PATCH 1/2] Show when a deployment waits for another one, without counting the wait Bref Cloud now runs the deployments of an environment one at a time: the spinner shows the status message from Bref Cloud (e.g. "waiting"), and the 15-minute timeout only starts once the deployment no longer waits. --- src/Commands/Deploy.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Commands/Deploy.php b/src/Commands/Deploy.php index 4bac4be..7091354 100644 --- a/src/Commands/Deploy.php +++ b/src/Commands/Deploy.php @@ -141,13 +141,27 @@ protected function execute(InputInterface $input, OutputInterface $output): int } } - $startTime = time(); + // A deployment can wait for another one of the same environment before it starts: + // the timeout only counts from the moment it no longer waits + $timeout = 15 * 60; + $deadline = time() + $timeout; $deployLogs = []; + $spinnerMessage = null; - // Timeout after 15 minutes - while (time() - $startTime < 15 * 60) { + while (time() < $deadline) { $deployment = $brefCloud->getDeployment($deploymentId); + if ($deployment['status'] === 'deploying') { + if ($deployment['message'] === 'waiting') { + $deadline = time() + $timeout; + } + // E.g. "waiting" while another deployment of the environment runs + if ($deployment['message'] !== $spinnerMessage) { + $spinnerMessage = $deployment['message']; + IO::spin($spinnerMessage); + } + } + // Logs if (! $isServerlessFrameworkDeploy) { // Diff between all the deployment logs and the ones we already know about From 14cb4a20ef10a9a7f93b3d92cbead4b69a279eeb Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Sat, 14 Nov 2026 15:59:10 +0100 Subject: [PATCH 2/2] End when Bref Cloud cancels a deployment that a newer one superseded Without it, the CLI waited for 15 minutes and then reported a timeout. --- src/Commands/Deploy.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Commands/Deploy.php b/src/Commands/Deploy.php index 7091354..338935a 100644 --- a/src/Commands/Deploy.php +++ b/src/Commands/Deploy.php @@ -174,6 +174,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int IO::spinSuccess($deployment['message'], $deployment['app_url'] ?? null); return 0; } + // Superseded by a newer deployment of the environment, which is not an error + if ($deployment['status'] === 'canceled') { + IO::spinSuccess($deployment['message']); + IO::writeln([ + Styles::gray($deployment['error_message'] ?? 'The deployment was canceled'), + '', + Styles::gray('Deployment logs: ' . $deployment['url']), + ]); + return 0; + } if ($deployment['status'] === 'failed') { IO::spinError($deployment['message']); IO::writeln([