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:
- Revision Link - Points to https://myhostedbitbucket/projects/myProject/repos/myRepo/commits/1642a36f0626c40697c169afd6fb36ffee9ebb27 --> Works as expected
- Diff Link - Points to https://myhostedbitbucket/projects/myProject/repos/myRepo/commits/1642a36f0626c40697c169afd6fb36ffee9ebb27#chg-package/of/java/class.java --> works as expected
- Source Link - Points to https://myhostedbitbucket/projects/myProject/repos/myRepo/history/package/of/java/class.java --> ROUTES TO 404
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 bitbucket.org 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