aosapps / drone-sonar-plugin

The plugin of Drone CI to integrate with SonarQube (previously called Sonar), which is an open source code quality management platform.
MIT License
30 stars 51 forks source link

Plugin does not handle pull requests #26

Open fehrnah opened 3 years ago

fehrnah commented 3 years ago

When the drone pipeline is started following a pull request, the sonar analyzer is not called in pull request mode.

SparrowOchon commented 3 years ago

For PR decoration you need to get Sonarqube developer+. Or Community PR Decoration. This only works with git hosts that are supported by Sonarqube i.e Gitlab, Github ... etc.

fehrnah commented 3 years ago

Yes, I am using the community branch plugin for sonarqube.

When creating a new pull request on my git host (gitea), a PR job is started on drone and fails when reaching this plugin.

It's been a while, but if I recall correctly, a pull request flag needs to be set before analysis with the current and target branches.

SparrowOchon commented 3 years ago

If I'm not mistaken the PR Decoration plugin doesn't work with Gitea. Because Sonarqube has no support for it.

fehrnah commented 3 years ago

Yes, this is not about the decorator, this is about being able to look a the analysis manually.

Right now I can't compare two branches' analysis results and see, for example, if a bug is new or not.

https://docs.sonarqube.org/latest/analysis/pull-request/

SparrowOchon commented 3 years ago

Oh, sorry seems I misunderstood. Looking at my Gitlab repos (Assuming you mean two master branches since that's the only branch supported by community), direct branch analysis has worked for me with Drone (including comparing diffs from branch changes) thus your build process may be breaking the branch analysis.

The only remotely similar problem I've seen is This. But this involves non-master branches and the use of additional plugins.

Sorry, I can't be of much help, but I hope you find the solution.