From 04c9d418956555e2e6c5c9aead99efa4cff79c18 Mon Sep 17 00:00:00 2001 From: Chetan Date: Thu, 11 Jun 2026 14:43:26 +0530 Subject: [PATCH] fix: update gitlab urls for issues and prs to match new format (#1728) * fix: update gitlab urls for issues and prs to match new format Added an optional host parameter to the gitlab method, defaulting to 'gitlab.com'. Updated the issues and prs URLs to include '/-/' in the path, which is the new format for GitLab URLs. This change ensures that the URLs generated for GitLab projects are correct and reflect the new structure of GitLab's URLs for issues and merge requests. Host parameter allows users to specify a custom GitLab instance if they are using a self-hosted version of GitLab, while still maintaining the default behavior for users who are using gitlab.com. * fix: update gitlab method to use hostname parameter correctly --- src/Configuration/Project.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Configuration/Project.php b/src/Configuration/Project.php index 936c37c6..9a735b48 100644 --- a/src/Configuration/Project.php +++ b/src/Configuration/Project.php @@ -59,12 +59,15 @@ final class Project /** * Sets the test project to GitLab. */ - public function gitlab(string $project): self + public function gitlab(string $project, string $hostname = 'gitlab.com'): self { - $this->issues = "https://gitlab.com/{$project}/issues/%s"; - $this->prs = "https://gitlab.com/{$project}/merge_requests/%s"; + // Simple way to ensure only the host is used + $hostname = parse_url($hostname, PHP_URL_HOST) ?? $hostname; - $this->assignees = 'https://gitlab.com/%s'; + $this->issues = "https://{$hostname}/{$project}/-/work_items/%s"; + $this->prs = "https://{$hostname}/{$project}/-/merge_requests/%s"; + + $this->assignees = "https://{$hostname}/%s"; return $this; }