www-builds mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Munteanu <romb...@apache.org>
Subject Jenkins + SonarQube building on pull requests?
Date Fri, 01 Feb 2019 15:15:06 GMT

In the Sling project we've set up SonarQube analysis and PR validation
using Multi-branch pipeline projects. So far, this works very well.

One things which I don't know how to achieve is to have Sonar build
pull requests and comment in case of issues found. There are two parts
of this feature:

1. The analysis result is posted on the GitHub pull request. This is
important for visibility of the results as they are nicely added to the
pull request.

2. The analysis result is not stored on the central sonar server. This
is important since the code is not yet merged so the analysis of a pull
request does not reflect what is in the master branch.

I have followed the documentation from [1] and configured our job to
use the required parameters for pull requests:

  mvn -U clean verify sonar:sonar -Dsonar.pullrequest.branch=feature/SLING-8262 -Dsonar.pullrequest.key=25
-Dsonar.pullrequest.base=master -Dsonar.pullrequest.provider=github -Dsonar.verbose=true -Dsonar.pullrequest.github.repository=apache/sling-whiteboard

as seen in [2].

However, the analysis was stored in the Sonar server ( PR time is 2:54
PM, last analysis time in sonar is 3:55 - I suspect a time zone config
difference ).

I have noticed that the ASF SQ instance is at version 5.6.3, while the
documentation at [1] is for version 7.6. Also I am not sure if there is
anything to be done on the Sonar side to connect it to GitHub.

So my questions are:

1. Has anyone else set up Sonar decorating pull requests using Jenkins?
2. Is this supposed to work at all with the ASF Jenkins instance?



[1]: https://docs.sonarqube.org/latest/analysis/pull-request/
[2]: https://builds.apache.org/job/Sling/job/sling-whiteboard/view/change-requests/job/PR-25/9/console

View raw message