gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
713 stars 207 forks source link

Fix API usage for sonar 7.7 #226

Open jblamotte opened 5 years ago

jblamotte commented 5 years ago

Fix sonar-gitlab-plugin for sonar 7.7 with the new API. (only tested with publish mode & quality gate on sonar developer edition)

unitysipu commented 5 years ago

@jblamotte for convenience, do you happen to have a pre-compiled plugin available you could share for this fix? Thanks!

jblamotte commented 5 years ago

You can find it here : https://github.com/jblamotte/sonar-gitlab-plugin/releases/tag/4.1.0-SNAPSHOT Just a snapshot, as Gabriel will probably merge it. (or just git clone repo && git checkout feature-request && mvn clean install && cp the-jar.jar)

unitysipu commented 5 years ago

Thank you,

I'm slightly concerned about the future of this plugin and merges based on what @gabrie-allaigre mentioned here https://github.com/gabrie-allaigre/sonar-gitlab-plugin/issues/222

I hope the community is able to pick up the effort from him.

gabrie-allaigre commented 5 years ago

Hi, Thanks. It's version work only with sonarqube 7.7 ?

jblamotte commented 5 years ago

Only tested on 7.7 on my side.

unitysipu commented 5 years ago

With preliminary testing It looks like the PR decorations (the untested preview mode) doesn't work with this change, which means some more work is needed. I will doublecheck on my side.

unitysipu commented 5 years ago

Ok, based on this https://docs.sonarqube.org/latest/setup/upgrade-notes/ it seems sonarsource has finally deprecated the sonar.analysis.mode switch on 7.7, so now builds fail

"14:42:43.337 INFO: ------------------------------------------------------------------------ 14:42:43.337 ERROR: Error during SonarQube Scanner execution 14:42:43.338 ERROR: The preview mode, along with the 'sonar.analysis.mode' parameter, is no more supported. You should stop using this parameter."

Without this parameter the scan appears to work. Is there some alternate way to trigger PR analysis or is it game over for that feature?

Also this means that the issue is not the plugin changes in this PR.

jblamotte commented 5 years ago

It looks like it's game over for preview mode.... It's indeed a convenient way, to use sonar community edition for feature team with gitflow. (We were using it like that until we need a real quality gate).

unitysipu commented 5 years ago

Do you know if the decoration parameters that the commercial Sonarqube github PR decorations use are in any way compatible with gitlab plugin? (i.e. are those server features or plugin specific)?

andrzejwp commented 5 years ago

Hi @jblamotte, is there anything I could do to help with moving this forward?

dmpe commented 5 years ago

Bump

nikolaikopernik commented 4 years ago

Up. Any chances to get it worked?

unitysipu commented 4 years ago

https://github.com/gabrie-allaigre/sonar-gitlab-plugin/pull/253 <- i think this supersedes this pull request. 100% working on 7.9.1.