PR Decoration does not apear in Pull Request

Hi,

I am using PR Decoration with connection to a On-Premise Azure Devops installation.

When I create a PR with issues, the PR build runs and analyses SQ. The analysis finds this issues (in webinterface) and Azure server sends mail to the PR creator (me) but does not show the issues in the PR. Why?

Mailbox:
image

PR view:
image

Addition about my setup
Version 9.9.1
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Linux 6.2.0-31-generic amd64
INFO: CFamily plugin version: 6.41.0.60884

Hi,

Are you looking for the analysis summary, or individual issues annotated in the code?

 
Ann

I am looking for the comments at the code. (Like when my collegue reviews it)
I get the mails (Like when my collegue reviews it), but the comments are not there.

Hi,

Are you seeing the analysis summary on the PR, or do you not get anything?

 
Ann

What is the “analysis summary on the PR”? The log in the build? Yes, i am getting that:

INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarqube.xxxxxx
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarqube.xxxxxx
INFO: Analysis total time: 13.127 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 14.895s
INFO: Final Memory: 32M/124M
INFO: ------------------------------------------------------------------------

Hi,

Does anything at all show up in Azure on a PR?

 
Ann

Yes, this shows up:

Hi,

I’m not sure why you’re getting a Quality Gate status there. Your screenshot shows that you “PR build failed”.

You need to look into that.

 
Ann

The PR build failed because other jobs failed. The SQ job is green.

Hi,

I don’t understand. Was the PR analyzed?

 
Ann

Yes the PR-branch was analyzed by SQ. I sent you the log before and screenshots of the mails I got.

I will now also send you a screenshot of the link shown in the log:
image

Hi,

How did you configure your project? Did you import it into SonarQube from Azure using the in-app wizard? Or did you manually configure Quality Gate reporting?

 
Ann

It is a manual setup and manual scanner call.

Hi,

Because you configured this project manually, the data to enable pull request decoration in general is not in place. Take a look at Project Settings → DevOps Platform Integration.

 
HTH,
Ann

Hi Ann,

of course we have these setting active. (How would it send those mails with correct PR Id otherwise?)

We also set the scanner properties:

  • sonar.pullrequest.key
  • sonar.pullrequest.branch
  • sonar.pullrequest.base

Hi,

Okay, I’ve flagged this for more expert eyes.

 
Ann

1 Like

I have some additional info that might be of interest:

We analyse multiple projects in the same PR (with the same sonar.pullrequest.*) settings. Other projects analyze different files (no overlaps). Maybe other projects overwrite something and delete those issues again (even though it analyses different files).

Hi,

Can you elaborate on this? Are we talking about a monorepo? And what edition are you using?

 
Ann

Hi,

we have multiple sonar projects, that are analyzed in the same pipelines from the same git-repo. The reason is that we have different rulesets for different code parts (e.g. test code vs productive code)

We do not have monorepo setting active (screenshots), because this affects “Reporting quality gate status” only and we somewhat ignore this feature. We only need the comments in the PR, which will block completion of the PR anyways.

We are running:

  • Enterprise Edition
  • Version 9.9.1 (build 69595)

Hi,

So it sounds like you do have a monorepo, but if it’s not configured as a monorepo, then it’s no surprise that you’re getting strange results.

 
Ann