From 47535d2cabdccc588921782ee5db222c1d7acd10 Mon Sep 17 00:00:00 2001
From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Date: Fri, 16 Oct 2026 21:21:22 +0200
Subject: [PATCH] fix(webhooks): show GitLab webhook setup for GitLab App
sources
Closes #11602
---
app/Livewire/Project/Shared/Webhooks.php | 13 +++
.../project/shared/webhooks.blade.php | 31 +++++++
.../Webhook/GitAppWebhookSetupTest.php | 82 +++++++++++++++++++
3 files changed, 126 insertions(+)
create mode 100644 tests/Feature/Webhook/GitAppWebhookSetupTest.php
diff --git a/app/Livewire/Project/Shared/Webhooks.php b/app/Livewire/Project/Shared/Webhooks.php
index 172d91fc5e..b43ea471b0 100644
--- a/app/Livewire/Project/Shared/Webhooks.php
+++ b/app/Livewire/Project/Shared/Webhooks.php
@@ -2,11 +2,14 @@
namespace App\Livewire\Project\Shared;
+use App\Models\Application;
+use App\Models\GitlabApp;
use App\Rules\ManualWebhookSecret;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Livewire\Component;
+use Spatie\Url\Url;
// Refactored ✅
class Webhooks extends Component
@@ -25,6 +28,12 @@ class Webhooks extends Component
public ?string $giteaManualWebhook;
+ /**
+ * Source-level endpoint for GitLab App sources. GitLab has no app-level webhooks,
+ * so users add this URL to each GitLab project themselves.
+ */
+ public ?string $gitlabAppWebhook = null;
+
public ?string $githubManualWebhookSecret = null;
public ?string $gitlabManualWebhookSecret = null;
@@ -60,6 +69,10 @@ class Webhooks extends Component
$this->gitlabManualWebhook = generateGitManualWebhook($this->resource, 'gitlab');
$this->bitbucketManualWebhook = generateGitManualWebhook($this->resource, 'bitbucket');
$this->giteaManualWebhook = generateGitManualWebhook($this->resource, 'gitea');
+
+ if ($this->resource instanceof Application && $this->resource->source instanceof GitlabApp) {
+ $this->gitlabAppWebhook = Url::fromString(base_url()).'/webhooks/source/gitlab/events';
+ }
}
public function canViewSecrets(): bool
diff --git a/resources/views/livewire/project/shared/webhooks.blade.php b/resources/views/livewire/project/shared/webhooks.blade.php
index 8e5483b283..a004d83796 100644
--- a/resources/views/livewire/project/shared/webhooks.blade.php
+++ b/resources/views/livewire/project/shared/webhooks.blade.php
@@ -99,6 +99,37 @@
+ @elseif ($gitlabAppWebhook)
+
+
+ @can('view', $resource->source)
+
+ Source settings
+
+ @endcan
+ @if (filled($resource?->gitWebhook))
+
+ Repository settings
+
+
+ @endif
+
+
+
+
+
GitLab
+
+ Add this URL in the GitLab project under Settings → Webhooks. Set the Secret token to
+ the Webhook secret token from the source settings, and enable Push events and Merge
+ request events.
+