Skip to content

Add allowMergeOnSkippedPipeline to Project #846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/org/gitlab4j/api/MergeRequestApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public Optional<MergeRequest> getOptionalMergeRequest(Object projectIdOrPath, Lo
* @return a list containing the commits for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public List<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid) throws GitLabApiException {
public List<Commit> getCommits(Object projectIdOrPath, Long mergeRequestIid) throws GitLabApiException {
return (getCommits(projectIdOrPath, mergeRequestIid, getDefaultPerPage()).all());
}

Expand All @@ -349,7 +349,7 @@ public List<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid) thro
* @return a list containing the commits for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public List<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid, int page, int perPage) throws GitLabApiException {
public List<Commit> getCommits(Object projectIdOrPath, Long mergeRequestIid, int page, int perPage) throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("owned", true).withParam(PAGE_PARAM, page).withParam(PER_PAGE_PARAM, perPage);
Response response = get(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "commits");
return (response.readEntity(new GenericType<List<Commit>>() {}));
Expand All @@ -368,7 +368,7 @@ public List<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid, int
* @return a Pager containing the commits for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public Pager<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid, int itemsPerPage) throws GitLabApiException {
public Pager<Commit> getCommits(Object projectIdOrPath, Long mergeRequestIid, int itemsPerPage) throws GitLabApiException {
return (new Pager<Commit>(this, Commit.class, itemsPerPage, null,
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "commits"));
}
Expand All @@ -385,7 +385,7 @@ public Pager<Commit> getCommits(Object projectIdOrPath, int mergeRequestIid, int
* @return a Stream containing the commits for the specified merge request
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/
public Stream<Commit> getCommitsStream(Object projectIdOrPath, int mergeRequestIid) throws GitLabApiException {
public Stream<Commit> getCommitsStream(Object projectIdOrPath, Long mergeRequestIid) throws GitLabApiException {
return (getCommits(projectIdOrPath, mergeRequestIid, getDefaultPerPage()).stream());
}

Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/gitlab4j/api/models/MergeRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MergeRequest {
private Author author;
private Boolean blockingDiscussionsResolved;
private List<Diff> changes;
private String changesCount;
private Date closedAt;
private Participant closedBy;
private Date createdAt;
Expand Down Expand Up @@ -136,6 +137,14 @@ public void setChanges(List<Diff> changes) {
this.changes = changes;
}

public String getChangesCount() {
return changesCount;
}

public void setChangesCount(String changesCount) {
this.changesCount = changesCount;
}

public Date getClosedAt() {
return closedAt;
}
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public String toString() {
private Namespace namespace;
private String nameWithNamespace;
private Boolean onlyAllowMergeIfPipelineSucceeds;
private Boolean allowMergeOnSkippedPipeline;
private Boolean onlyAllowMergeIfAllDiscussionsAreResolved;
private Integer openIssuesCount;
private Owner owner;
Expand Down Expand Up @@ -360,6 +361,19 @@ public Project withOnlyAllowMergeIfPipelineSucceeds(Boolean onlyAllowMergeIfPipe
return (this);
}

public Boolean getAllowMergeOnSkippedPipeline() {
return allowMergeOnSkippedPipeline;
}

public void setAllowMergeOnSkippedPipeline(Boolean allowMergeOnSkippedPipeline) {
this.allowMergeOnSkippedPipeline = allowMergeOnSkippedPipeline;
}

public Project withAllowMergeOnSkippedPipeline(Boolean allowMergeOnSkippedPipeline) {
this.allowMergeOnSkippedPipeline = allowMergeOnSkippedPipeline;
return (this);
}

public Boolean getOnlyAllowMergeIfAllDiscussionsAreResolved() {
return onlyAllowMergeIfAllDiscussionsAreResolved;
}
Expand Down