jenkinsci/bitbucket-branch-source-plugin

Use new build status API of Bitbucket Server 7.4

KalleOlaviNiemitalo opened this issue · 1 comments

What feature do you want to see added?

Use the new build status API that was added in Bitbucket Server 7.4. It differs from the old API in the following ways:

  • The old API is at /rest/api/1.0/build-status/latest/commits/{commitId}, and the new API is at /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds.

    The new {projectKey} and {repositorySlug} parameters would complicate fixing JENKINS-66620; see #472 (comment).

  • The user of the old API only needs to be LICENSED. The user of the new API needs REPO_READ permission.

  • Build statuses that were added via the new API can be deleted later.

    The plugin could then be changed to delete build statuses of aborted builds, as suggested in #472 (comment).

Upstream changes

According to jenkinsci/atlassian-bitbucket-server-integration-plugin#401 (comment), the newer API also takes the Git ref name as a parameter, and Bitbucket uses that for deciding whether to show the build status in a pull request. Furthermore, if the source branch of a pull request is used as this ref, then the build status must be posted to the source repository of the pull request, not to the target repository.