[SONARJNKS] 2.8+ Jenkins plugin calls public SonarQube URL instead of the one set in SonarInstallation

jenkins

(Thomas De Grenier De Latour) #1

When requesting Quality Gate status, the Sonar Jenkins plugin uses the public SonarQube URL (sonar.core.serverBaseURL) instead of the URL explicitly configured in the global Jenkins configuration (in the SonarInstallation). Which breaks when the public domain is actually meant for end-users interactions, and a different domain/port is meant for “internal” Jenkins-to-SonarQube interactions. Which might sound weird/stupid, but actually happens, for good reasons, in at least one weird/stupid corporate environment I’m familiar with.

I think things used to work better than that in earlier Sonar Jenkins plugin versions, and this is a regression introduced in 2.8, as a fix for SONARJNKNS-287:

@Julien_HENRY added a comment - 16/Mar/18 9:33 PM

Instead of expanding server URL inside the pipeline step (which I beleive is not possible),
I decided to use the serverUrl found in the report-task.txt.

Of course, the URL which happens to be available in report-task.txt, and saved in the SonarAnalysisAction, is the public one, and not the one I’d like to be used for API requests from Jenkins itself.

I think a better fix for SONARJNKNS-287 would have been to save, in SonarAnalysisAction, the URL from SonarInstallation (in its vars-expanded form, since the original issue was about supporting variables in this URL), and then reuse that later.

I have submitted a PR which implements such a change : PR #107


(Thomas De Grenier De Latour) #2

Hi there,

I don’t like to be this guy, but… Ping? Bump?

Has anyone from the dev’ team seen this report? @Julien_HENRY maybe?
Sorry, I don’t know how to make sure that a a bug report which has not reached Jira yet don’t get definitely buried in the forum limbo. I would love to get some kind of ack, even if it’s a WONTFIX.

Thanks.