sonar.analysis.mode : what is the difference between "preview" and "issues"?

4,745 views
Skip to first unread message

Indra Gunawan

unread,
May 17, 2017, 2:29:48 PM5/17/17
to SonarQube
We are using github sonar plugin and the sonar.analysis.mode is set to "preview", how can I make this mode fails the build if the commits in PR would introduce new tech debt, major/minor issues that are above the limit threshold in the Quality Gate set to the project?

We have buildbreaker plugin installed as well.  We are running SonarQube 5.6.6.

Thank you
-Indra

G. Ann Campbell

unread,
May 17, 2017, 4:59:14 PM5/17/17
to SonarQube
Hi Indra,

PR analysis isn't about making anything fail. Instead, it's about allowing the pull request reviewer to be fully informed in making that review.

If you're trying to leverage your CI engine's build failure notifications by making the job fail, let me encourage you instead to rely on the comment notifications that GitHub is already automatically sending out whenever a PR analysis raises issues.


Ann

Indra Gunawan

unread,
May 17, 2017, 8:14:52 PM5/17/17
to SonarQube
Are you referring to the SonarQube comments posted on the Github PR?  We have that already.  SonarQube analysis of PR generally would analyze only changed files in this case files included in the git commits in the PR and check them against Quality Gate for (Major, Minor, Technical Debt).  If the number of problem of each these category exceed the limit set for them in the Quality Gate, we want to stop the PR from merge.  Hence we want to fail the PR build doing this SonarQube analysis.  We want developer to observe the PR comments generated, fix the files again.

Indra Gunawan

unread,
May 17, 2017, 8:28:03 PM5/17/17
to SonarQube
would you please describe the difference between "preview" and "issues" for sonar.analysis.mode.

It looks like it is almost the same like preview but it still does not compare it with "preview".


On Wednesday, May 17, 2017 at 1:59:14 PM UTC-7, G. Ann Campbell wrote:

G. Ann Campbell

unread,
May 18, 2017, 7:35:00 AM5/18/17
to Indra Gunawan, SonarQube
Hi Indra,

There is no functionality in PR analysis to stop anything. The role of the human in all this must not be forgotten.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/JguVVO4OorE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/19b998fb-1e06-4074-b6c8-effb35cb3c03%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Indra Gunawan

unread,
May 18, 2017, 1:26:08 PM5/18/17
to G. Ann Campbell, SonarQube
You still have not answered my question.  Would you please answer that.  Is there an irc or Slack channel for SonarQube that I can talk with the engineers at SonarQube to ask this type of question.

Thank you
-Indra

G. Ann Campbell

unread,
May 18, 2017, 1:54:33 PM5/18/17
to Indra Gunawan, SonarQube
Hi,

inline...

On Thu, May 18, 2017 at 1:26 PM, Indra Gunawan <ind...@gmail.com> wrote:
You still have not answered my question.  Would you please answer that.

They are synonyms
 
 Is there an irc or Slack channel for SonarQube that I can talk with the engineers at SonarQube to ask this type of question.

They monitor this group.

Indra Gunawan

unread,
May 18, 2017, 2:20:03 PM5/18/17
to G. Ann Campbell, SonarQube
synonymous meaning?  which one would check the server Quality Gate.

G. Ann Campbell

unread,
May 18, 2017, 2:37:58 PM5/18/17
to SonarQube, ann.ca...@sonarsource.com
Hi Indra,


syn·o·nym
noun
  1. a word or phrase that means exactly or nearly the same as another word or phrase in the same language, for example shut is a synonym of close.

Neither checks the quality gate. As I stated earlier,
There is no functionality in PR analysis to stop anything.


HTH,
Ann

Indra Gunawan

unread,
May 18, 2017, 3:08:13 PM5/18/17
to SonarQube, ann.ca...@sonarsource.com
According to Sonar 5.3 documentation:

Preview Mode

Preview mode performs a full analysis on the entire code base and does not send the results to the database. Typically this mode is used when you want a quick feedback about the issues that you might have introduced before pushing your modifications to the main code base. See all the possibilities in the "Pre-commit Check" documentation.


Then I found "issues" mode do analysis of only changed files unless the sonar.scanAllFiles=true is explicitly set.


I know what does "synonymous" mean.  Thank you

Indra Gunawan

unread,
May 18, 2017, 3:09:18 PM5/18/17
to SonarQube, ann.ca...@sonarsource.com
Here is the reference to "issues" mode:

G. Ann Campbell

unread,
May 18, 2017, 3:16:44 PM5/18/17
to SonarQube, ann.ca...@sonarsource.com
Hi Indra,

You started by saying that you're using 5.6. Does the documentation for that version include the same thing?


Ann

rahul...@gmail.com

unread,
Mar 13, 2018, 3:11:14 AM3/13/18
to SonarQube
Hi Indra, I'm working on the same, integrating sonar and github to publish violations in PRs. But I'm not able to find any guide for it.
Can you help me with it, if you have any reference.
Reply all
Reply to author
Forward
0 new messages