Unable to change project sonar.pullrequest.github.endpoint after upgrade to SonarQube 7.8 (from 7.4)

Version(s)
SonarQube 7.8 Developer Edition

Problem
We recently upgraded from SonarQube 7.4 to SonarQube 7.8 Developer Edition. For some SonarQube projects we had an alternative setting - aka analysis parameter - configured for the Github instance API url sonar.pullrequest.github.endpoint. As the GitHub integration has been completely changed since version 7.7 we’d like to reset this project level setting, but the setting has been removed from the SonarQube administration interface. I’m unable to change the setting now!

I’ve tried to change the settings using the Web API, but POST-ing to api/settings/reset or api/settings/set returns a 400 Bad Request with message “Setting ‘sonar.pullrequest.github.endpoint’ cannot be set on a Project”.

What to try next?

Settings

Global server settings:
  - sonar.alm.github.app.id=******
  - sonar.alm.github.app.name=******
  - sonar.alm.github.app.privateKeyContent.secured=******
  - sonar.branch.longLivedBranches.regex=(refs\/heads\/)?(develop|master|release-.+|hotfix-.+)
  - sonar.core.id=******
  - sonar.core.startTime=2019-06-28T10:59:57+0000
  - sonar.plsql.file.suffixes=pks,pkb
  - sonar.pullrequest.github.endpoint=https://api.github.com/
  - sonar.pullrequest.provider=GitHub
  - sonar.tsql.file.suffixes=.tsql,.sql
Project server settings:
  - sonar.branch.longLivedBranches.regex=(refs\/heads\/)?(develop|master|release-.+|hotfix-.+)
  - sonar.leak.period=30
  - sonar.pullrequest.github.endpoint=https://alternative-api.github.com/
Project scanner properties:
  - sonar.branch.name=develop
  - sonar.exclusions=**/__mocks__/**/*,**/node_modules/**/*,**/__tests__/**/*
  - sonar.host.url=https://sonarqube.devtemp.******.io
  - sonar.login=******
  - sonar.projectBaseDir=C:\BuildAgent\work\26f97faa2bfc25c2
  - sonar.projectKey=******_SonarQube_Web
  - sonar.projectName=******.Web
  - sonar.projectVersion=994
  - sonar.scanner.app=ScannerCli
  - sonar.scanner.appVersion=3.3.0.1492
  - sonar.sourceEncoding=UTF-8
  - sonar.sources=src/******.Web,src/******.Shared.Web,src/******.Web
  - sonar.tests=src/******.Web/__tests__,src/******.Shared.Web/__tests__,src/******.Web/__tests__
  - sonar.working.directory=C:\BuildAgent\work\26f97faa2bfc25c2\.scannerwork

Bump! (as replies appear to be quite fast, but this message is 4 days old now)

Currently it is not possible to integrate a SonarQube instance with multiple GitHub instances. The new way of pull request decoration that we are using (GitHub’s Checks API) makes this particularly difficult. I’m not sure about our plans to support this in the future, so far we haven’t received many requests for this.

To us that’s another problem. We used the sonar.pullrequest.github.endpoint setting to make some projects fail to report to GitHub to work around it.

My current problem is I’m unable to change the setting back to the original GitHub API url’s.

Good point. I created a ticket for this issue: SONAR-12323.

Note that this seems a rare case, and I’m not sure if we will provide a fix. In the meantime, I can only offer the workaround mentioned in the ticket, to remove the setting with a database query (which is something we normally strongly discourage):

delete from properties where prop_key='sonar.pullrequest.github.endpoint' and resource_id is not null;
1 Like