Question about Pull request Analysis SonarQube

sonarqube
(의중 김) #1

Hello.

I have a question about Pull Request Analysis of SonarQube Server.
I have been used SonarQube 7.4 Server version.
I want to integrate with jenkins and sonarQube as Pull Request Analysis.
(when pull request was received, sonarQube static analysis result can checked too,
The important thing is available before history analysis record)
Now I was composed with bitbucket - jenkins pull request auto build environment.
Next, I want to get sonarqube analysis result that analyze with corrected code as pull request.

At first, what I tried to archive was using branch analysis.
But branch analysis was reported about master(long term) only (maybe?).
I wanted to see the analysis result(I thank, it’s available to SonarQube Activity tab.)

My purpose is checking the pull request level’s code analysis result history.
Is code analysis recording that corrected in pull request possible?

Can I get some information about this issue?
Thank you SonarQube!
I’ll waiting for your response

Best Regards,
Uijoong-Kim

(G Ann Campbell) #2

Hi Uijoong-Kim,

I have difficulty understanding what your question is. If you’re using PRs in your SCM, you should be able to configure your CI toolchain to automatically re-analyze each PR after each update to the underlying branch. If you’re not using PRs, then Short-lived branch analysis will give you many of the same features, tho not all.

Here are the relevant docs:

 
Ann

(의중 김) #3

Thank you for your response!

I’ll explain it again.

What we want to do is want to see the history of performing the static analysis whenever PR comes along. I have estimated that this feature is available in SonarQube’s Activity tab.

However, even if a static analysis of the PR is actually performed, we have confirmed that the corresponding analysis history is not generated in SonarQube.

The SonarQube version we are currently using is 7.4. Is Pull Request Analysis support for Bitbucket possible? Provider registration exists only in Github and VSTS. Can the PR analysis function achieve our desired objectives?

In addition, Branch Analysis works normally, and the corresponding function is not up-to-date in the Activity Tab. Is it possible to update only the master branch? Or am I misunderstanding?

For reference, Jenkins performed the build using the SonarScanner for MSBuild tool.

Can I get more feedback on that?
Thank you for your kind reply.

Best Regards
Uijoong-Kim

(Carine Lacombe) #4

Hi Uijoong-Kim,

I will not answer all your questions but only the part on:

This is kind of related to this topic : Sonar integration with Bitbucket (GIT)
And the answer is now “Yes, we support PR decoration in BB”!
See the announcement of BitBucket PR Decoration and official release thread here.

As you can see, you will need to upgrade to SonarQube 7.7 to benefit from this amazing new feature :slight_smile:
Enjoy it !

Carine

1 Like
(G Ann Campbell) #5

Hi,

I’ll try to handle what’s left after Carine’s excellent answer. :slight_smile:

This is correct. We don’t provide history for PRs and Short-Lived Branches under the assumption that what you care about for them is “now”, and how many issues (for example) you had yesterday doesn’t matter. This is all about “can I merge yet?” and the fact that you could or couldn’t merge yesterday is irrelevant.

Sorry, you’re loosing me again here. When you analyze any given branch (short- or long-lived) that branch, and only that branch is updated in SonarQube.

 
HTH,
Ann

(의중 김) #6

Thank you for response Carine Lacombe!
I’ll do that :slight_smile:
have a great day!

(의중 김) #7

Thanks for the detailed explanation!