Sonarqbe Server Enterprise Edition is not decorating PullRequests from Forked repositories

Hi Comunity
currently our development teams work by creating a fork repository and in there a new feature is implemented when feature is ready we create a Pull request to the original source repository used to create the fork.

we now want to use our sonarqbe server to scan such pull request however we have not been able to make it work.

is this possible to achieve? or is there a known restriction for Sonarqbe server on this?

info:
Sonarqbe server version: Version 8.9.7.52159 Enterpise Edition
Bitbucket Server

error:
image

sonar scan:
sonar-scanner -X
-Dsonar.host.url=$SONAR_HOST_URL
-Dsonar.login=$SONAR_LOGIN
-Dproject.settings=${SONAR_PROPERTY_FILE}
-Dsonar.projectVersion=${VERSION}
-Dsonar.scm.provider=git
-Dsonar.pullrequest.key=${pullrequestid}
-Dsonar.pullrequest.branch=${frombranchname}
-Dsonar.pullrequest.base=${tobranchname}
-Dsonar.pullrequest.bitbucketserver.project=${projectkey}
-Dsonar.pullrequest.bitbucketserver.repository=${fromrepositoryname}

sonar.properties

sonar.projectKey=doa-ui
sonar.projectName=doa-ui
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.tests=src
sonar.exclusions=/node_modules/
sonar.test.inclusions=**/*.spec.ts
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.testExecutionReportPaths=

Hey there.

What CI are you using to execute the analysis (Jenkins, something else…)

Probably, the SCM revision that’s being calculated in the background (sonar.scm.revision) starting with 69f48c doesn’t exist in the repository where the pull request has been raised. There are a few reasons this can happen: but I recommend checking first, where does the 69f48c exist? In the forked repo, a merge commit created by your CI (Jenkins commonly does this), somewhere else?

image
we are using Jenkins pipelines and we are using a step to execute scan using sonar scanner version 4.6.0.2311

here snippet code used in our jenkins pipeline:

            steps {
                withSonarQubeEnv('EnterpriseSonarQube'){
                    sh '''${scannerHome}/bin/sonar-scanner -X \
                    -Dsonar.host.url=$SONAR_HOST_URL \
                    -Dsonar.login=$SONAR_LOGIN \
                    -Dproject.settings=${SONAR_PROPERTY_FILE} \
                    -Dsonar.projectVersion=${VERSION} \
                    -Dsonar.scm.provider=git \
                    -Dsonar.pullrequest.key=${pullrequestid} \
                    -Dsonar.pullrequest.branch=${frombranchname} \
                    -Dsonar.pullrequest.base=${tobranchname} \
                    -Dsonar.pullrequest.bitbucketserver.project=${projectkey} \
                    -Dsonar.pullrequest.bitbucketserver.repository=${fromrepositoryname} '''
                }
            }

also Here a diagram explaining PR
Sonar pr

commit lives in forked repo
pr lives in destination repo

Colin good morning thanks for the reply
do you have any feedback here?

Hey there.

It looks like you’ve opened a ticket with our Enterprise Support Team. They’re the experts who are going to be able to research your environment and understand what’s going on (and what solutions there are).

And, I’ve dived into the code a little bit, and I might have jumped the gun on what the error message is indicating.

I have no doubt out support team will ask you for TRACE logs of the Compute Engine (<SonarQube_Install_Directory/logs/ce.log) from the time this pull request analysis was performed. I’d prepare for those (global Administration > System > Log Level) to examine which web request is failing and why.

I suggest we come back to this thread to let our Community know what the problem was, even if the troubleshooting happens with our enterprise support team.

:warning: Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported. :smiley:

1 Like