Hi,
this is related to
and
Happy to see Sonarqube 8.4.1 with the changes of https://jira.sonarsource.com/browse/MMF-1994
Unfortunately after the first tests, i have to say it’s only half the job done and still not really usable for legacy projects without PR workflows.
Our generic Jenkins pipelines currently running with Sonarqube 7.9.1 simply use the
Jenkins $BRANCH_NAME
as sonar.branch.name
with the default sonar.branch.target = master
and only new conditions in quality gate for legacy projects.
If there is only one new issue on the branch the build fails with quality gate status red.
To achieve the same behaviour with Sonarqube 8.4.1 i need to have a project setting that sets
the main branch as reference for ALL branches.
If using
it works great for all branches, but
this means no more issues on main branch because
As the web api api/new_code_periods/set
can only be used after the branch exists, i see no solution.
In fact you need an useless initial analysis creating the branch to be able to set the main
branch as reference. After that a second analysis of the branch shows the issues as expected.
Suggestion => if the project setting would work without affecting the main branch also it would be OK to go with the project setting.
Did i miss anything, is there a solution | workaround ?
If there would only be one analysis at a time, i could change the new code project setting via web api,
$BRANCH_NAME == ‘master’ ? set previous_version : set reference branch master
But there are parallel builds and analysis of different branches of the same project.
Gilbert