3

I am currently exploring backstage integration with our own sonarqube instance. Followed instructions from: https://github.com/backstage/backstage/tree/master/plugins/sonarqube and https://github.com/backstage/backstage/tree/master/plugins/sonarqube-backend

my config file is updated with:

proxy:
  '/sonarqube':
    target: https://sonarqube.gcp.xyz.com/api
    allowedMethods: ['GET']
    auth: <<token from sonarqube>>
sonarQube:
  baseUrl: https://sonarqube.gcp.xyz.com
  apikey: <<token from sonarqube>>

i am testing app in local using yarn dev command and i see no errors for sonarqube.

[1] 2022-11-16T03:53:35.856Z proxy info [HPM] Proxy created: /sonarqube  -> https://sonarqube.gcp.cna.com/api type=plugin
[1] 2022-11-16T03:53:35.857Z proxy info [HPM] Proxy rewrite rule created: "^/api/proxy/sonarqube/?" ~> "/" type=plugin

some where in the log i see following statement.

[1] 2022-11-16T03:54:14.347Z backstage info 127.0.0.1 - - [16/Nov/2022:03:54:14 +0000] "GET /api/sonarqube/instanceUrl?instanceKey= HTTP/1.1" 404 - "http://localhost:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52" type=incomingRequest

Issue: I don't see the sonar api working. I see following error. The key mentioned is present in the sonarqube baseUrl instance.

No information to display
There is no SonarQube project with key 'jupiter-camunda'.

please help be debug this issue. Logs are not helpful in finding what is wrong. is it poiting to the baseurl i provided or going to sonarqube.org ?

How to get this working.

Initially I tried with just sonarqube plugin, got same result. So tried adding sonarbackend and no success either.

1 Answers1

0

I had a similar issue the documentation isn't great and you only really need to follow the steps in the backend, first, you need to fix your app-config.yaml file.

  1. Remove the proxy definition it doesn't actually need it.
  2. Correct the case on sonarqube to fully lowercase as per below (match the backend docs)
    sonarqube:
      baseUrl: https://sonarqube.gcp.xyz.com
      apikey: <<token from sonarqube>>
    
  3. Double check you have correctly installed the backend as per https://github.com/backstage/backstage/tree/master/plugins/sonarqube-backend
MortusUK
  • 117
  • 6
  • I'm also having issues to integrate this plugin. Did you had to create a plugin as indicated in the documentation your shared? – Nereis Jun 27 '23 at 15:56