Sonarlint Incremental Scanner - Cacheing question

22 views
Skip to first unread message

Paul Borgen

unread,
Oct 26, 2017, 11:27:35 AM10/26/17
to SonarLint
I have created a sonar lint incremental scanner. I did this by building on top of the sonarlint-core. This runs as part of our jenkins build on all our branches. . 

Goal: Stop new sonarqube issues from getting into out master branch.

Steps:
- Find the files that have changed in git between the branch and the master branch. 
- Call the sonarqube server web api for every file that has changed. We do this to get the list of issues on the sonarqube server for the files that have changed
- Run the sonarlint scanner locally on the files that have changed. Get the list of issues
- Compare the issues on the server with the issues found locally. See if any issues have been introduced.

Comment:
Product is great. This increment scanner has been working pretty well. Have had some issues with updating the cache but other then that has been going well.

Questions:
- When do we need to update the "Global Cache"?
  - Currently we update this when org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.getState() is not equal to State.UPDATED
  - This is a expensive task and takes a long time
  - We do this but calling the update method on org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl
- When do we update the "Module" cache/storage?
  - We currently do this evey time the incremental scanner is run.
  - this is done by the ModuleStorageUpdateExecutor
- We are storing the cache in the user home directory. We also have many jenkins jobs running at the same time on our jenkins build agents/slaves. So the cache could be accessed concurrently. Any suggestions? 
  - Currently I have a lock that prevents multi incremental scanners running at the same time for a given jenkins build agent/slave. Any suggestions? 


duarte.meneses

unread,
Oct 27, 2017, 4:02:02 AM10/27/17
to SonarLint
Hi Paul,

Sonarlint-core was not designed to be used in that way. It was designed for integration with the IDEs, and it might evolve fast (it's not stable) with that goal in mind. Note that we don't support anymore SonarLint CLI. 
That being said, this is OSS and of course you can develop want you want with it, but we are unable to help with it.
Reply all
Reply to author
Forward
0 new messages