Sonarlint "ServerIssueKey" is different from what is on the server

5 views
Skip to first unread message

Paul Borgen

unread,
Jul 26, 2017, 3:40:49 PM7/26/17
to SonarLint
I am running sonarlint locally against a particular file that has been previous scanned by sonarscanner and is on the sonarqube server. I am then using the webservice api to to collect all the issues for the file. Sometimes I am seeing that the "ServerIssueKey" that is generated from the sonarlint scanner is different from what is on the server. I verified this by going to our sonarqube server and taking a look. 

Ideas: maybe the sonarlint scanner is getting a old "ServerIssueKey". We run sonarscanner from Jenkins every night. 

Note: The "ServerIssueKey" that is generated from the sonarlint scanner is a valid "ServerIssueKey". if I go here https://sonarqube.<ourserver>.com/issues/search#issues=<ServerIssueKey> it comes up. 

Background:
WebService to get all the issues for a particular file
https://sonarqube.<ourserver>.com/api/issues/search?"
   + "p=" + page +"&ps=" + pageSize + "&s=FILE_LINE&asc=true&additionalFields=_all&facets=types%2Cresolutions%2C"
   + "fileUuids&resolved=false&fileUuids=" + fileUuid;

- I am writing code directly against the sonarlint-core code base using the ConnectedSonarLintEngine.
- I have created a incremental scanner. It only scans files that have changed in a particular git branch. It then checks to see if any new issues are introduced. Because these ServerIssueKey's are different it makes it hard to see if a issue has been introduced or not.

I will end with dam this product is pretty darn good. The GUI UI is great and it is obvious a lot of thought has been put into this. I am currently leading up the sonarqube effort for my software group and I am looking forward to getting my hands dirty.

Thanks
Paul Borgen

Paul Borgen

unread,
Jul 26, 2017, 5:43:06 PM7/26/17
to SonarLint
I think I have the fix. I needed update the "bindings" below is the code I had to add.

try {
connectedSonarLintEngineImpl.checkIfModuleStorageNeedUpdate(serverConfiguration, propertiesFileReader.getProjectKey(), null);
} catch (GlobalUpdateRequiredException e) {
connectedSonarLintEngineImpl.updateModule(serverConfiguration, propertiesFileReader.getProjectKey(), null);
Reply all
Reply to author
Forward
0 new messages