From 1217ae356fc3c020346842d15c681f775ab73fc2 Mon Sep 17 00:00:00 2001 From: wil Date: Wed, 25 Mar 2026 22:08:48 +0100 Subject: [PATCH 1/2] feat: add missing with method --- .../src/main/java/org/gitlab4j/api/models/PushRules.java | 5 +++++ 1 file changed, 5 insertions(+) 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..d22bc3a3f 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 @@ -182,6 +182,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; } From b3889fa68874e56d4bcddf25bfb3e7a8d40ea9db Mon Sep 17 00:00:00 2001 From: wil Date: Thu, 26 Mar 2026 17:59:17 +0100 Subject: [PATCH 2/2] feat: add missing push rules properties --- .../src/main/java/org/gitlab4j/api/ProjectApi.java | 12 ++++++++++-- .../java/org/gitlab4j/api/models/PushRules.java | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) 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 d22bc3a3f..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; @@ -209,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));