From ff58e822f8d321fa21be3d867eb415e3595328c3 Mon Sep 17 00:00:00 2001 From: Dudy Shavit Date: Thu, 23 Jan 2025 18:33:10 +0200 Subject: [PATCH 1/2] replace the search for OWNER first search for OWNER type of group afterwards search for OWNER type of user --- .../plugins/gitlabbranchsource/GitLabSCMSource.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java b/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java index f3019535..b12dcdf9 100644 --- a/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java +++ b/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java @@ -914,13 +914,13 @@ public ListBoxModel doFillProjectPathItems( return new StandardListBoxModel().includeEmptyValue(); } try { - for (Project p : gitLabApi - .getProjectApi() - .getUserProjects(projectOwner, new ProjectFilter().withOwned(true))) { + for (Project p : gitLabApi.getGroupApi().getProjects(projectOwner)) { result.add(p.getPathWithNamespace()); } } catch (GitLabApiException e) { - for (Project p : gitLabApi.getGroupApi().getProjects(projectOwner)) { + for (Project p : gitLabApi + .getProjectApi() + .getUserProjects(projectOwner, new ProjectFilter().withOwned(true))) { result.add(p.getPathWithNamespace()); } } From 982b0366b99df9ed871edd737f7a9e64b37b306c Mon Sep 17 00:00:00 2001 From: Dudy Shavit Date: Thu, 23 Jan 2025 22:27:19 +0200 Subject: [PATCH 2/2] fix identification by running mvn spotless:apply --- .../jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java b/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java index b12dcdf9..309ec5e2 100644 --- a/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java +++ b/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java @@ -919,8 +919,8 @@ public ListBoxModel doFillProjectPathItems( } } catch (GitLabApiException e) { for (Project p : gitLabApi - .getProjectApi() - .getUserProjects(projectOwner, new ProjectFilter().withOwned(true))) { + .getProjectApi() + .getUserProjects(projectOwner, new ProjectFilter().withOwned(true))) { result.add(p.getPathWithNamespace()); } }