Open sandeepyelukati opened 5 years ago
Hi Sandeep,
We are working with contributors to merge their pull request to bring the plugin up-to-date. In the mean time, will be great to know about your organisation, team and perforce-sonar users, you can email me at wbasu@perforce.com
Best, Wrishi
any updates?
Hi, after i did not receive any updates here, i tried identifying the problem by myself. After some research i found the reason why the plugin is not working.
The PerforceBlameCommand::createFileSpec currently calls inputFile.filename()
private static IFileSpec createFileSpec(@Nonnull InputFile inputFile) { IFileSpec fileSpec = new FileSpec(PerforceExecutor.encodeWildcards(inputFile.filename())); fileSpec.setEndRevision(IFileSpec.HAVE_REVISION); return fileSpec; }
this only return the name of the current file, which in my test setup creates the following errors: Abc.java#have - protected - namespace - access denied.
Missing blame informations for the following files:
After changing this to:
private static IFileSpec createFileSpec(@Nonnull InputFile inputFile) { IFileSpec fileSpec = new FileSpec(PerforceExecutor.encodeWildcards(new File(inputFile.uri()).getAbsolutePath())); fileSpec.setEndRevision(IFileSpec.HAVE_REVISION); return fileSpec; }
The plugin is able to get the neccessary information from Perforce server.
@wbasupm Are you able to fix this issue?
Beside of this issue, the plugin currently uses many very old version of external dependencies in the pom.xml. I tried updating all of them to the newest version, which was possible. The primary dependecy sonar-plugin-api must be valid to the uses SonarQube Server, which for us is 7.9.1.
Finally there seems to be a bug in collecting the BlameLine data. When comparing Annotation data in IntelliJ with data of the plugin, values are different. The reason for this issue, i was not able to identify yet.
I now also identified the reason of the difference between IntelliJ and the plugin. It is in PerforceBlameCommand::getFileAnnotationOptions
private static GetFileAnnotationsOptions getFileAnnotationOptions() { GetFileAnnotationsOptions options = new GetFileAnnotationsOptions(); options.setUseChangeNumbers(true); options.setFollowBranches(true); // when commenting this line out, i get the same result than IntelliJ does options.setIgnoreWhitespaceChanges(true); return options; }
If this is a bug or a feature i don't know. For us its a bug.
@pschwarzer-tt any chance you're able to put those fixes into a pull request? I am beginning to use SonarQube for a perforce managed code base and am interested in bringing this plugin into compatibility with the latest release.
@adenisonafifi Hi, it seems it is not possible to create a pull request, sorry. I can send you the code / project with my changes if you tell me where i can send it to. Currently we have the plugin running with SonarQube 8.4.2.
@pschwarzer-tt it should be possible to fork this repository and make a pull request from your fork into this repository. @wbasupm sounds like they have taken responsibility for merging pull requests from the community. Alternatively you can send me the code diff directly and I can try to steward it through.
@adenisonafifi You can find my changes here: /pschwarzer-tt/sonar-scm-perforce
@wbasupm Hi, I'm curious if this repository is still maintained? I am in the process of testing @pschwarzer-tt's changes. I can put together a pull request with them if you're still maintaining this repo. It would be great to enable any other perforce + sonarqube users to have a blame tool.
Why do I have to sit here and manually rebuild this, download java, make the changes and upload it for it to work? Why don't they maintain this??
@adenisonafifi You can find my changes here: /pschwarzer-tt/sonar-scm-perforce
Do you have a premade jar file? I would like to not have to download java, and create one myself lol
Seems to be, that this is no longer maintained. We tried to bring it back on our own.
Seems to be, that this is no longer maintained. We tried to bring it back on our own.
If you have the chance, would you mind making a precompiled version of your changes?
The change was in https://github.com/perforce/sonar-scm-perforce/pull/22/files where
IFileSpec fileSpec = new FileSpec(PerforceExecutor.encodeWildcards(inputFile.absolutePath()));
was changed to
IFileSpec fileSpec = new FileSpec(PerforceExecutor.encodeWildcards(inputFile.filename()));
It was changed by @SameOldSong and merged by @wbasupm
Maybe @SameOldSong is still around to explain why this needed to be changed?
Tentative fix was submitted and released here: https://github.com/eidosmontreal/sonar-scm-perforce/releases/tag/7.3-sqex
Hello Maintainer,
Available plugin is not working with 7.9.1 LTS version.. Can you pls let me know how to make it up and running. Error Msg # SonarQube App is unable to start due to incompartable of plugin version..
Kindly help me out..
Regards, Sandeep.