Make SonarQube Preview source branch configurable
Blackhex opened this issue · 4 comments
Please make source branch name in this file https://github.com/kiwicom/dockerfiles/blob/master/sonar-scanner/bin/preview#L10 configurable from outside, preferably with some environment variable so it can be changed outside GitLab CI template.
@Blackhex do you mean the target branch? If yes, we could use $CI_MERGE_REQUEST_TARGET_BRANCH
with a default value of master
🤔 (It will be introduced in GitLab as part of https://gitlab.com/gitlab-org/gitlab-ce/issues/23902)
If this variable can be somehow configured per pipeline / branch, then yes. This requests has two use cases:
- When master branch is not
master
. - When some sub-team is working on some bigger feature they have one main common branch and multiple personal sub-branches doing CR iteratively before the main branch CR.
@Blackhex you can override any of the default CI variables as far as I remember, so the image should now be appropriate for your use cases! Just try setting $CI_MERGE_REQUEST_TARGET_BRANCH
, we've pushed the new version already to the 3.2.0, 3.2, 3, and latest tags.
Also, both use cases should be covered without any overriding required once GitLab ships https://gitlab.com/gitlab-org/gitlab-ce/issues/23902
Thanks a lot for your issue report! We're really delighted to see people using and wanting to improve on our work 🙃
Thank you very much too and especially for the quick response.