gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
712 stars 207 forks source link

sonar-gitlab-plugin-4.1.0-SNAPSHOT artifact is badly generated #264

Open angelusGJ opened 4 years ago

angelusGJ commented 4 years ago

The plugins is always getting the issues of master branch and not de PR branch. But after many tests, I have realized the artifact is badly generated. This provokes the error in #243.

I have debugged the plugin and I have seen that the branch is not set although the branch is not null. The searchIssues method of SonarFacade class is the problem. In the original artifact the branch is not been set. It's like the lines where the branch is set had been removed in the artifact version. But if you see the tagged source code, it is indeed set.

private Issues.SearchWsResponse searchIssues(String componentKey, String branch, int page) { SearchRequest searchRequest = new SearchRequest().setComponentKeys(Collections.singletonList(componentKey)).setP(String.valueOf(page)).setResolved("false"); if (isNotBlankAndNotEmpty(branch)) { searchRequest.setBranch(branch); } return wsClient.issues().search(searchRequest); }

I don't know how the artifact was generated but I have compiled the artifact from the source code from 4.1.0-SNAPSHOT tag and the plugin works.

The artifact should be generated again to fix de problem.