Christoph Forster Christoph Forster - 8 months ago 60
Git Question

Jenkins "checkout" Step Repository Browser Link wrong

I need to use the "checkout" step in my Jenkins Pipeline to generate the Repository Browser Links for my changeset to point to Bitbucket (hosted).

The Source looks like

stage('Checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
userRemoteConfigs: [[url: 'ssh://git@myhostedbitbucket/myProject/myRepo.git']],
browser: [$class: 'BitbucketWeb', repoUrl: 'https://myhostedbitbucket/projects/myProject/repos/myRepo']]

There are 3 different kind of Links generated, 2 of them work:

If I manually replace the "history" in the Link with "browse" the Link works as expected.

I also tried to verify, if the Problem only occurs on a hosted Bitbucket but also does not have such a "history" Link.

Is this a bug within the Jenkins Checkout step or a misconfiguration on my side?

I have the following Setup:

  • Jenkins 2.32

  • Git Plugin 3.0.0

  • Pipeline Plugin 2.4 (Pipeline SCM Plugin 2.3)

  • Atlassian Bitbucket v4.9.1


The Problem seems to be, that "BitbucketWeb" works as expected for but not for on premise Bitbucket Instances.

The Difference is, that has a "history" Page, where you can find an overview of the history of a file.

This Page does not exist at on premise Bitbucket Servers. There you only have an overview Page for the source-File with a dropdown to show and select different Changesets ("history")