Search code examples
jenkinssonarqubegerritgerrit-triggersonar-gerrit

Gerrit build posting comments from post build actions in Jenkins


I have integrated Sonar gerrit plugin to post sonar reports as comment in the gerrit web ui. Posting the sonar comments is configured in the post build action of the gerrit build to be posted under sonar-verified category.Verified scoring is posted by the gerrit build's success/failure.

But sonar violations comments are posted as part of verified scoring.

this is also not consistent. sometimes the sonar violation comments are properly posted under sonar-verified category.Screenshot of the issue

Probably the scoring on two different labels happens in two different threads and comments are posted whichever finishes first Please find the attached screenshot

Best Regards, Saurav


Solution

  • Yes. You have answered your question yourself. Suggestion: add a dummy post-build action before the "Post SonarQube issues" to introduce a delay (like "sleep 10) to workaround this issue.