• 3.0.0

      Include support to BitBucket Pull Request events in plugin

          [JENKINS-60342] Include support to BitBucket Pull Request

          Sven added a comment -

          I'm a little confused here.

          Integrating Bitbucket Server with Jenkins to see Build Information worked fine until I found this thread when searching for a way to use PR values (namely the ID and destination branch) in a Jenkins Job.

          When looking at the Atlassian Confluence, I find this paragraph:

          On the Pull request page you can see builds information in two locations. You can see the latest build status in the Overview tab and builds information for each commit in the pull request Builds tab.

          So, what is actually possible with this plugin? The documentation is kinda sparse.

          Sven added a comment - I'm a little confused here. Integrating Bitbucket Server with Jenkins to see Build Information worked fine until I found this thread when searching for a way to use PR values (namely the ID and destination branch) in a Jenkins Job. When looking at the Atlassian Confluence, I find this paragraph: On the Pull request page you can see builds information in two locations. You can see the latest build status in the Overview tab and builds information for each commit in the pull request Builds tab. So, what is actually possible with this plugin? The documentation is kinda sparse.

          Kalle Niemitalo added a comment - - edited

          stifm, in the Bitbucket Server REST APIs, a build status attaches to a commit ID; there is no way to specify which pull request was built. If you view a pull request in the Bitbucket Server user interface, and the latest commit in the source branch has a build status attached to it, then Bitbucket Server displays that build status in the Overview tab too. It does so even if the build was not caused by the pull request at all; the build status may have been reported before the source branch and the pull request were created.

          (The Bitbucket Server REST APIs have two endpoints for reporting a build status. In addition to the commit ID, the newer endpoint also takes the project and the repository as parameters; the older one doesn't. Neither of them takes a pull request ID as a parameter.)

          Therefore, I don't think this JENKINS-60342 is about changing how Bitbucket Server Integration reports build statuses to Bitbucket Server. Instead, it may cover the following features, which the Bitbucket Server Integration plugin does not support yet:

          • Generating a Jenkins job for each pull request, in a Multibranch Pipeline project.
          • Building the source branch of a pull request and providing some properties of the pull request to a pipeline script.
          • Building the result of merging a pull request, before the pull request is actually merged in Bitbucket Server.

          Kalle Niemitalo added a comment - - edited stifm , in the Bitbucket Server REST APIs, a build status attaches to a commit ID; there is no way to specify which pull request was built. If you view a pull request in the Bitbucket Server user interface, and the latest commit in the source branch has a build status attached to it, then Bitbucket Server displays that build status in the Overview tab too. It does so even if the build was not caused by the pull request at all; the build status may have been reported before the source branch and the pull request were created. (The Bitbucket Server REST APIs have two endpoints for reporting a build status. In addition to the commit ID, the newer endpoint also takes the project and the repository as parameters; the older one doesn't. Neither of them takes a pull request ID as a parameter.) Therefore, I don't think this JENKINS-60342 is about changing how Bitbucket Server Integration reports build statuses to Bitbucket Server. Instead, it may cover the following features, which the Bitbucket Server Integration plugin does not support yet: Generating a Jenkins job for each pull request, in a Multibranch Pipeline project. Building the source branch of a pull request and providing some properties of the pull request to a pipeline script. Building the result of merging a pull request, before the pull request is actually merged in Bitbucket Server.

          Michal added a comment -

          mhenschke_atlassian , we keep fingers crossed for you!

          Michal added a comment - mhenschke_atlassian , we keep fingers crossed for you!

          Hi all,
          We have finally released support for pull request triggers! Thank you all for your patience and feedback over this process.
          We know that the feature will not satisfy all use cases but we wanted to release a solution, as this blocks adoption of the plugin for many If you encounter any limitations or want additional support from this feature, please feel free to raise a new ticket with your request.

          Thanks,
          Martin

          Martin Henschke added a comment - Hi all, We have finally released support for pull request triggers! Thank you all for your patience and feedback over this process. We know that the feature will not satisfy all use cases but we wanted to release a solution, as this blocks adoption of the plugin for many If you encounter any limitations or want additional support from this feature, please feel free to raise a new ticket with your request. Thanks, Martin

          Am I missing something? How does the PR trigger help if the multibranch job itself does not support building PRs.
          What would you say, what would be the reason to use the bitbucket-server plugin over the bitbucket branch source plugin? Why don't you just drop this, take over the branch source plugin and save yourself a lot of time and effort. CloudBees anyways still is searching for a maintainer.

          Sorry but I do not understand the strategy behind.

          Joerg Schwaerzler added a comment - Am I missing something? How does the PR trigger help if the multibranch job itself does not support building PRs. What would you say, what would be the reason to use the bitbucket-server plugin over the bitbucket branch source plugin? Why don't you just drop this, take over the branch source plugin and save yourself a lot of time and effort. CloudBees anyways still is searching for a maintainer. Sorry but I do not understand the strategy behind.

          Bharat Jain added a comment -

          Thank you mhenschke_atlassian. The pull request trigger works as expected! 

          Bharat Jain added a comment - Thank you mhenschke_atlassian . The pull request trigger works as expected! 

          How does the PR trigger works? Can it capture PR merge events also? How can I get PR details - PR ID, PR URL, PR source and the target branch, PR latest commit, etc in the pipeline via this plugin? Could you please clarify? 

          Mohan Krishan Joshi added a comment - How does the PR trigger works? Can it capture PR merge events also? How can I get PR details - PR ID, PR URL, PR source and the target branch, PR latest commit, etc in the pipeline via this plugin? Could you please clarify? 

          mkjkec2005, I expect the followup JENKINS-66581 (and its duplicate JENKINS-66786) will provide those PR details to pipelines.

          Kalle Niemitalo added a comment - mkjkec2005 , I expect the followup JENKINS-66581 (and its duplicate JENKINS-66786 ) will provide those PR details to pipelines.

          There is also JENKINS-60340 for publishing event information like the actor who pushed to the source branch of the pull request.

          Kalle Niemitalo added a comment - There is also JENKINS-60340 for publishing event information like the actor who pushed to the source branch of the pull request.

          Zoupers added a comment - - edited

          Hello, everyone. I intend to introduce a feature called 'refspec' to this plugin, which is already a git plugin feature. This addition will enable us to fetch the pull request code and execute normally, potentially solving this issue.

          Zoupers added a comment - - edited Hello, everyone. I intend to introduce a feature called 'refspec' to this plugin, which is already a git plugin feature. This addition will enable us to fetch the pull request code and execute normally, potentially solving this issue.

            mhenschke_atlassian Martin Henschke
            javier_rodriguez Javier Rodríguez
            Votes:
            69 Vote for this issue
            Watchers:
            83 Start watching this issue

              Created:
              Updated:
              Resolved: