History issues auto closed if set the inclusions

  • SonarQube7.7, Scanner4.0
    When I set the config ‘inclusions’ some java files, the issues for other files that scan before will auto closed by sonar even if these issues is not fixed. How can I keep these issues show in the problem tab?

Hi,

In fact this is working as designed. When you set inclusions, you say “only analyze this subset of source files”. By including some files you are de facto excluding all the others. Issues on files that are no longer included in analysis are automatically closed in the next analysis.

Generally, setting inclusions is almost never needed. (See the docs for a fuller discussion.) What was your original goal?

 

Thanks for you reply. I just want to keep the issues but never scan repeatedly, because do a whole scan is slowly. So we only scan whole project once, then scan the changed files every time.

Hi,

It sounds like you’re looking for Branch and PR analysis. Note that they’re both commercial features, available in Developer Edition and above.

 
Ann

OK, I will try the Developer Edition. I wonder when set a branch if the edition analyze the changed files beyond git?

Hi,

It’s not clear to me what you’re asking. In branch analysis, the entire project is analyzed but only issues that touch lines changed in the underlying branch are reported in the PR analysis.

 
HTH,
Ann

I just want to know the sonar-scanner do scan the whole project or just some commit files. It seems in branch analysis also do scan all files, am I right?

Hi,

Yes, all files are analyzed for all branches and PRs.

 
Ann

Did PR support gitlab now? Gitlab is using in my company.

How do sonar ‘branchChangedFiles’? I have done a test, it seems not same with ‘git diff’.

Hi,

We don’t yet set the GitLab build status, that’s coming in 8.1 (MMF-1791), nor do we decorate on the GitLab side.

For your other followup question, please open a new thread.

 
Ann