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

PR builds don't work on Bitbucket Server Integration

      Builds do not work on pull requests for multibranch pipeline builds.

      Job configuration related to the Bitbucket Server Integration plugin:
      SSH clone
      Discovering both branches and pull requests
      Shallow clone
      Bitbucket webhook trigger (all pushes and pull request opened or source branch updated)

      The build is triggered for the PR, but fails to complete.

      Relevant logs:

      > git fetch --no-tags --force --progress --prune --depth=2 -- ssh://git@<BITBUCKET_REPO> +refs/heads/*:refs/remotes/origin/* +refs/pull-requests/626/from:refs/remotes/origin/PR-626 # timeout=10
      > git rev-parse origin/PR-626^{commit} # timeout=10
      > git rev-parse origin/master^{commit} # timeout=10
      > git config core.sparsecheckout # timeout=10
      > git checkout -f origin/master # timeout=10
      ERROR: Checkout failed
      hudson.plugins.git.GitException: Command "git checkout -b ** origin/master" returned status code 128:
      stdout:
      stderr: fatal: '**' is not a valid branch name
      
      ......
      ......
      ......
      
      Caused: hudson.plugins.git.GitException: Could not checkout ** with start point origin/master
      
      ......
      ......
      ......
      
      ERROR: java.io.IOException: hudson.plugins.git.GitException: Could not checkout ** with start point origin/master
      

      Builds work on branches just fine, but not on PRs.

          [JENKINS-74799] PR builds don't work on Bitbucket Server Integration

          Hello scarlett_fs 
          Could you share your build configuration? In particular Any changes you've made over the "default" provided when you set up a build. I see you've enabled PR discovery, have you configured a ref-spec or enabled anything else?

          Daniel Kjellin added a comment - Hello scarlett_fs   Could you share your build configuration? In particular Any changes you've made over the "default" provided when you set up a build. I see you've enabled PR discovery, have you configured a ref-spec or enabled anything else?

          Scarlett added a comment -

          Discover: Branches and pull requests

          Advanced clone behaviors:
          Don't fetch tags
          Don't honor refspec on initial clone
          Shallow clone with shallow clone depth 2
          Clean after and before checkout
          Prune stale remote-tracking branches

          Scarlett added a comment - Discover: Branches and pull requests Advanced clone behaviors: Don't fetch tags Don't honor refspec on initial clone Shallow clone with shallow clone depth 2 Clean after and before checkout Prune stale remote-tracking branches

            Unassigned Unassigned
            scarlett_fs Scarlett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: