Skip to content
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
4 changes: 4 additions & 0 deletions gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ public Project createProject(Project project) throws GitLabApiException {
* ciConfigPath (optional) - Set path to CI configuration file
* autoDevopsEnabled (optional) - Enable Auto DevOps for this project
* squashOption (optional) - set squash option for merge requests
* ciDeletePipelinesInSeconds (optional) - set the automatic pipeline cleanup time in seconds
*
* @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 @@ -1125,6 +1126,7 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
.withParam("build_git_strategy", project.getBuildGitStrategy())
.withParam("build_coverage_regex", project.getBuildCoverageRegex())
.withParam("ci_config_path", project.getCiConfigPath())
.withParam("ci_delete_pipelines_in_seconds", project.getCiDeletePipelinesInSeconds())
.withParam("suggestion_commit_message", project.getSuggestionCommitMessage())
.withParam("remove_source_branch_after_merge", project.getRemoveSourceBranchAfterMerge())
.withParam("auto_devops_enabled", project.getAutoDevopsEnabled())
Expand Down Expand Up @@ -1445,6 +1447,7 @@ public Project createProjectFromTemplate(
* ciConfigPath (optional) - Set path to CI configuration file
* ciForwardDeploymentEnabled (optional) - When a new deployment job starts, skip older deployment jobs that are still pending
* squashOption (optional) - set squash option for merge requests
* ciDeletePipelinesInSeconds (optional) - set the automatic pipeline cleanup time in seconds
*
* NOTE: The following parameters specified by the GitLab API edit project are not supported:
* import_url
Expand Down Expand Up @@ -1494,6 +1497,7 @@ public Project updateProject(Project project) throws GitLabApiException {
.withParam("build_coverage_regex", project.getBuildCoverageRegex())
.withParam("ci_config_path", project.getCiConfigPath())
.withParam("ci_forward_deployment_enabled", project.getCiForwardDeploymentEnabled())
.withParam("ci_delete_pipelines_in_seconds", project.getCiDeletePipelinesInSeconds())
.withParam("merge_method", project.getMergeMethod())
.withParam("suggestion_commit_message", project.getSuggestionCommitMessage())
.withParam("remove_source_branch_after_merge", project.getRemoveSourceBranchAfterMerge())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ public void testUpdate() throws GitLabApiException {
.withTagList(Arrays.asList("tag1", "tag2"))
.withMergeMethod(Project.MergeMethod.MERGE)
.withSuggestionCommitMessage("SuggestionCommitMessageOriginal")
.withRemoveSourceBranchAfterMerge(false);
.withRemoveSourceBranchAfterMerge(false)
.withCiDeletePipelineInSeconds(3600);

Project newProject = gitLabApi.getProjectApi().createProject(project);
assertNotNull(newProject);
Expand All @@ -289,6 +290,7 @@ public void testUpdate() throws GitLabApiException {
assertEquals(Project.MergeMethod.MERGE, newProject.getMergeMethod());
assertEquals(project.getSuggestionCommitMessage(), newProject.getSuggestionCommitMessage());
assertEquals(project.getRemoveSourceBranchAfterMerge(), newProject.getRemoveSourceBranchAfterMerge());
assertEquals(project.getCiDeletePipelinesInSeconds(), newProject.getCiDeletePipelinesInSeconds());

project = new Project()
.withId(newProject.getId())
Expand Down
14 changes: 14 additions & 0 deletions gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public String toString() {
private String ciRestrictPipelineCancellationRole;
private String ciPipelineVariablesMinimumOverrideRole;
private Boolean ciPushRepositoryForJobTokenAllowed;
private Integer ciDeletePipelinesInSeconds;
private Boolean allowPipelineTriggerApproveDeployment;
private Boolean restrictUserDefinedVariables;
private Boolean enforceAuthChecksOnUploads;
Expand Down Expand Up @@ -1383,6 +1384,19 @@ public void setCiPushRepositoryForJobTokenAllowed(Boolean ciPushRepositoryForJob
this.ciPushRepositoryForJobTokenAllowed = ciPushRepositoryForJobTokenAllowed;
}

public Integer getCiDeletePipelinesInSeconds() {
return ciDeletePipelinesInSeconds;
}

public void setCiDeletePipelinesInSeconds(Integer ciDeletePipelinesInSeconds) {
this.ciDeletePipelinesInSeconds = ciDeletePipelinesInSeconds;
}

public Project withCiDeletePipelineInSeconds(Integer ciDeletePipelineInSeconds) {
this.ciDeletePipelinesInSeconds = ciDeletePipelineInSeconds;
return this;
}

public Boolean getAllowPipelineTriggerApproveDeployment() {
return allowPipelineTriggerApproveDeployment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,6 @@
"requirements_access_level" : "enabled",
"security_and_compliance_access_level" : "private",
"snippets_access_level" : "enabled",
"wiki_access_level" : "enabled"
"wiki_access_level" : "enabled",
"ci_delete_pipelines_in_seconds": 604800
}
Loading