sonarqubesonarqube-api

Waiting the end of a REPORT task without having Administrator permissions


I am developing a plugin for SonarQube 6.3.1 which execute an analysis and then generate a docx report.

The problem is that I have to wait between these both actions that SonarQube finishes its REPORT task. My plugin is destined to lambda users so without Administrator permissions: so I can not use activityStatus service.

Is there an other way to know if the reporting of a project in SonarQube is terminated? (inside a plugin)


Solution

  • Your analysis take place on the server side ? I think you should run it on a client side, not server side.
    Write a plugin with @BatchSide and implements org.sonar.api.batch.postjob.PostJob.
    Then your method will execute soon analysis is finish (as you requested) See https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/hooks/DisplayIssuesInScanner.java

    And by the way with PostJobContext object you have all infos you need to fill a custom report