What do I actually have to set in the webhook url to notify jenkins of quality gate results?

jenkins
webhooks

(David Karr) #1

I work with Jenkins builds that run sonarqube scans. We had been using the BuildBreaker plugin to make sure that builds fail if they fail to surpass quality gate thresholds. The BuildBreaker plugin was flaky, sometimes producing erroneous results, but it worked most of the time. We’ve been told that we now have to use Webhooks for similar functionality. I tried to get this to work a while ago, but I couldn’t get anywhere. The documentation says that we have to enter a webhook url to pass this information to. I can’t find any examples or documentation that show what this webhook url should actually be, in the context of our Jenkins instance.

Now, the people who maintain our SonarQube instance have removed the BuildBreaker plugin entirely. Now I’m forced to figure this out, but I still have no information on how to solve this problem.


(G Ann Campbell) #2

Hi,

Have you checked the documentation?

It says pretty clearly

  • Configure a webhook in your SonarQube server pointing to <your Jenkins instance>/sonarqube-webhook/

Ann


(David Karr) #3

On the page where you set the webhook, it points to the documentation that explains this, which is this: https://docs.sonarqube.org/display/SONAR/Webhooks .

This is apparently missing that information.

In any case, just before I saw this reply, I got this info from someone else, and I’m now working towards implementing it.


(David Karr) #4

It’s really unfortunate that there’s no secure authentication storage available for this. I have to hardcode the basic auth credentials into the url.


(David Karr) #5

We were able to find a token value instead of a password, which is a little better. The other problem with this is that sonarqube apparently doesn’t log the attempt to send this. The job is waiting for the results, but they never find them. I have no way of telling whether SonarQube even made this call.


(Colin Mueller) #6

David,

A new webhooks administration console was introduced in v7.1 of SonarQube that provides the functionality you note is missing. The latest version of SonarQube is v7.3.

You can checkout the 7.1 Release Notes for some details and screenshots.

Colin


(Gilbert Rebhan) #7

Hi,
you don’t need BasicAuth, it should work without authentication.
Works fine here with SQ 7.3
The webhook deliveries are logged under project/administration/webhooks
Do you have any proxy settings in your sonar.properties ?
Regards,
Gilbert