Skip to content
Snippets Groups Projects

Iss #156 - Add handling of Gitlab repo field from projects API

Merged Iss #156 - Add handling of Gitlab repo field from projects API
1 unresolved thread
Merged Martin Lowe requested to merge malowe/main/156 into main
1 unresolved thread
4 files
+ 227
130
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -32,8 +32,8 @@ import jakarta.enterprise.context.ApplicationScoped;
@@ -32,8 +32,8 @@ import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.inject.Inject;
/**
/**
* Helps manage projects by providing filters on top of the generic service as well as operations like adapting interest
* Helps manage projects by providing filters on top of the generic service as well as operations like adapting interest groups to projects
* groups to projects for easier processing.
* for easier processing.
*
*
* @author Martin Lowe
* @author Martin Lowe
*
*
@@ -76,8 +76,12 @@ public final class ProjectHelper {
@@ -76,8 +76,12 @@ public final class ProjectHelper {
case GITLAB:
case GITLAB:
return availableProjects
return availableProjects
.stream()
.stream()
.filter(p -> projectNamespace.startsWith(p.getGitlab().getProjectGroup() + "/")
.filter(p -> p.getGitlabRepos().stream().anyMatch(re -> re.getUrl() != null && re.getUrl().endsWith(repoUrl))
&& p.getGitlab().getIgnoredSubGroups().stream().noneMatch(sg -> projectNamespace.startsWith(sg + "/")))
|| (projectNamespace.startsWith(p.getGitlab().getProjectGroup() + "/") && p
 
.getGitlab()
 
.getIgnoredSubGroups()
 
.stream()
 
.noneMatch(sg -> projectNamespace.startsWith(sg + "/"))))
Please register or sign in to reply
.toList();
.toList();
case GITHUB:
case GITHUB:
return availableProjects
return availableProjects
Loading