Unverified Commit 1366c31d authored by Kvakos's avatar Kvakos Committed by GitHub
Browse files

Added buildCoverageRegex and buildGitStrategy properties to Project (#600)

parent ce7f5e9b
...@@ -825,5 +825,28 @@ public interface Constants { ...@@ -825,5 +825,28 @@ public interface Constants {
return (enumHelper.toString(this)); return (enumHelper.toString(this));
} }
} }
/** Enum for the build_git_strategy of the project instance. */
enum BuildGitStrategy {
FETCH, CLONE;
private static JacksonJsonEnumHelper<BuildGitStrategy> enumHelper = new JacksonJsonEnumHelper<>(BuildGitStrategy.class);
@JsonCreator
public static BuildGitStrategy forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
} }
...@@ -236,7 +236,9 @@ public class ImportExportApi extends AbstractApi { ...@@ -236,7 +236,9 @@ public class ImportExportApi extends AbstractApi {
.withParam("printing_merge_request_link_enabled", overrideParams.getPrintingMergeRequestLinkEnabled()) .withParam("printing_merge_request_link_enabled", overrideParams.getPrintingMergeRequestLinkEnabled())
.withParam("resolve_outdated_diff_discussions", overrideParams.getResolveOutdatedDiffDiscussions()) .withParam("resolve_outdated_diff_discussions", overrideParams.getResolveOutdatedDiffDiscussions())
.withParam("initialize_with_readme", overrideParams.getInitializeWithReadme()) .withParam("initialize_with_readme", overrideParams.getInitializeWithReadme())
.withParam("packages_enabled", overrideParams.getPackagesEnabled()); .withParam("packages_enabled", overrideParams.getPackagesEnabled())
.withParam("build_git_strategy", overrideParams.getBuildGitStrategy())
.withParam("build_coverage_regex", overrideParams.getBuildCoverageRegex());
} }
Response response = upload(Response.Status.CREATED, "file", exportFile, null, formData, url); Response response = upload(Response.Status.CREATED, "file", exportFile, null, formData, url);
......
...@@ -953,6 +953,8 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -953,6 +953,8 @@ public class ProjectApi extends AbstractApi implements Constants {
* resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push * resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push
* initialize_with_readme (optional) - Initialize project with README file * initialize_with_readme (optional) - Initialize project with README file
* packagesEnabled (optional) - Enable or disable mvn packages repository feature * packagesEnabled (optional) - Enable or disable mvn packages repository feature
* buildGitStrategy (optional) - set the build git strategy
* buildCoverageRegex (optional) - set build coverage regex
* *
* @param project the Project instance with the configuration for the new project * @param project the Project instance with the configuration for the new project
* @param importUrl the URL to import the repository from * @param importUrl the URL to import the repository from
...@@ -997,7 +999,9 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -997,7 +999,9 @@ public class ProjectApi extends AbstractApi implements Constants {
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled()) .withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions()) .withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions())
.withParam("initialize_with_readme", project.getInitializeWithReadme()) .withParam("initialize_with_readme", project.getInitializeWithReadme())
.withParam("packages_enabled", project.getPackagesEnabled()); .withParam("packages_enabled", project.getPackagesEnabled())
.withParam("build_git_strategy", project.getBuildGitStrategy())
.withParam("build_coverage_regex", project.getBuildCoverageRegex());
Namespace namespace = project.getNamespace(); Namespace namespace = project.getNamespace();
if (namespace != null && namespace.getId() != null) { if (namespace != null && namespace.getId() != null) {
...@@ -1197,6 +1201,8 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -1197,6 +1201,8 @@ public class ProjectApi extends AbstractApi implements Constants {
* printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line * printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line
* resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push * resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push
* packagesEnabled (optional) - Enable or disable mvn packages repository feature * packagesEnabled (optional) - Enable or disable mvn packages repository feature
* buildGitStrategy (optional) - set the build git strategy
* buildCoverageRegex (optional) - set build coverage regex
* *
* NOTE: The following parameters specified by the GitLab API edit project are not supported: * NOTE: The following parameters specified by the GitLab API edit project are not supported:
* import_url * import_url
...@@ -1240,7 +1246,9 @@ public class ProjectApi extends AbstractApi implements Constants { ...@@ -1240,7 +1246,9 @@ public class ProjectApi extends AbstractApi implements Constants {
.withParam("approvals_before_merge", project.getApprovalsBeforeMerge()) .withParam("approvals_before_merge", project.getApprovalsBeforeMerge())
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled()) .withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions()) .withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions())
.withParam("packages_enabled", project.getPackagesEnabled()); .withParam("packages_enabled", project.getPackagesEnabled())
.withParam("build_git_strategy", project.getBuildGitStrategy())
.withParam("build_coverage_regex", project.getBuildCoverageRegex());
if (isApiVersion(ApiVersion.V3)) { if (isApiVersion(ApiVersion.V3)) {
formData.withParam("visibility_level", project.getVisibilityLevel()); formData.withParam("visibility_level", project.getVisibilityLevel());
......
...@@ -12,6 +12,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; ...@@ -12,6 +12,8 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.gitlab4j.api.Constants.BuildGitStrategy;
public class Project { public class Project {
// Enum for the merge_method of the Project instance. // Enum for the merge_method of the Project instance.
...@@ -90,6 +92,8 @@ public class Project { ...@@ -90,6 +92,8 @@ public class Project {
private String licenseUrl; private String licenseUrl;
private ProjectLicense license; private ProjectLicense license;
private List<CustomAttribute> customAttributes; private List<CustomAttribute> customAttributes;
private String buildCoverageRegex;
private BuildGitStrategy buildGitStrategy;
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class) @JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
private Date markedForDeletionOn; private Date markedForDeletionOn;
...@@ -706,4 +710,30 @@ public class Project { ...@@ -706,4 +710,30 @@ public class Project {
public static final String getPathWithNammespace(String namespace, String path) { public static final String getPathWithNammespace(String namespace, String path) {
return (namespace.trim() + "/" + path.trim()); return (namespace.trim() + "/" + path.trim());
} }
public String getBuildCoverageRegex() {
return buildCoverageRegex;
}
public void setBuildCoverageRegex(String buildCoverageRegex) {
this.buildCoverageRegex = buildCoverageRegex;
}
public Project withBuildCoverageRegex(String buildCoverageRegex) {
this.buildCoverageRegex = buildCoverageRegex;
return this;
}
public BuildGitStrategy getBuildGitStrategy() {
return buildGitStrategy;
}
public void setBuildGitStrategy(BuildGitStrategy buildGitStrategy) {
this.buildGitStrategy = buildGitStrategy;
}
public Project withBuildGitStrategy(BuildGitStrategy buildGitStrategy) {
this.buildGitStrategy = buildGitStrategy;
return this;
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment