diff --git a/src/main/java/org/gitlab4j/api/CommitsApi.java b/src/main/java/org/gitlab4j/api/CommitsApi.java index b34a426f9..2def02787 100644 --- a/src/main/java/org/gitlab4j/api/CommitsApi.java +++ b/src/main/java/org/gitlab4j/api/CommitsApi.java @@ -563,39 +563,11 @@ public Stream getCommitStatusesStream(Object projectIdOrPath, Stri * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance (required) * @param sha a commit SHA (required) * @param state the state of the status. Can be one of the following: PENDING, RUNNING, SUCCESS, FAILED, CANCELED (required) - * @param status the CommitSatus instance hoilding the optional parms: ref, name, target_url, description, and coverage + * @param status the CommitSatus instance holding the optional parameters: ref, name, target_url, description, and coverage * @return a CommitStatus instance with the updated info * @throws GitLabApiException GitLabApiException if any exception occurs during execution */ public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBuildState state, CommitStatus status) throws GitLabApiException { - return addCommitStatus(projectIdOrPath, sha, state, null, status); - } - - /** - *

Add or update the build status of a commit. The following fluent methods are available on the - * CommitStatus instance for setting up the status:

- *

-     * withCoverage(Float)
-     * withDescription(String)
-     * withName(String)
-     * withRef(String)
-     * withTargetUrl(String)
-     * 
- * - *
GitLab Endpoint: POST /projects/:id/statuses/:sha
- * - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance (required) - * @param sha a commit SHA (required) - * @param state the state of the status. Can be one of the following: PENDING, RUNNING, SUCCESS, FAILED, CANCELED (required) - * @param pipelineId The ID of the pipeline to set status. Use in case of several pipeline on same SHA (optional) - * @param status the CommitSatus instance hoilding the optional parms: ref, name, target_url, description, and coverage - * @return a CommitStatus instance with the updated info - * @throws GitLabApiException GitLabApiException if any exception occurs during execution - * @deprecated use {@link #addCommitStatus(Object, String, org.gitlab4j.api.Constants.CommitBuildState, CommitStatus)} and set the pipelineId value in the {@link CommitStatus} parameter - */ - @Deprecated - public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBuildState state, Long pipelineId, CommitStatus status) throws GitLabApiException { - if (projectIdOrPath == null) { throw new RuntimeException("projectIdOrPath cannot be null"); } @@ -612,13 +584,6 @@ public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBu .withParam("description", status.getDescription()) .withParam("coverage", status.getCoverage()) .withParam("pipeline_id", status.getPipelineId()); - if (pipelineId != null && status.getPipelineId() != null && !Objects.equals(status.getPipelineId(), pipelineId)) { - 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."); - } - } - - if (pipelineId != null) { - formData.withParam("pipeline_id", pipelineId); } Response response = post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "statuses", sha);