Github App Permission support to read and write for commit status in sonarqube 8.9

  • which versions are you using : sonarqube 8.9
  • how is SonarQube deployed: zip
  • what are you trying to achieve: change the commit status posted by github app for sonarqube analysis
  • what have you tried so far to achieve this: i have changed the permission of app from read only to read and write and i get the below error on sonarqube dashboard
    image

i need this write access to change the status but it looks like sonarube doesnt support this type of change.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

Could you give more details on what you’re trying to do?

Was this previously working?

 
Ann

hi Ann,

i am trying to change the status of check from a failure to success, to do this i need to make the api call using the same sonarqube app which posts the status check after the sonarqube analysis. to achieve this i need to change the permission of github app for commit status to write but then when i do this sonarqube integration throws the above error and my reporting in github fails!

so the request here is to allow the integration of github app with write permission on commit status

Hi,

The way to do this is to fix the code. Either that or disable the check. You’re not going to be able to flip the status directly.

 
Ann

yes i know that isnt the right practice, but we have few edge cases where we need to flip and this is achiveable, i need support from sonarqube to just allow integration to work with write access to commit status

can this request be taken up ?

Hi,

This becomes a GitHub question.

 
Ann

how is this a github question when the error thrown is in sonarqube ?

github app works just fine, it is the sonarqube integration that is throwing the error
image

Integration document above says permission should be read only for commit status and if this can be changed to allow write access then this resolves my problem and will be of great help to my organization!

please correct me if i am wrong here!

Nishwal

Hi Nishwal,

I’ll admit I’m thoroughly confused at this point.

You have a failing Quality Gate. You want to intervene manually to make it pass. That’s a GitHub issue. The functionality doesn’t exist in SonarQube.

You edited your SonarQube config? Your user permissions? In an attempt to make that work? So… just undo the changes?

 
Ann

let me try to explain Ann,

I am using the same github app which is integrated in sonarqube to manually make it pass and it works only if the app has write user permission to commit status so i when i change this permission for the github app, sonarqube integration fails becuase sonarqube allows only read access by design and hence the error in sonarqube dashboard.

Hi,

Are you trying to say that if you grant more permissions on the GitHub side, both read and write, that PR decoration fails?

 
Ann

Hi,

Yes it fails

Nishwal

Hi,

Then it sounds like you need to put the permissions back like they were.

As I said, manually overriding the QG status is outside the scope of SonarQube.

 
Ann