diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java index 384879b80..cbfd95cf0 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -3171,7 +3171,9 @@ public PushRules getPushRules(Object projectIdOrPath) throws GitLabApiException * fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar * maxFileSize (optional) - Maximum file size (MB) * commitCommitterCheck (optional) - Users can only push commits to this repository that were committed with one of their own verified emails. + * commitCommitterNameCheck (optional) - Users can only push commits to this repository if the commit author name is consistent with their GitLab account name. * rejectUnsignedCommits (optional) - Reject commit when it is not signed through GPG + * rejectNonDcoCommits (optional) - Reject commit when it is not DCO certified * * * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required @@ -3191,7 +3193,9 @@ public PushRules createPushRules(Object projectIdOrPath, PushRules pushRule) thr .withParam("file_name_regex", pushRule.getFileNameRegex()) .withParam("max_file_size", pushRule.getMaxFileSize()) .withParam("commit_committer_check", pushRule.getCommitCommitterCheck()) - .withParam("reject_unsigned_commits", pushRule.getRejectUnsignedCommits()); + .withParam("commit_committer_name_check", pushRule.getCommitCommitterNameChack()) + .withParam("reject_unsigned_commits", pushRule.getRejectUnsignedCommits()) + .withParam("reject_non_dco_commits", pushRule.getRejectNonDcoCommits()); Response response = post(Response.Status.CREATED, formData, "projects", getProjectIdOrPath(projectIdOrPath), "push_rule"); @@ -3216,7 +3220,9 @@ public PushRules createPushRules(Object projectIdOrPath, PushRules pushRule) thr * fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar * maxFileSize (optional) - Maximum file size (MB) * commitCommitterCheck (optional) - Users can only push commits to this repository that were committed with one of their own verified emails. + * commitCommitterNameCheck (optional) - Users can only push commits to this repository if the commit author name is consistent with their GitLab account name. * rejectUnsignedCommits (optional) - Reject commit when it is not signed through GPG + * rejectNonDcoCommits (optional) - Reject commit when it is not DCO certified * * * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required @@ -3236,7 +3242,9 @@ public PushRules updatePushRules(Object projectIdOrPath, PushRules pushRule) thr .withParam("file_name_regex", pushRule.getFileNameRegex()) .withParam("max_file_size", pushRule.getMaxFileSize()) .withParam("commit_committer_check", pushRule.getCommitCommitterCheck()) - .withParam("reject_unsigned_commits", pushRule.getRejectUnsignedCommits()); + .withParam("commit_committer_name_check", pushRule.getCommitCommitterNameChack()) + .withParam("reject_unsigned_commits", pushRule.getRejectUnsignedCommits()) + .withParam("reject_non_dco_commits", pushRule.getRejectNonDcoCommits()); final Response response = putWithFormData( Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "push_rule"); diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/PushRules.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/PushRules.java index b94b4af74..10eade094 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/PushRules.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/PushRules.java @@ -23,6 +23,7 @@ public class PushRules implements Serializable { private Boolean commitCommitterCheck; private Boolean commitCommitterNameCheck; private Boolean rejectUnsignedCommits; + private Boolean rejectNonDcoCommits; public Long getId() { return id; @@ -182,6 +183,11 @@ public void setCommitCommitterNameCheck(Boolean commitCommitterNameCheck) { this.commitCommitterNameCheck = commitCommitterNameCheck; } + public PushRules withCommitCommitterNameCheck(Boolean commitCommitterNameCheck) { + this.commitCommitterNameCheck = commitCommitterNameCheck; + return (this); + } + public void setCommitCommitterCheck(Boolean commitCommitterCheck) { this.commitCommitterCheck = commitCommitterCheck; } @@ -204,6 +210,19 @@ public PushRules withRejectUnsignedCommits(Boolean rejectUnsignedCommits) { return (this); } + public Boolean getRejectNonDcoCommits() { + return rejectNonDcoCommits; + } + + public void setRejectNonDcoCommits(Boolean rejectUnsignedCommits) { + this.rejectNonDcoCommits = rejectNonDcoCommits; + } + + public PushRules withRejectNonDcoCommits(Boolean rejectNonDcoCommits) { + this.rejectNonDcoCommits = rejectNonDcoCommits; + return (this); + } + @Override public String toString() { return (JacksonJson.toJsonString(this));