Skip to content

Commit 84b6b4c

Browse files
committed
Remove deprecated "addCommitStatus" method
1 parent 17412b4 commit 84b6b4c

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

src/main/java/org/gitlab4j/api/CommitsApi.java

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -563,39 +563,11 @@ public Stream<CommitStatus> getCommitStatusesStream(Object projectIdOrPath, Stri
563563
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance (required)
564564
* @param sha a commit SHA (required)
565565
* @param state the state of the status. Can be one of the following: PENDING, RUNNING, SUCCESS, FAILED, CANCELED (required)
566-
* @param status the CommitSatus instance hoilding the optional parms: ref, name, target_url, description, and coverage
566+
* @param status the CommitSatus instance holding the optional parameters: ref, name, target_url, description, and coverage
567567
* @return a CommitStatus instance with the updated info
568568
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
569569
*/
570570
public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBuildState state, CommitStatus status) throws GitLabApiException {
571-
return addCommitStatus(projectIdOrPath, sha, state, null, status);
572-
}
573-
574-
/**
575-
* <p>Add or update the build status of a commit. The following fluent methods are available on the
576-
* CommitStatus instance for setting up the status:</p>
577-
* <pre><code>
578-
* withCoverage(Float)
579-
* withDescription(String)
580-
* withName(String)
581-
* withRef(String)
582-
* withTargetUrl(String)
583-
* </code></pre>
584-
*
585-
* <pre><code>GitLab Endpoint: POST /projects/:id/statuses/:sha</code></pre>
586-
*
587-
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance (required)
588-
* @param sha a commit SHA (required)
589-
* @param state the state of the status. Can be one of the following: PENDING, RUNNING, SUCCESS, FAILED, CANCELED (required)
590-
* @param pipelineId The ID of the pipeline to set status. Use in case of several pipeline on same SHA (optional)
591-
* @param status the CommitSatus instance hoilding the optional parms: ref, name, target_url, description, and coverage
592-
* @return a CommitStatus instance with the updated info
593-
* @throws GitLabApiException GitLabApiException if any exception occurs during execution
594-
* @deprecated use {@link #addCommitStatus(Object, String, org.gitlab4j.api.Constants.CommitBuildState, CommitStatus)} and set the pipelineId value in the {@link CommitStatus} parameter
595-
*/
596-
@Deprecated
597-
public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBuildState state, Long pipelineId, CommitStatus status) throws GitLabApiException {
598-
599571
if (projectIdOrPath == null) {
600572
throw new RuntimeException("projectIdOrPath cannot be null");
601573
}
@@ -612,13 +584,6 @@ public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBu
612584
.withParam("description", status.getDescription())
613585
.withParam("coverage", status.getCoverage())
614586
.withParam("pipeline_id", status.getPipelineId());
615-
if (pipelineId != null && status.getPipelineId() != null && !Objects.equals(status.getPipelineId(), pipelineId)) {
616-
throw new IllegalArgumentException("The parameter 'pipelineId' and the pipelineId value the 'status' parameter are different. Set the two values to be the same or one of the two values to null.");
617-
}
618-
}
619-
620-
if (pipelineId != null) {
621-
formData.withParam("pipeline_id", pipelineId);
622587
}
623588

624589
Response response = post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "statuses", sha);

0 commit comments

Comments
 (0)