Jenkins CI with multiproject generates incorrect build URL
When multiproject is enabled on both GitLab Jenkins CI service and Jenkins GitLab Hook plugin the build is properly triggered. However, the build URL generated in the merge request is incorrect.
Given a GitLab Jenkins service URL of http://jenkins/job/test1
, a GitLab project called test-project
and branch ref of feature/ci_test_4
:
GitLab will generate a URL of http://jenkins/job/test1/_feature/ci_test_4/scm/bySHA1/7c29b98573a9086737795ba8021f31da6b966ace
The correct URL is http://jenkins/job/test-project_feature_ci_test_5/scm/bySHA1/7c29b98573a9086737795ba8021f31da6b966ace
.
The problem is in https://gitlab.com/gitlab-org/gitlab-ee/blob/master/app/models/project_services/jenkins_service.rb#L69
When this is fixed, documentation also needs updated. The configuration of the service and Jenkins GitLab Hook plugin are very specific when using multiproject. In Jenkins configuration set the following, but nothing else or it won't work.