Search code examples
sonarqubesonarqube-scansonarqube-web

Can you generate an html report from a taskid in Sonar 5.5?


I'm finding that my sonar preview analysis (generating html report) and my sonar-scanner run (generating a taskid and indication of build-breakage) are constantly out of sync. (You can't see which issue (in the CI server) caused a particular sonar-scanner failure.

What I want to do is generate the html report (Showing the issue deltas) from the taskid that we got from the sonar-scanner run.

My question is: Can you generate an html report from a taskid in Sonar 5.5?


Solution

  • There seems to be a mix of, and misunderstanding of ideas here:

    • Preview analysis - runs independently of the server
    • Full analysis - submits analysis report to the server
    • Build breaker - returns -1 to the build job if the project fails the quality gate at the end of the (full) analysis
    • HTML report - optional, additional analysis output

    A preview analysis will, by nature, be "out of synch" with the server, since it doesn't submit anything back to the server. Also, since:

    • a Quality Gate can only pass/fail as the result of a full analysis,
    • a build can only break as the result of a failed Quality Gate (in a full analysis)

    a preview analysis can't break the build.

    Now let's talk about an HTML report. You can generate one as an additional output of an analysis, but that would have to be done during the analysis. It cannot happen retroactively.