From b106a82308c8208067b098d415afc23af302934f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 16 May 2024 11:23:26 +0200 Subject: [PATCH 1/4] chore: Update version numbers to 4.0.0-beta.279 --- config/sentry.php | 2 +- config/version.php | 2 +- versions.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index 4ab6d5b12..99658ff75 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.278', + 'release' => '4.0.0-beta.279', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index 980c395f0..373aa74bb 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ Date: Thu, 16 May 2024 11:23:31 +0200 Subject: [PATCH 2/4] Refactor scheduling of container status and log drain checks --- app/Console/Kernel.php | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 99ca75352..51e4cfc17 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -18,7 +18,6 @@ use App\Models\Server; use App\Models\Team; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; -use Illuminate\Support\Sleep; class Kernel extends ConsoleKernel { @@ -77,28 +76,13 @@ class Kernel extends ConsoleKernel $containerServers = $servers->where('settings.is_swarm_worker', false)->where('settings.is_build_server', false); } foreach ($containerServers as $server) { - $schedule->job(new ContainerStatusJob($server))->everyTwoMinutes()->onOneServer()->before(function () { - if (isCloud()) { - $wait = rand(5, 20); - Sleep::for($wait)->seconds(); - } - }); + $schedule->job(new ContainerStatusJob($server))->everyMinute()->onOneServer(); if ($server->isLogDrainEnabled()) { - $schedule->job(new CheckLogDrainContainerJob($server))->everyTwoMinutes()->onOneServer()->before(function () { - if (isCloud()) { - $wait = rand(5, 20); - Sleep::for($wait)->seconds(); - } - }); + $schedule->job(new CheckLogDrainContainerJob($server))->everyMinute()->onOneServer(); } } foreach ($servers as $server) { - $schedule->job(new ServerStatusJob($server))->everyTwoMinutes()->onOneServer()->before(function () { - if (isCloud()) { - $wait = rand(5, 20); - Sleep::for($wait)->seconds(); - } - }); + $schedule->job(new ServerStatusJob($server))->everyMinute()->onOneServer(); } } private function instance_auto_update($schedule) From fbf64f80375da24fd920ed1e36117ffa97ff3c7e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 16 May 2024 11:25:58 +0200 Subject: [PATCH 3/4] Refactor ApplicationDeploymentJob to conditionally notify team on DeploymentSuccess --- app/Jobs/ApplicationDeploymentJob.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 4c0da8d4d..07a9f6fa8 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1965,7 +1965,10 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); if (!$this->only_this_server) { $this->deploy_to_additional_destinations(); } - $this->application->environment->project->team?->notify(new DeploymentSuccess($this->application, $this->deployment_uuid, $this->preview)); + if (!isCloud()) { + // TODO: turn off until we have a better solution + $this->application->environment->project->team?->notify(new DeploymentSuccess($this->application, $this->deployment_uuid, $this->preview)); + } } } From 684745902241eaa49180d97636ed0db4293b8f5b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 16 May 2024 13:33:35 +0200 Subject: [PATCH 4/4] chore: Limit commit message length to 50 characters in ApplicationDeploymentJob --- app/Jobs/ApplicationDeploymentJob.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 07a9f6fa8..e542a67b4 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1179,8 +1179,11 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted ] ); if ($this->saved_outputs->get('commit_message')) { - $this->application_deployment_queue->commit_message = $this->saved_outputs->get('commit_message'); - ApplicationDeploymentQueue::whereCommit($this->commit)->whereApplicationId($this->application->id)->update(['commit_message' => $this->saved_outputs->get('commit_message')]); + $commit_message = str($this->saved_outputs->get('commit_message'))->limit(50); + $this->application_deployment_queue->commit_message = $commit_message->value(); + ApplicationDeploymentQueue::whereCommit($this->commit)->whereApplicationId($this->application->id)->update( + ['commit_message' => $commit_message->value()] + ); $this->application_deployment_queue->save(); } }