From d932ac5d5935999863e5e9ff4566a15064323643 Mon Sep 17 00:00:00 2001 From: rosslh Date: Thu, 8 Oct 2026 12:18:10 +0200 Subject: [PATCH 1/2] fix(ui): center card titles when the description is empty Only render the card description when it has text, and center the title against the icon. Removing the description placeholders left an empty description element in items-start rows, so titles without a description were pinned to the top of the icon. Closes #12102 --- resources/views/livewire/dashboard.blade.php | 20 +++++++++++-------- .../views/livewire/project/index.blade.php | 5 +++-- .../views/livewire/server/index.blade.php | 10 ++++++---- .../server/private-key/show.blade.php | 10 ++++++---- .../environment/index.blade.php | 2 +- .../shared-variables/project/index.blade.php | 6 ++++-- 6 files changed, 32 insertions(+), 21 deletions(-) diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php index 472b3e9961..5de545df33 100644 --- a/resources/views/livewire/dashboard.blade.php +++ b/resources/views/livewire/dashboard.blade.php @@ -83,14 +83,16 @@ @endif -
+

{{ $project->name }}

-

- {{ $project->description }} -

+ @if (filled($project->description)) +

+ {{ $project->description }} +

+ @endif
@@ -204,14 +206,16 @@ class="flex size-8 shrink-0 items-center justify-center rounded-lg border border-neutral-200 bg-neutral-50 text-neutral-500 dark:border-white/[0.1] dark:bg-white/[0.04] dark:text-fg-dim"> -
+

{{ $server->name }}

-

- {{ $server->description }} -

+ @if (filled($server->description)) +

+ {{ $server->description }} +

+ @endif
@if ($serverStatusType !== 'success')
-
+

+ x-show="project.description?.trim()" + x-text="project.description">

diff --git a/resources/views/livewire/server/index.blade.php b/resources/views/livewire/server/index.blade.php index 5258673700..30eca6ac13 100644 --- a/resources/views/livewire/server/index.blade.php +++ b/resources/views/livewire/server/index.blade.php @@ -147,13 +147,15 @@ class="flex size-8 shrink-0 items-center justify-center rounded-lg border border-neutral-200 bg-neutral-50 text-neutral-500 dark:border-white/[0.1] dark:bg-white/[0.04] dark:text-fg-dim"> -
+

{{ $serverRow['name'] }}

-

- {{ $serverRow['description'] }} -

+ @if (filled($serverRow['description'])) +

+ {{ $serverRow['description'] }} +

+ @endif
@if ($serverRow['statusType'] !== 'success')
-
+

{{ $privateKey->name }} @@ -77,9 +77,11 @@ @endif

-

- {{ $privateKey->description }} -

+ @if (filled($privateKey->description)) +

+ {{ $privateKey->description }} +

+ @endif
diff --git a/resources/views/livewire/shared-variables/environment/index.blade.php b/resources/views/livewire/shared-variables/environment/index.blade.php index 645f2e61be..ed8e38407a 100644 --- a/resources/views/livewire/shared-variables/environment/index.blade.php +++ b/resources/views/livewire/shared-variables/environment/index.blade.php @@ -33,7 +33,7 @@ href="{{ route('shared-variables.environment.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid]) }}" {{ wireNavigate() }}>
-

{{ $environment->name }}

{{ $environment->description }}

+

{{ $environment->name }}

@if (filled($environment->description))

{{ $environment->description }}

@endif
@endforeach diff --git a/resources/views/livewire/shared-variables/project/index.blade.php b/resources/views/livewire/shared-variables/project/index.blade.php index d19fc39f5e..e1ac890a52 100644 --- a/resources/views/livewire/shared-variables/project/index.blade.php +++ b/resources/views/livewire/shared-variables/project/index.blade.php @@ -31,9 +31,11 @@ @endif
-
+

{{ $project->name }}

-

{{ $project->description }}

+ @if (filled($project->description)) +

{{ $project->description }}

