Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't fill in Project Key for quality gates plugin

I'm trying to user Sonarqube with Jenkins.

I've added the Quality Gates Plugin, to fail the build in Jenkins if the Quality Gates are not respected in Sonarqube.

However, as you can see below, there is no Project Key field for Quality Gates.

enter image description here

Also, if I try to save the configuration, I get:

JSONObject["projectKey"] not found.

Any idea why this would not appear?

like image 810
octavian Avatar asked Feb 12 '17 15:02

octavian


People also ask

How can I get SonarQube quality gate status in Jenkins?

Go to Manage Jenkins > Configure System and scroll down to the SonarQube servers section. This is where we'll add details of our SonarQube server so Jenkins can pass its details to our project's build when we run it. Click the Add SonarQube button.

How do you fail quality gate in SonarQube?

To pass the Quality Gates, the project should pass through each of the thresholds set. When SonarQube runs it will identify if the code meets all the quality thresholds you have set – else it will fail the Quality Gate and will not allow you to check in code to source control.

Is Quality Gate is a combination of?

Defining Quality Gates Each Quality Gate condition is a combination of: a measure. a comparison operator. an error value.


2 Answers

I have the same issue. I also didn't initially add the sonar server in the system config, after doing that, I see the Project Key field only in the Post Build Actions.

That doesn't help if you want to add it as a build step or post build step. EG. maven install with sonar scan, then test the gate, then if gate passes, maven deploy.

like image 107
John Zerbe Avatar answered Oct 26 '22 06:10

John Zerbe


In http://jenkinsInstance/configure I had setup SonarQube only in "SonarQube servers" but not in "Quality Gates" as well.

like image 36
octavian Avatar answered Oct 26 '22 07:10

octavian