-
Bug
-
Resolution: Not A Defect
-
Major
-
Jenkins version 2.150.2, Kubernetes plugin 1.14.3, Bitbucket Branch Source Plugin 2.4.0, Git client plugin 2.7.6
I am running a Multibranch Pipeline with the Bitbucket branch source plugin (my configuration is in the screenshot below). When creating a Pull Request in Bitbucket against the 'qa' branch the Declarative SCM Checkout stage does not do anything:
[Pipeline] { [Pipeline] stage [Pipeline] { (Declarative: Checkout SCM) [Pipeline] checkout [Pipeline] }
When creating a Pull Request in Bitbucket against the 'uat' branch or the 'master' branch the pipeline everything checkouts out fine:
[Pipeline] { [Pipeline] stage [Pipeline] { (Declarative: Checkout SCM) [Pipeline] checkoutusing credential jenkins-bitbucket Cloning the remote Git repository Cloning with configured refspecs honoured and without tagsCloning repository https://bitbucket.org/myproject/myrepo.git > git init /home/jenkins/workspace/myrepo_PR-24 # timeout=10 Fetching upstream changes from https://bitbucket.org/myproject/myrepo.git > git --version # timeout=10 using GIT_ASKPASS to set credentials Jenkins credentials for bitbucket cloud > git fetch --no-tags --progress https://bitbucket.org/myproject/myrepo.git +refs/heads/jenkins:refs/remotes/origin/PR-24 > git config remote.origin.url https://bitbucket.org/myproject/myrepo.git # timeout=10 Fetching without tagsChecking out Revision dbf6c37eb9db62d794720bdddf3cfc740f0d5c0e (PR-24) > git config --add remote.origin.fetch +refs/heads/jenkins:refs/remotes/origin/PR-24 # timeout=10 > git config remote.origin.url https://bitbucket.org/myproject/myrepo.git # timeout=10 Fetching upstream changes from https://bitbucket.org/myproject/myrepo.git using GIT_ASKPASS to set credentials Jenkins credentials for bitbucket cloud > git fetch --no-tags --progress https://bitbucket.org/myproject/myrepo.git +refs/heads/jenkins:refs/remotes/origin/PR-24 > git config core.sparsecheckout # timeout=10 > git checkout -f dbf6c37eb9db62d794720bdddf3cfc740f0d5c0eCommit message: "Jenkinsfile for multibranch pipeline" First time build. Skipping changelog. [Pipeline] }
Is there any way I can get verbose logging on the Declarative SCM Checkout stage? I have tried recreating the pipeline from scratch with no luck. I've also reset my 'qa' branch to my 'uat' branch in case there was any branch corruption.
I am running Jenkins on Kubernetes using the Kubernetes plugin to spin up agents where these jobs are run.
You might try copying the multibranch Pipeline job that you're using and then redefine the source code provider from Bitbucket Cloud or Bitbucket Server to Git. That may provide some additional diagnostics. You won't want to run with that long term, since there are additional features in the Bitbucket implementation that you will want, but it may help diagnose the issue with that branch.
You might also try modifying the Jenkinsfile on the problem branch to skip the default checkout and then perform a git checkout with the checkout scm step. That may provide further diagnostics as well.
You might check that the job definition is not configured to ignore the qa branch (with a wildcard exclusion of that name).
You might check that the Jenkinsfile is not stored in the repository with unexpected case (for example, was it written from a Windows machine or a Mac with the name "jenkinsfile" instead of "Jenkinsfile").
You might review the online help for the branch name exclusion field, just in case the values in that field need to be separated by something other than spaces or need to be expressed as a regular expression rather than a list of space separated matching strings.