New Code with Previous version ignore failed builds

Version 9.3.0.51899
For all our projects we use Previous version for New Code and we have issues with passing build after failed build.
Description: we run sonar and didn’t pass quality gate for example with long function body, and if somebody commits code without any changes in problem file/class, the build will pass without any errors.
Therefore sonar should not ignore failed builds

Hi,

What value are you passing in for sonar.projectVersion? Is it your build number? (Or does it include your build number?) If so, you’re resetting version with every build, so it’s natural that the New Code Period is reset with each build and what previously failed the Quality Gate passes with a new build.

Does that make sense?

 
Ann

Hello,
I found that under the hood plugin set our custom version with git commit to sonar.projectVersion.
Therefore it will be correct to set sonar.projectVersion to the last success build. And what about PR’s, do they require any special options ?

Hi,

For PRs this shouldn’t be an issue.

Would you mind sharing what plugin was doing this? If it’s something we did, I want to get it fixed.

 
Thx!
Ann

We use open sourced SonarQube plugin: https://sonar-scala.com/

1 Like