Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31680

Use new bitbucket api to set if build success instead of add a comment

      Would be nice if instead of posting many comments in the bitbucket pull-request, the plugin use the new build status API to set the build status, INPROGRESS, SUCCESSFUL, FAILED.

      http://blog.bitbucket.org/2015/11/18/introducing-the-build-status-api-for-bitbucket-cloud/

      https://confluence.atlassian.com/bitbucket/buildstatus-resource-779295267.html

          [JENKINS-31680] Use new bitbucket api to set if build success instead of add a comment

          Nenad Miksa added a comment -

          We also noticed that with 1.4.8 each pull request triggers build multiple times. I will open a new issue for that.

          Nenad Miksa added a comment - We also noticed that with 1.4.8 each pull request triggers build multiple times. I will open a new issue for that.

          Afraid I cannot help with any logs - I just upgraded the plugin from within jenkins, restarted jenkins and added values for the two new variables. Then we got the new build status updated for the various PRs in bitbucket (as seen here http://blog.bitbucket.org/files/2015/11/PullRequestList-1024x631.png) as expected...and no comments in the PR itself which was great. Except we then started to notice the multiple jobs. I have already filed an issue (https://issues.jenkins-ci.org/browse/JENKINS-32097) , feel free to upvote it

          Pierre Jakobsen added a comment - Afraid I cannot help with any logs - I just upgraded the plugin from within jenkins, restarted jenkins and added values for the two new variables. Then we got the new build status updated for the various PRs in bitbucket (as seen here http://blog.bitbucket.org/files/2015/11/PullRequestList-1024x631.png ) as expected...and no comments in the PR itself which was great. Except we then started to notice the multiple jobs. I have already filed an issue ( https://issues.jenkins-ci.org/browse/JENKINS-32097 ) , feel free to upvote it

          Nenad Miksa added a comment -

          I've upvoted your issue. I haven't seen any new variables after updating to 1.4.8. I still have (as I had): 'Cron', 'Bitbucket BasicAuth Username', 'Bitbucket BasicAuth Password', 'RepositoryOwner', 'RepositoryName', 'CI Identifier', 'CI Name', 'CI Skip Phrases', 'Rebuild if destination branch changes?', 'Approve if build success?'. Am I not seeing something?

          Nenad Miksa added a comment - I've upvoted your issue. I haven't seen any new variables after updating to 1.4.8. I still have (as I had): 'Cron', 'Bitbucket BasicAuth Username', 'Bitbucket BasicAuth Password', 'RepositoryOwner', 'RepositoryName', 'CI Identifier', 'CI Name', 'CI Skip Phrases', 'Rebuild if destination branch changes?', 'Approve if build success?'. Am I not seeing something?

          Nenad Miksa added a comment -

          OK, I've found new variables in global configuration pane.

          Nenad Miksa added a comment - OK, I've found new variables in global configuration pane.

          Rubens M added a comment -

          I create this request before the release of version 1.4.8, but yes, it is (sort of) implemented by the latest release,
          Another problem in this released version is the option 'Rebuild if destination branch changes' doesnt work anymore.

          Rubens M added a comment - I create this request before the release of version 1.4.8, but yes, it is (sort of) implemented by the latest release, Another problem in this released version is the option 'Rebuild if destination branch changes' doesnt work anymore.

          Nenad Miksa added a comment -

          It appears that global settings I found were for Bitbucket Approve plugin, not for Bitbucket pull request builder plugin. I still do not get Bitbucket statuses on build start. From log I can see that POST was sent, but in log I cannot see Bitbucket's response. If I try to reproduce the call with Postman, I get 403 "CSRF verification failed.". BitBucket API suggests using OAuth, and settings for plugin allow entering only BasicAuth username and password (if user has two-step authentication enabled, then plugin does not work at all). Is there a way to see what was returned from server? There are no exceptions in the log.

          Nenad Miksa added a comment - It appears that global settings I found were for Bitbucket Approve plugin, not for Bitbucket pull request builder plugin. I still do not get Bitbucket statuses on build start. From log I can see that POST was sent, but in log I cannot see Bitbucket's response. If I try to reproduce the call with Postman, I get 403 "CSRF verification failed.". BitBucket API suggests using OAuth, and settings for plugin allow entering only BasicAuth username and password (if user has two-step authentication enabled, then plugin does not work at all). Is there a way to see what was returned from server? There are no exceptions in the log.

          rmatrono I figured so - and would thus have expected the developer to close the issue when 1.4.8 was released. I was not aware that the "Rebuild if.." feature broke - initially we used it but our master branch was/is very active (is a medium sized project but with many committers and concurrent active branches and small PRs) so we got too many PR-build jobs for our jenkins to handle. So it was disabled again...

          Pierre Jakobsen added a comment - rmatrono I figured so - and would thus have expected the developer to close the issue when 1.4.8 was released. I was not aware that the "Rebuild if.." feature broke - initially we used it but our master branch was/is very active (is a medium sized project but with many committers and concurrent active branches and small PRs) so we got too many PR-build jobs for our jenkins to handle. So it was disabled again...

          dodoent I just upgraded the plugin from within the "Manage jenkins" pages and then restarted. When setting up my PR-build job, I have added a specific (read-only) bitbucket account to our repository and then use this with basic auth (user+pw) to access the repo. I recall seeing another improvement issue for adding support for the jenkins credentials plugin or something, which would be nice - but for now this setup works. Wrt to the new plugin parameters, these are accessible from the "configure job" section in jenkins where you specify "build triggers" - in my case they just showed up.

          Pierre Jakobsen added a comment - dodoent I just upgraded the plugin from within the "Manage jenkins" pages and then restarted. When setting up my PR-build job, I have added a specific (read-only) bitbucket account to our repository and then use this with basic auth (user+pw) to access the repo. I recall seeing another improvement issue for adding support for the jenkins credentials plugin or something, which would be nice - but for now this setup works. Wrt to the new plugin parameters, these are accessible from the "configure job" section in jenkins where you specify "build triggers" - in my case they just showed up.

          Just became aware of the issue list at https://github.com/nishio-dens/bitbucket-pullrequest-builder-plugin/issues - think that site is more actively monitored by developers, so moving my focus to there

          Pierre Jakobsen added a comment - Just became aware of the issue list at https://github.com/nishio-dens/bitbucket-pullrequest-builder-plugin/issues - think that site is more actively monitored by developers, so moving my focus to there

          Ernst de Haan added a comment -

          The originally reported issue (see the Description) was resolved; the build status is indeed updated on the Bitbucket PR.

          Therefore, marking as Resolved.

          Ernst de Haan added a comment - The originally reported issue (see the Description ) was resolved; the build status is indeed updated on the Bitbucket PR. Therefore, marking as Resolved .

            Unassigned Unassigned
            rmatrono Rubens M
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: