Pull Request Decoration missing (using Jenkins inside of monorepo)

Hi,

I am in the in the middle of converting a private repo into a monorepo where different sonarcloud projects analyze different parts of a single github repo. We use Jenkins to kick off our sonarcloud runs. We have two separate projects, let’s call them foo, and foo-community-version, both in a single github repo www.github.com/my-org/foo. Right now I have it so both the foo and foo-community-version reports are created for each pull request on master, as we desire. But only one of them (foo) actually decorates the PR. I am really struggling to get this working as most of the instructions i have found were related to github-actions, which we don’t want to use for this workcase.

Jenkins is running the following command to kick off the PR analysis on foo-community-version (with a similar command for the foo project):

/home/jenkins/.sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -X \
  -Dsonar.login=**** \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.pullrequest.provider=github \
  -Dsonar.pullrequest.github.repository=foo \
  -Dsonar.organization=my-org \
  -Dsonar.projectName=foo-community-version \
  -Dsonar.projectKey=my-org_foo-community-version \
  -Dsonar.pullrequest.base=master \
  -Dsonar.pullrequest.branch=feat/add-wings \
  -Dsonar.pullrequest.key=NNN \
  -Dproject.settings=sonar-project.properties \
  -Dsonar.cfamily.compile-commands=./build/compile_commands.json \
  -Dsonar.cfamily.threads=8

Like I said earlier, the reports for both projects are correctly created in sonarcloud, but only foo will decorate the PR and therefore we cannot gate on the report created by foo-community-version. The project is private so I’m unable to share more details than that publicly. I’m really wracking my brain on what to try next.

Thank you in advance

After typing this up I tried one last thing and got it to success, but thought I would post in case someone in the future has same problem as me. The github.repository had to be changed to my-org/foo. So the successful command looks like:

/home/jenkins/.sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -X \
  -Dsonar.login=**** \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.pullrequest.provider=github \
  -Dsonar.pullrequest.github.repository=my-org/foo \
  -Dsonar.organization=my-org \
  -Dsonar.projectName=foo-community-version \
  -Dsonar.projectKey=my-org_foo-community-version \
  -Dsonar.pullrequest.base=master \
  -Dsonar.pullrequest.branch=feat/add-wings \
  -Dsonar.pullrequest.key=NNN \
  -Dproject.settings=sonar-project.properties \
  -Dsonar.cfamily.compile-commands=./build/compile_commands.json \
  -Dsonar.cfamily.threads=8
1 Like