• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins LTS v2.60.2, Bitbucket branch source plugin v2.2.2, Bitbucket Server v4.12.1

      Updated whole issue after new version of bitbucket-branch-source plugin

      We use the Bitbucket branch source plugin with a private Bitbucket server instance.
      We create the pull requests of our features branches quite early to see, if the pull request merge can be build based on our Bitbucket pull request merge strategy. So we want to build the pull-requests/*/merge refs.

       

      An example repo, where git ls-remote shows the following refs:
       9e4f3f544c1595d5fa23b0acc6480abe852f8494 HEAD
       dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 refs/heads/feature
       9e4f3f544c1595d5fa23b0acc6480abe852f8494 refs/heads/master
       dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 refs/pull-requests/1/from
       3219b86ea2902d63d983d849f2c95f288587401a refs/pull-requests/1/merge
      

      The different discover pull request from origin strategies for the pull-requests merge produces always a checkout of refs/pull-requests/1/from and perform a local merge.

      It seems not possible to checkout the merge ref directly. Is there a reason for this behavior and how can can this be configured? Because the local merge is done with the default merge settings and not with the one configured in Bitbucket.

       

          [JENKINS-38533] Checkout the pull request merge refs directly

          Carsten Kuhl created issue -
          James Dumay made changes -
          Component/s New: stash-pullrequest-builder-plugin [ 20028 ]
          Component/s Original: bitbucket-branch-source-plugin [ 21428 ]
          Carsten Kuhl made changes -
          Component/s New: bitbucket-branch-source-plugin [ 21428 ]
          Component/s Original: stash-pullrequest-builder-plugin [ 20028 ]
          Assignee Original: Antonio Muñiz [ amuniz ] New: Stephen Connolly [ stephenconnolly ]
          Description Original: We use Bitbucket Team/Project jobs for our Bitbucket Server Projects, where we use Jenkinsfiles for the build configurations.
          The build jobs for different branches works fine and as expected, but the pull requests does not.
          *For example*:
          Repository A with two branches (master/feature) and one pull request to merge feature into master.
          A git ls-remote shows the following refs:
          9e4f3f544c1595d5fa23b0acc6480abe852f8494 HEAD
          dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 refs/heads/feature
          9e4f3f544c1595d5fa23b0acc6480abe852f8494 refs/heads/master
          dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 refs/pull-requests/1/from
          3219b86ea2902d63d983d849f2c95f288587401a refs/pull-requests/1/merge

          The build jobs checkouts the following:
          master -> 9e4f3f544c1595d5fa23b0acc6480abe852f8494
          feature -> dac124e3e1a73d2a9a10d7a99ad79d733ada6db3
          pull-request-1 -> {color:red}dac124e3e1a73d2a9a10d7a99ad79d733ada6db3{color}

          In the jenkins log you see the correct pull request branch name:
          Checking out Revision dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 (PR-1)

          But in my opinion the PR jobs should checkout the merge result from the bitbucket (refs/pull-requests/1/merge) and not the revision of the feature. This is also reflected that the build result of the pull request in bitbucket server shows the result from both jobs (feature and pull-request)
          New: {{Updated whole issue after new version of bitbucket-branch-source plugin}}

          We use the Bitbucket branch source plugin with a private Bitbucket server instance.
          We create the pull requests of our features branches quite early to see, if the pull request merge can be build based on our Bitbucket pull request merge strategy. So we want to build the pull-requests/*/merge refs.

           
          {code:java}
          An example repo, where git ls-remote shows the following refs:
           9e4f3f544c1595d5fa23b0acc6480abe852f8494 HEAD
           dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 refs/heads/feature
           9e4f3f544c1595d5fa23b0acc6480abe852f8494 refs/heads/master
           dac124e3e1a73d2a9a10d7a99ad79d733ada6db3 refs/pull-requests/1/from
           3219b86ea2902d63d983d849f2c95f288587401a refs/pull-requests/1/merge
          {code}
          The different _discover pull request from origin_ strategies for the pull-requests merge produces always a checkout of refs/pull-requests/1/from and perform a local merge.

          It seems not possible to checkout the _merge_ ref directly. Is there a reason for this behavior and how can can this be configured? Because the local merge is done with the default merge settings and not with the one configured in Bitbucket.

           
          Environment Original: Jenkins LTS v2.7.4, Bitbucket branch source plugin v1.8, Bitbucket Server v4.9.1 New: Jenkins LTS v2.60.2, Bitbucket branch source plugin v2.2.2, Bitbucket Server v4.12.1
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Summary Original: Pull Requests checkout the wrong commit New: Checkout the pull request merge refs directly
          Stephen Connolly made changes -
          Attachment New: Screen Shot 2017-08-29 at 13.58.32.png [ 39527 ]
          Stephen Connolly made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ]
          Kalle Niemitalo made changes -
          Resolution New: Won't Do [ 10001 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Kalle Niemitalo made changes -
          Link New: This issue relates to JENKINS-61493 [ JENKINS-61493 ]
          Kalle Niemitalo made changes -
          Link New: This issue relates to JENKINS-48737 [ JENKINS-48737 ]
          Kalle Niemitalo made changes -
          Resolution Original: Won't Do [ 10001 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Kalle Niemitalo made changes -
          Released As New: https://github.com/jenkinsci/bitbucket-branch-source-plugin/releases/tag/cloudbees-bitbucket-branch-source-2.4.3
          Resolution New: Fixed [ 1 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
          Kalle Niemitalo made changes -
          Remote Link New: This issue links to "[BCLOUD-5814] [refify-pull-requests-by-making-them-a-ref] Repository refs for pull requests (Web Link)" [ 30440 ]

            Unassigned Unassigned
            bbio13 Carsten Kuhl
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: