From 0aed003b3205a5af9955593dd5d675d635c8d2d2 Mon Sep 17 00:00:00 2001 From: DualFroz Date: Thu, 23 Jul 2026 07:24:44 +0200 Subject: [PATCH] fix: GitLab repo_id mishandled group/subgroup-owned projects repo_id() always prefixed self.namespace onto the given repo name, so any repo already passed as a full group/repo or group/subgroup/repo path got mangled into namespace/group/repo and 404'd on every settings-tab mutation. Now mirrors GitHubProvider::slug: an already-qualified path (contains '/') is used verbatim. --- src/providers/gitlab.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/providers/gitlab.rs b/src/providers/gitlab.rs index 285771b..3639981 100644 --- a/src/providers/gitlab.rs +++ b/src/providers/gitlab.rs @@ -42,10 +42,13 @@ impl GitLabProvider { /// Builds GitLab's URL-encoded project identifier (`namespace%2Frepo`), /// since the v4 API addresses projects by encoded path rather than a - /// separate numeric id field this codebase tracks. + /// separate numeric id field this codebase tracks. `repo` may already be + /// a full `group/subgroup/repo` path (mirrors `GitHubProvider::slug`) — + /// in that case it's used verbatim instead of prefixing `self.namespace` + /// again, which would otherwise mangle any group- or subgroup-owned + /// project into a nonexistent `namespace/group/repo` path. fn repo_id(&self, repo: &str) -> String { - // Percent-encode "namespace/repo" for use in URL path segments - let raw = format!("{}/{}", self.namespace, repo); + let raw = if repo.contains('/') { repo.to_string() } else { format!("{}/{}", self.namespace, repo) }; raw.replace('/', "%2F") }