Code reverting: false negative result because it lacked test coverage

We had an incident caused by a trivial bug (more likely a typo) after service release. Sonar found no problems with this MR and gave a false positive result.

But then we made a revert (absolutely honest, character-by-character on the previous master), to which sonar returned a false negative because it lacked test coverage for the new code. Deleting the brunch in sonar and restarting the Job didn’t help. We were forced to deploy revert ASAP with allow_failure: true

How to handle such situations? How to configure sonarqube properly?

Hey there.

I’m not sure what your question is.

Is it that you want to understand why SonarQube didn’t report the bug in the first place?