After upgrade from 7.7 to 8.8: issues closed in feature branch need to be closed again in main branch

  • SonarQube 8.8 Developer Edition, recently upgraded from 7.7 Developer Edition.
  • SonarScanner for Maven (mvn sonar:sonar) running with JDK 11
  • Java 8 projects built using JDK8. So mvn install runs with JDK8 and mvn sonar:sonar runs with JDK11.
  • Jenkins 2.277.3
  • Bitbucket Branch Source Plugin 2.9.8

This is how we work with branches:

  • Release branch (master), updated only on quarterly releases.
  • Mainline development branch (develop), which (should) always produce stable -SNAPSHOT builds.
  • Short living feature branches, which are code reviewed in Bitbucket Server or Upsource (2 different teams each have their own code review tools). After an “all green” (code review + build status OK + all SonarQube issues resolved or closed), the feature branch is merged to develop (git merge --ff-only, to get a linear git history) by a dedicated Jenkins job that does several checks before merging.
  • We do not use Pull Requests.

In SonarQube 7.7

  • A feature branch is red because of SonarQube issues.
  • We decide to close certain issues in a feature branch as Won’t Fix or False Positive.
  • The feature branch is green.
  • The feature branch is merged in develop.
  • develop is green.
  • We are happy! :slight_smile:

In SonarQube 8.8

  • A feature branch is red because of SonarQube issues.
  • We decide to close certain issues in a feature branch as Won’t Fix or False Positive.
  • The feature branch is green.
  • The feature branch is merged in develop.
  • develop is red. The issues that were already closed in the feature branch, are back in the develop branch.
  • We are sad! :frowning:

How do we get the functionality back we had in 7.7, so that we don’t have to close the same issues twice?

Hi,

By the time you get to 8.8 there are no more “feature branches” there are only long lived branches, and they don’t have the same sort of relationships short-lived branches did to long-lived branches. If you use PR analysis you will get the closed-in-main behavior you’re looking for.

 
HTH,
Ann