I'm looking to create a plugin to prevent analysis failing if the the coverage level is within X percent of the current quality gate value. I'm not too sure where to begin or how to approach solving this problem. I've looked at the Web API to attain the current quality gate values although I'm not sure if this is correct. The current setup uses SonarScanner for Jenkins.
Asked
Active
Viewed 42 times
0
-
i am not sure what the benefit of such a plugin is? what do you want to achieve what is your usecase, please share some examples – Simon Schrottner May 25 '20 at 10:34
-
The quality gate should allow the current quality gate to remain in place while providing leeway to prevent builds from failing if say they fall marginally out of the coverage criteria (79.8% where the gate is set at 80.0%). For example, if a build is detected as having 79.8% coverage with the coverage quality gate set to 80.0% and X set to 0.5%, then the build should be marked as passed since is falls in range. The current SQ implementation doesn't allow code to pass if coverage isn't met and this becomes an issue when the coverage of a build is just slightly out of the coverage criteria. – JAM May 25 '20 at 12:02
-
sounds for me like you want to adapt your quality gate percentage - what if somebody is below this threshhold by 0.51% - in the end it is the same thing as the quality gate as it is now. maybe you should rethink the quality gate, and maybe it is too strict. Coverage alone is not a good indicator anyway, maybe lowering the coverage and adding mutation tests would be more sufficient. – Simon Schrottner May 25 '20 at 20:07
-
You solve the problem by chamging the threshols in your SQ server to X % less than the current value to pass. You don't explain what you plan to do to identify those jobs that are above X but below the threshold. They are all pass. So you moved tbe goalposts. It's like being a little bit pregnant - not a thing. If X is "good enough to pass", then it's a pass. – Ian W May 26 '20 at 06:16