Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Plugin not able to find qualityGate #22

Closed
btodd914 opened this issue Jan 11, 2018 · 12 comments
Closed

Plugin not able to find qualityGate #22

btodd914 opened this issue Jan 11, 2018 · 12 comments

Comments

@btodd914
Copy link

image

Have the plugin all set up and I have the quality gate set to the default sonarQube way. But I am still getting an error that it cannot be found. Is there a fix for this or is it just a problem with my set up?

@edemirkan
Copy link

@btodd914 I am getting the same error.
Upon further checking :9000/api/webservices/list, I noticed the following.
[...]
{"path":"api/resources","since":"2.10","description":"Removed since 6.3, please use api/components and api/measures instead","actions":[{"key":"index","description":"The web service is removed and you're invited to use the alternatives: <ul><li>if you need one component without measures: api/components/show</li><li>if you need one component with measures: api/measures/component</li><li>if you need several components without measures: api/components/tree</li><li>if you need several components with measures: api/measures/component_tree</li></ul>"
[...]
Which suggests the plugin is outdated and not working with current version (6.7.1) of sonarqube.

@NahidSiddiqui
Copy link

NahidSiddiqui commented Jan 23, 2018

I have a similar issue, I think the problem is, in my case it is using an outdated url. The format for the correct url in my case is: http://<sonar_cube_url>/api/qualitygates/project_status?projectKey=<project_key>

So I agree it is outdated

@xxBedy
Copy link

xxBedy commented Jan 30, 2018

This fix working for me #24

@charleston10
Copy link
Contributor

@xxBedy Someone will accept/merge your pull request?

@apansari
Copy link

Facing the similar issue. Is there a plan to get the PR merged anytime soon?

@charleston10
Copy link
Contributor

@apansari I'm trying to solve my profile problem
But you can get the fit through my fork
https://github.com/charleston10/gocd-plugins

@apansari
Copy link

apansari commented Jun 11, 2018

@charleston10 : thanks for sharing. tried installing the plugin from your fork but see below error:

13:16:42.064 [go] Start to execute task: Plugin with ID: sonar.quality.gate.plugin.
13:16:42.098 [SonarQube Quality Gate Plugin] configuration setting 'SonarProjectKey' is 'com.example.convoy:convoy-feature-service'
13:16:42.098 [SonarQube Quality Gate Plugin] configuration setting 'StageName' is ''
13:16:42.098 [SonarQube Quality Gate Plugin] configuration setting 'JobCounter' is ''
13:16:42.099 [SonarQube Quality Gate Plugin] configuration setting 'JobName' is ''
13:16:42.099 [SonarQube Quality Gate Plugin] configuration setting 'IssueTypeFail' is 'error'
13:16:42.099 [SonarQube Quality Gate Plugin] configuration setting 'SonarApiUrl' is 'http://********@sonar-wc-1p.sys.net:9000/api'
13:16:42.099 [SonarQube Quality Gate Plugin] checking quality gate result for: com.example.convoy:convoy-feature-service
13:16:42.099 [SonarQube Quality Gate Plugin] API Url: http://********@sonar-wc-1p.sys.net:9000/api
13:16:42.099 [SonarQube Quality Gate Plugin] Fail if: error
13:16:42.223 [SonarQube Quality Gate Plugin] Error during get or parse of quality gate result. Please check if a quality gate is defined
**JSONObject["parameter"] not found**.
13:16:42.233 class org.json.JSONException declares multiple JSON fields named cause
13:16:42.253 [go] Current job status: failed.

seems to be an issue with sonar scan itself, any inputs on what must be missing?
https://github.com/charleston10/gocd-plugins/blob/master/sonar-qualitygates-plugin/src/com/tw/go/task/sonarqualitygate/SonarTaskExecutor.java#L56

@ysnoussi
Copy link

Could someone merge this PR please!

@markus2810
Copy link
Contributor

Pull request merged

@tuyen03a128
Copy link

@charleston10 : thanks for sharing. tried installing the plugin from your fork but see below error:

13:16:42.064 [go] Start to execute task: Plugin with ID: sonar.quality.gate.plugin.
13:16:42.098 [SonarQube Quality Gate Plugin] configuration setting 'SonarProjectKey' is 'com.example.convoy:convoy-feature-service'
13:16:42.098 [SonarQube Quality Gate Plugin] configuration setting 'StageName' is ''
13:16:42.098 [SonarQube Quality Gate Plugin] configuration setting 'JobCounter' is ''
13:16:42.099 [SonarQube Quality Gate Plugin] configuration setting 'JobName' is ''
13:16:42.099 [SonarQube Quality Gate Plugin] configuration setting 'IssueTypeFail' is 'error'
13:16:42.099 [SonarQube Quality Gate Plugin] configuration setting 'SonarApiUrl' is 'http://********@sonar-wc-1p.sys.net:9000/api'
13:16:42.099 [SonarQube Quality Gate Plugin] checking quality gate result for: com.example.convoy:convoy-feature-service
13:16:42.099 [SonarQube Quality Gate Plugin] API Url: http://********@sonar-wc-1p.sys.net:9000/api
13:16:42.099 [SonarQube Quality Gate Plugin] Fail if: error
13:16:42.223 [SonarQube Quality Gate Plugin] Error during get or parse of quality gate result. Please check if a quality gate is defined
**JSONObject["parameter"] not found**.
13:16:42.233 class org.json.JSONException declares multiple JSON fields named cause
13:16:42.253 [go] Current job status: failed.

seems to be an issue with sonar scan itself, any inputs on what must be missing?
https://github.com/charleston10/gocd-plugins/blob/master/sonar-qualitygates-plugin/src/com/tw/go/task/sonarqualitygate/SonarTaskExecutor.java#L56

@apansari
same issue with me when I use sonarQube 7.2.1. I build a temporarily fixed jar here:
https://github.com/tuyen03a128/gocd-plugins/blob/master/sonar-qualitygates-plugin/jar/gocd-sonar-qualitygates-plugin-2.0.1.jar
and open a pull request. charleston10#1

@aeells
Copy link

aeells commented Apr 29, 2019

Comments/status above would seem to suggest a fix has been merged.
However, I can't see that reflected either in the sonar-qualitygates-plugin repo commit history and the wiki is definitely still referencing version 1.0.0 of the jar file https://github.com/Haufe-Lexware/gocd-plugins/blob/master/bin/gocd-sonar-qualitygates-plugin-1.0.0.jar
Can this be clarified please?
As above, I'm still seeing REST call failures with SonarQube 7.1.
REST call failed; URL=https://.../api/resources?resource=...&metrics=quality_gate_details; Code=404;
(Replacing with the updated version 2.0.0 supplied above by @charleston10 worked 👍)
https://github.com/charleston10/gocd-plugins/blob/ff08c52e2cbb71f4a6b16fe36ec51a2b1d03efc8/sonar-qualitygates-plugin/jar/gocd-sonar-qualitygates-plugin-2.0.0.jar

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

No branches or pull requests

10 participants