+ @endif
From be7369c9cc0a9a704420e3ce9190fd0d60b5bfb2 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 8 Oct 2026 12:19:01 +0200 Subject: [PATCH 2/2] fix(deployment): keep the commit message when a deployment does not clone The commit message was read only during the repository clone. Deployments that skipped the build or failed before the clone showed only the commit hash. They now reuse the message stored by an earlier deployment of the same application and commit. Closes #12116 --- app/Jobs/ApplicationDeploymentJob.php | 24 ++++++ .../DeploymentCommitMessageReuseTest.php | 84 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 tests/Feature/DeploymentCommitMessageReuseTest.php diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index b93a94a95c..4077d311c9 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -3044,6 +3044,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue } } } + $this->reuse_commit_message(); $this->set_coolify_variables(); // Restart helper container with actual SOURCE_COMMIT value @@ -3053,6 +3054,29 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue } } + /** + * The commit message is read from the cloned repository. Deployments that skip the build or fail + * before the clone reuse the message stored by an earlier deployment of the same commit. + */ + private function reuse_commit_message(): void + { + if (filled($this->application_deployment_queue->commit_message) || $this->shouldResolveBranchHeadCommit()) { + return; + } + + $commitMessage = ApplicationDeploymentQueue::query() + ->where('application_id', $this->application->id) + ->where('commit', $this->commit) + ->whereNotNull('commit_message') + ->where('commit_message', '!=', '') + ->latest('id') + ->value('commit_message'); + + if (filled($commitMessage)) { + $this->application_deployment_queue->update(['commit_message' => $commitMessage]); + } + } + private function shouldResolveBranchHeadCommit(): bool { $commit = trim($this->commit); diff --git a/tests/Feature/DeploymentCommitMessageReuseTest.php b/tests/Feature/DeploymentCommitMessageReuseTest.php new file mode 100644 index 0000000000..52a05e71ad --- /dev/null +++ b/tests/Feature/DeploymentCommitMessageReuseTest.php @@ -0,0 +1,84 @@ +create(); + $this->server = Server::factory()->create(['team_id' => $team->id]); + $destination = StandaloneDocker::where('server_id', $this->server->id)->firstOrFail(); + $project = Project::factory()->create(['team_id' => $team->id]); + $environment = $project->environments()->first() ?? Environment::factory()->create(['project_id' => $project->id]); + + $this->application = Application::factory()->create([ + 'environment_id' => $environment->id, + 'destination_id' => $destination->id, + 'destination_type' => $destination->getMorphClass(), + ]); +}); + +function createCommitMessageDeployment(Application $application, Server $server, string $commit, ?string $commitMessage = null): ApplicationDeploymentQueue +{ + return ApplicationDeploymentQueue::create([ + 'application_id' => $application->id, + 'deployment_uuid' => new_public_id(), + 'server_id' => $server->id, + 'commit' => $commit, + 'commit_message' => $commitMessage, + ]); +} + +function reuseCommitMessage(ApplicationDeploymentQueue $deployment, Application $application, string $commit): void +{ + $reflection = new ReflectionClass(ApplicationDeploymentJob::class); + $job = $reflection->newInstanceWithoutConstructor(); + $reflection->getProperty('application')->setValue($job, $application); + $reflection->getProperty('application_deployment_queue')->setValue($job, $deployment); + $reflection->getProperty('commit')->setValue($job, $commit); + + $reflection->getMethod('reuse_commit_message')->invoke($job); +} + +test('copies the commit message from an earlier deployment of the same commit', function () { + $commit = str_repeat('a', 40); + createCommitMessageDeployment($this->application, $this->server, $commit, 'feat: add portfolio work page'); + $deployment = createCommitMessageDeployment($this->application, $this->server, $commit); + + reuseCommitMessage($deployment, $this->application, $commit); + + expect($deployment->fresh()->commit_message)->toBe('feat: add portfolio work page'); +}); + +test('does not copy a commit message from another commit or application', function () { + $commit = str_repeat('a', 40); + createCommitMessageDeployment($this->application, $this->server, str_repeat('b', 40), 'other commit'); + $otherApplication = Application::factory()->create([ + 'environment_id' => $this->application->environment_id, + 'destination_id' => $this->application->destination_id, + 'destination_type' => $this->application->destination_type, + ]); + createCommitMessageDeployment($otherApplication, $this->server, $commit, 'other application'); + $deployment = createCommitMessageDeployment($this->application, $this->server, $commit); + + reuseCommitMessage($deployment, $this->application, $commit); + + expect($deployment->fresh()->commit_message)->toBeNull(); +}); + +test('does not look up a commit message for an unresolved HEAD commit', function () { + createCommitMessageDeployment($this->application, $this->server, 'HEAD', 'stale message'); + $deployment = createCommitMessageDeployment($this->application, $this->server, 'HEAD'); + + reuseCommitMessage($deployment, $this->application, 'HEAD'); + + expect($deployment->fresh()->commit_message)->toBeNull(); +});