From 8a107b3c4bcd37ea3aa21eec2de2db8e2efa086f Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 14 Jul 2025 15:47:16 +0200 Subject: [PATCH] fix(previews): refine preview domain generation for Docker Compose applications, ensuring correct method usage based on build pack type --- app/Jobs/ApplicationDeploymentJob.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index bc5fab30c..708d2f15d 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -229,7 +229,16 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue // Set preview fqdn if ($this->pull_request_id !== 0) { - $this->preview = $this->application->generate_preview_fqdn($this->pull_request_id); + if ($this->application->build_pack === 'dockercompose') { + // For Docker Compose apps, use the preview model's compose-specific method + $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id); + if ($this->preview) { + $this->preview->generate_preview_fqdn_compose(); + } + } else { + // For non-Docker Compose apps, use the application model's method + $this->preview = $this->application->generate_preview_fqdn($this->pull_request_id); + } if ($this->application->is_github_based()) { ApplicationPullRequestUpdateJob::dispatch(application: $this->application, preview: $this->preview, deployment_uuid: $this->deployment_uuid, status: ProcessStatus::IN_PROGRESS); }