When a pull request is opened, I get below error. I am using circleci and this is a gradle based project.
‘sonar.pullrequest.branch’ is mandatory for a pull request analysis
Through forums I seen some resolutions to set this values in gradle file. But what values needs to set? from where? is there a problem if the key is static? or how to dynamically set or get the key?
Sorry for the late reply, can you confirm that you see a Github icon next to your project name on your project overview page? It should look like the following screenshot: .
If you can see the GitHub icon, could you send me the full output of the CircleCi job? You can do this in a private message if it contains sensitive information.
I followed up with the @Vinod_plank in a private thread. The problem turned out to be that the token used to start the analysis did not have sufficient permissions. This is a bug, and it can be tracked here.
Im facing the same issue and it doesn’t seem to be fixed. Here is the output from a pull request CircleCi build
> Task :swagger-contract-tests-webflux:jacocoTestReport
> Task :swagger-contract-tests-webflux:check
> Task :codeCoverageReport
> Task :sonarqube
Failed to check if project 'springfox_springfox' is bound
> Task :sonarqube FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sonarqube'.
> Parameter 'sonar.pullrequest.branch' is mandatory for a pull request analysis
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Is the solution to set the -D with the $CIRCLE_BRANCH environment variable?