Gate failing after upgrade

We just upgrade our SonarQube instance from version 7.9 to 8.9 LTS
We had a gate similar to Sonar Way that contained condition on new code only.

After the upgrade, the conditions are set to New code, which is correc, and there is no conditions on Overall Code.

Now, when we run an analysis on a PR we get the right decision (pass/fail), based on the conditions on the new code, which is fine

However, on a branch, it fails on some very old code, even if the new code in the branch is ok.
What I don`t understand is:

  • why was it passing in the older version and not in 8.9 ?
  • since there is no conditions on overall code, what conditions are applied to make the old code fail ?
  • Does this mean the conditions set on the New Code are also applied on the overall code, as well ?

Hi,

When you upgrade versions, especially when you go from LTS to LTS, you get changes in the rules. Rules are added, deprecated (sometimes removed, but rarely), and very often existing rules get smarter.

Specifically, that means that false positives are eliminated and so are false negatives. So more than likely that’s what happened. Generally such new issues are backdated when they’re raised on the first analysis after an upgrade. However, if the issue has secondary locations (locations that lead to or contribute to the issue) it’s going to get the date from the newest 2ndary location, which could put it in the new code period.

Could you take a look at some of these new/old issues and see if that makes sense in their context(s)?

 
Ann