Bitbucket branch source - WARN: Could not find ref: XXX in refs/heads or refs/remotes/origin

8 views
Skip to first unread message

Dan Tran

unread,
Sep 2, 2019, 5:45:30 PM9/2/19
to Jenkins Users
Hi 

I am looking for suggestion on how to configure BB branch source plugin to fix the sonar/git issue discussed at  https://community.sonarsource.com/t/error-warn-could-not-find-ref-develop-in-refs-heads-or-refs-remotes-origin-after-updating-to-7-6/6420


Very much appreciated

-D

Mark Waite

unread,
Sep 2, 2019, 6:39:53 PM9/2/19
to Jenkins Users
The branch sources (GitHub, Bitbucket, Gitea, and Gitlab) may configure the checkout of a specific workspace to include only the changes for the branch which that workspace is using.  That is a very good default choice because it can reduce the data transfer from the git server to the workspace and can reduce the disc use and clone time for the job.  It appears that your use case may need to use changes from another branch which is related to the branch the workspace is using.

If the build process (Sonar diff computation, etc.) needs more than the changes for the specific branch that you're using, you may need to extend the Jenkins Pipeline definition for that job to use a custom refspec to include additional branches in the workspace.  The pipeline command 'checkout' allows custom refspecs to be defined and used.  You will likely also need to use the clone option "Honor refspec on initial checkout" in order to assure that the initial clone also uses the custom refspec definition.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/50e75680-a968-41b7-b483-a71e01848ca2%40googlegroups.com.


--
Thanks!
Mark Waite
Reply all
Reply to author
Forward
0 new messages