Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

ISSUES mode is somehow buggy, despite the fact it works most of the times #23

Open
MuyBien opened this issue Mar 1, 2018 · 12 comments
Open

Comments

@MuyBien
Copy link

MuyBien commented Mar 1, 2018

Hi!
Thanks for this image that save me a lot of time and effort!

But if I manage to connect the docker and the sonar server, it seems that it's analysing all the source files (10min) even in ISSUE mode.

Here is my gitlab-ci job

SonarQube:
  stage: quality
  image: ciricihq/gitlab-sonar-scanner
  variables:
    SONAR_URL: http://sonar.***.***
    SONAR_ANALYSIS_MODE: issues
  script:
  - gitlab-sonar-scanner
  allow_failure: true

and my sonar-project.properties

sonar.sources=.
sonar.java.binaries=*/build
sonar.sourceEncoding=ISO-8859-1

sonar.gitlab.project_id=git@gitlab.***.***:2003/*******/***.git

In the job log it says:
INFO: 18831/18831 source files have been analyzed

@elboletaire
Copy link
Contributor

Please tell us your sonarqube version. Also, ensure you have created your gitlab user for creating issues, and that it already has the minimum permissions to write comments.

You should also ensure that you properly set the api key of that user in the sonarqube gitlab configuration tab:

imatge

@MuyBien
Copy link
Author

MuyBien commented Mar 1, 2018

Hi @elboletaire !

SonarQube version : 6.3.0.19869
Yes I created a GitLab user @SonarQube with developer access to the project and I added his token with all rights enable. The account was not verified by the confirmation email 🤔 Maybe it is the problem? I didn't receive the confirmation mail :/

@gtrias
Copy link
Contributor

gtrias commented Mar 1, 2018

Hi @MuyBien ,

Can you paste all the gitlab-runner logs?

@elboletaire
Copy link
Contributor

BTW, I think you need to enable that account in order to be able to properly use it. At least the one we're using is enabled; you should give it a try.

@elboletaire
Copy link
Contributor

Closing due to inactivity.

@MuyBien
Copy link
Author

MuyBien commented Mar 7, 2018

Yeah sorry, I will try again later but we have a problem with the activate mail. By the way I can log in with the account and do everything so maybe it's activated. I will reopen this issue when I retry and have more information.

Thanks

@MuyBien
Copy link
Author

MuyBien commented Mar 28, 2018

So here I am again!

I tested to add a comment manually with the SonarQube user I created on GitLab and it works. So the user have the correct rights I supposed.

Another thing I saw, it's I didn't pass any projectKey to the sonar job. So I added that. We have a root directory and inside modules directory. Each module it's a project on SonarQube. So I guess I will have to make a CI job for each SonarQube project (our modules).

So I added a job configured for one SonarQube project (Core) and I added a line with a bug according to our rules, a BigDecimal constrctor non compliant.

Here is the job log: sonar-gitlab-job.log
And my sonar-project.properties:

sonar.gitlab.project_id = [email protected]:2003/repo.git
sonar.java.binaries     = **/build,**/Lib*
sonar.projectKey        = com.modulbio.Core:Core
sonar.sourceEncoding    = ISO-8859-1
sonar.sources           = Core/

The job is finished with success but I have a lot of warning "Unable to find the class". I don't know what is the effect of this...
It seems to analyse the correct files but the BigDecimal bug it's not founded and therefore no discusion are opened into the correspondant MR.

What can be the problem here?
Thanks for any help again!

@MuyBien
Copy link
Author

MuyBien commented Mar 28, 2018

And it's true that it didn't parse only modified file but all the module files. So this can be a problem too

@elboletaire
Copy link
Contributor

Ok now I see what's your problem, but I'm sorry because I think this is nothing related to our gitlab-sonar-scanner docker image. Either seems to be an issue with the gitlab sonarqube's plugin or with sonarqube itself.

We currently have some issues where errors are detected in not modified files, and also I remember more than one time not detecting things that should detect. But I never got enough time to debug this by myself.

If you wanna debug this by yourself, you should try running the plugin locally in your machine (without our docker container), and try start discarding issues from there.

I'm reopening the issue but changing its title, because we also have experienced it, and it would be nice to have it working properly.

BTW, if any of us detects if the issue really comes from the gitlab plugin or from sonarqube, we should scale the issue to them and close this one.

@elboletaire elboletaire reopened this Mar 29, 2018
@elboletaire elboletaire changed the title Can't make mode ISSUES working ISSUES mode is somehow buggy, despite the fact it works most of the times Mar 29, 2018
@elboletaire
Copy link
Contributor

elboletaire commented Mar 29, 2018

Note that I'm adding the despite the fact it works most of the times to the title because you are the only one having this (really) bad experience. If you check the issues section you'll see there are others using this plugin and no one mentioned this before.

@MuyBien
Copy link
Author

MuyBien commented Apr 4, 2018

Thanks for reopening the issue.
As you said, it's weird that I'm the only one having issues wit the issues's mode (:trollface:).

Are you sure it's not possible that I made a mistake somewhere?

Thanks for your help!

@elboletaire
Copy link
Contributor

No, I'm not sure, but, as said, I think is related to what happens to us. Anyway, I don't have much time for this. So any help would be appreciated (that's why I added the help wanted badge).

If you can do any checks on your side and share them here, we'll be glad to read them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants