Skip to content
Snippets Groups Projects

Fix support for GH project org and ignored repos

Merged Martin Lowe requested to merge (removed):malowe/main/message-fix into main
4 files
+ 327
186
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -23,8 +23,7 @@ import com.google.auto.value.AutoValue;
@@ -23,8 +23,7 @@ import com.google.auto.value.AutoValue;
import com.google.auto.value.extension.memoized.Memoized;
import com.google.auto.value.extension.memoized.Memoized;
/**
/**
* Represents a project in the Eclipse API, along with the users and repos that
* Represents a project in the Eclipse API, along with the users and repos that exist within the context of the project.
* exist within the context of the project.
*
*
* @author Martin Lowe
* @author Martin Lowe
*
*
@@ -53,6 +52,8 @@ public abstract class Project {
@@ -53,6 +52,8 @@ public abstract class Project {
public abstract GitlabProject getGitlab();
public abstract GitlabProject getGitlab();
 
public abstract GithubProject getGithub();
 
@Nullable
@Nullable
@Memoized
@Memoized
public String getSpecWorkingGroup() {
public String getSpecWorkingGroup() {
@@ -71,8 +72,12 @@ public abstract class Project {
@@ -71,8 +72,12 @@ public abstract class Project {
public static Builder builder() {
public static Builder builder() {
// adds empty lists as default values
// adds empty lists as default values
return new AutoValue_Project.Builder().setRepos(new ArrayList<>()).setCommitters(new ArrayList<>())
return new AutoValue_Project.Builder()
.setGithubRepos(new ArrayList<>()).setGitlabRepos(new ArrayList<>()).setGerritRepos(new ArrayList<>());
.setRepos(new ArrayList<>())
 
.setCommitters(new ArrayList<>())
 
.setGithubRepos(new ArrayList<>())
 
.setGitlabRepos(new ArrayList<>())
 
.setGerritRepos(new ArrayList<>());
}
}
@AutoValue.Builder
@AutoValue.Builder
@@ -98,6 +103,8 @@ public abstract class Project {
@@ -98,6 +103,8 @@ public abstract class Project {
public abstract Builder setGitlab(GitlabProject gitlab);
public abstract Builder setGitlab(GitlabProject gitlab);
 
public abstract Builder setGithub(GithubProject github);
 
public abstract Project build();
public abstract Project build();
}
}
@@ -145,6 +152,28 @@ public abstract class Project {
@@ -145,6 +152,28 @@ public abstract class Project {
}
}
}
}
 
@AutoValue
 
@JsonDeserialize(builder = AutoValue_Project_GithubProject.Builder.class)
 
public abstract static class GithubProject {
 
public abstract String getOrg();
 
 
public abstract List<String> getIgnoredRepos();
 
 
public static Builder builder() {
 
return new AutoValue_Project_GithubProject.Builder();
 
}
 
 
@AutoValue.Builder
 
@JsonPOJOBuilder(withPrefix = "set")
 
public abstract static class Builder {
 
public abstract Builder setOrg(String org);
 
 
public abstract Builder setIgnoredRepos(List<String> ignoredRepos);
 
 
public abstract GithubProject build();
 
}
 
}
 
/**
/**
* Does not use autovalue as the value should be mutable.
* Does not use autovalue as the value should be mutable.
*
*
Loading