Skip to content

Add support for resolve_outdated_diff_discussions in Project #263

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
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
11 changes: 9 additions & 2 deletions src/main/java/org/gitlab4j/api/ProjectApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ public Project createProject(Project project) throws GitLabApiException {
* repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins
* approvalsBeforeMerge (optional) - How many approvers should approve merge request by default
* 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
* initialize_with_readme (optional) - Initialize project with README file
*
* @param project the Project instance with the configuration for the new project
* @param importUrl the URL to import the repository from
Expand Down Expand Up @@ -696,7 +698,9 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
.withParam("repository_storage", project.getRepositoryStorage())
.withParam("approvals_before_merge", project.getApprovalsBeforeMerge())
.withParam("import_url", importUrl)
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled());
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions())
.withParam("initialize_with_readme", project.getInitializeWithReadme());

if (isApiVersion(ApiVersion.V3)) {
boolean isPublic = (project.getPublic() != null ? project.getPublic() : project.getVisibility() == Visibility.PUBLIC);
Expand Down Expand Up @@ -889,12 +893,14 @@ public Project createProject(String name, Integer namespaceId, String descriptio
* repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins
* approvalsBeforeMerge (optional) - How many approvers should approve merge request by default
* 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
*
* NOTE: The following parameters specified by the GitLab API edit project are not supported:
* import_url
* tag_list array
* avatar
* ci_config_path
* initialize_with_readme
*
* @param project the Project instance with the configuration for the new project
* @return a Project instance with the newly updated project info
Expand Down Expand Up @@ -936,7 +942,8 @@ public Project updateProject(Project project) throws GitLabApiException {
.withParam("request_access_enabled", project.getRequestAccessEnabled())
.withParam("repository_storage", project.getRepositoryStorage())
.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());

if (isApiVersion(ApiVersion.V3)) {
formData.withParam("visibility_level", project.getVisibilityLevel());
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public String toString() {
private String webUrl;
private Boolean wikiEnabled;
private Boolean printingMergeRequestLinkEnabled;
private Boolean resolveOutdatedDiffDiscussions;
private ProjectStatistics statistics;
private Boolean initializeWithReadme;

public Integer getApprovalsBeforeMerge() {
return approvalsBeforeMerge;
Expand Down Expand Up @@ -593,6 +595,32 @@ public Project withPrintingMergeRequestLinkEnabled(Boolean printingMergeRequestL
return (this);
}

public Boolean getResolveOutdatedDiffDiscussions() {
return resolveOutdatedDiffDiscussions;
}

public void setResolveOutdatedDiffDiscussions(Boolean resolveOutdatedDiffDiscussions) {
this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions;
}

public Project withResolveOutdatedDiffDiscussions(boolean resolveOutdatedDiffDiscussions) {
this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions;
return (this);
}

public Boolean getInitializeWithReadme() {
return initializeWithReadme;
}

public void setInitializeWithReadme(Boolean initializeWithReadme) {
this.initializeWithReadme = initializeWithReadme;
}

public Project withInitializeWithReadme(boolean initializeWithReadme) {
this.initializeWithReadme = initializeWithReadme;
return (this);
}

public ProjectStatistics getStatistics() {
return statistics;
}
Expand Down