- When running in GitLab CI SonarQube uses a mechanism of its
own to determine the “correct” branch name. - This is triggered when:
- property
sonar.branch.nameis empty or not given at all and - the environment variable
GITLAB_CIistrue.
- property
- Then SonarQube will set
sonar.branch.nametoCI_COMMIT_REF_NAME. - In the case of a
tagbuild in GitLab this unfortunately has the effect
that theversionis set on a branch calledCI_COMMIT_REF_NAMEbecause then
CI_COMMIT_REF_NAMEis identical toCI_COMMIT_TAG. - These branches are not kept in general so:
- the
versionis not visible on the “MAIN BRANCH” and at the same time - “new code measures” are reported wrongly as well as they are calculated as issues since the last version on the same branch.
- the