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 208 forks source link

Is project still maintained ? #288

Open whatthefrog opened 4 years ago

whatthefrog commented 4 years ago

Last release was more than 2 years ago ?

Last commit about ~17 months ago, May 2019 ?

klafbang commented 3 years ago

I'm not the maintainer and cannot speak for them, but somebody else (also not me) made a fork at https://github.com/javamachr/sonar-gitlab-plugin which has been updated to handle Sonar 8.2. It's not been updated for a while either, but has been working for me so far and also survived the upgrade to 8.5 I did today.

idelin commented 3 years ago

I'm not the maintainer and cannot speak for them, but somebody else (also not me) made a fork at https://github.com/javamachr/sonar-gitlab-plugin which has been updated to handle Sonar 8.2. It's not been updated for a while either, but has been working for me so far and also survived the upgrade to 8.5 I did today.

🤩thanks

lucasoares commented 3 years ago

@klafbang can you share know how are you configuring it for sonar > 7.7?

Examples of gitlab MR page of how the plugin is handling it are also welcome!

Since the preview mode doesn't exists at Sonar > 7.7 I'm not sure on how the plugin would be configured using sonar.analysis.mode=preview

Thanks!

klafbang commented 3 years ago

Sure, nothing too much, really.

I'm using maven; just configure:

    <properties>
        <sonar.host.url>...</sonar.host.url>
        <sonar.login>...</sonar.login>
    </properties>
...
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.7.0.1746</version>
                </plugin>

From Gitlab CI, I launch with

    - mvn $MAVEN_CLI_OPTS install sonar:sonar -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME

(the split between properties and command line options are tailored for a shared parent project we use for several different actual projects)

In Sonar (8.5.1.38104 currently), configure Gitlab URL + Gitlab User Token. I've increased the timeout values and customized which issues to report, but everything else is default.

I'm not using it with MRs, but get comments on commits:

Screenshot 2021-02-01 at 19 03 35

Developers get a mail from Gitlab if the quality gate is violated. I've configured quality gate + an instance default custom ruleset in Sonar so all projects get same checks by default; some projects override various settings using the pom.

lucasoares commented 3 years ago

Thanks!!

My problem is exactly with discussions and MRs.

I use detached pipelines (only for merge requests) and I use the merge_request_discussion feature to start discussions instead of just comments.

Using the plugin the external job stage with quality gate result is being created in another pipeline and not on my detached. This is overwriting the pipeline shown in the MR.

The discussion also are not working. If I go to gitlab to reply them, the gitlab UI bugs and no text area is shown.

I'm looking into the plugin code to check what I can do to fix this.

EDIT:

Appears that the API doesn't support external job for detached pipelines :( Just created: https://gitlab.com/gitlab-org/gitlab/-/issues/300720

lucasoares commented 3 years ago

@javamachr could you open your fork to accept issues?

Let's take care of the project in your fork until the maintainer or its members see this issue.

I'd like to contribute =)

javamachr commented 3 years ago

@javamachr could you open your fork to accept issues?

I just enabled it - wasn't aware its disabled 🤦🏻‍♂️

mars-dlx commented 3 years ago

@lucasoares You can look on my fork. I also include some changes from https://github.com/javamachr/sonar-gitlab-plugin. My version for SonarQube < 7.9.x.

lucasoares commented 3 years ago

@Mar-Ser could you please provide PRs so we can use @javamachr fork instead? We already have few people there contributing with the plugin.

mars-dlx commented 3 years ago

@lucasoares

So, I don't understand, what kind PRs you want from me. My fork is almost the same. Just for the older SQ version.