We have an issue, scanning our java projects and their specific branches with sonarcloud correctly.
We’ve built a CI/CD pipeline with Jenkins. On Git we use GitFlow methodology, meaning
a longlived “develop” branch and shortlived “feature/x” branches for adding new stuff.
The version is set on build-time, containing the branchname and a buildnumber.
We have problems on the Quality-Gate, which is often or even allways Green on feature branches, but when merging back to develop it is getting Red.
We tried two things:
Quality-Gate set to check “new code”. (New Code set to Previous Version)
Result: New code wont be recognized correctly, because just a new build with no changes
will be green, but can be red when merging back to develop
Quality-Gate set to check “overall”. (New Code set to Previous Version)
Here the quality gate on a feature-branch to check for “overall” is completely ignored. (Is this a Bug?)
It will be allways green. And could be red when merging back to develop where the “overall” check seems to work.
The Quality-Gate should response a correct result in a feature-branch, because
the quality needs to be improved on this branch before merging back to develop.
This leads to very unsatisfied use of sonarcloud for a lot developers on our side.
Do you have any solution how to tackle this problem?
Or is there some Bug regarding “overall” quality checks on shortlived branches?