Hello
We successfully configured SonarQube PR decoration for a self-hosted GitLab server with self signed certificates and it works just fine when the gitlab-ci pipeline, and the quality gate respectively,
succeeds.
From our .gitlab-ci.yml
(SONAR_HOST_URL and SONAR_TOKEN passed as environment variables):
script:
- 'mvn test sonar:sonar
-Dsonar.qualitygate.wait=true'
only:
- merge_requests
GitLab access log shows following entry:
"x.x.x.x - - [23/Jan/2020:09:47:42 +0100] "POST /api/v4/projects/20/merge_requests/9/notes?body=%23%23+SonarQube+Code+Analysis++%0A%23%23+Quality+Gate+passed++[...]" HTTP/2.0" 201 4149 "" "okhttp/3.14.2"
However, when the quality gate fails SonarQube keeps sending empty POSTs to our GitLab server infinitly until we restart the SonarQube server. Note: log timestamps copied from several trials and may vary.
x.x.x.x - - [23/Jan/2020:09:09:47 +0100] "POST HTTP/2.0" 000 0 "" "-"
x.x.x.x- - [23/Jan/2020:09:09:47 +0100] "POST HTTP/2.0" 000 0 "" "-"
x.x.x.x - - [23/Jan/2020:09:09:47 +0100] "POST HTTP/2.0" 000 0 "" "-"
x.x.x.x - - [23/Jan/2020:09:09:47 +0100] "POST HTTP/2.0" 000 0 "" "-"
x.x.x.x - - [23/Jan/2020:09:09:47 +0100] "POST HTTP/2.0" 000 0 "" "-"
In the SonarQube ce.log
file we get following entries
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][jdk.event.security] ValidationChain: 86393724, 2041265836
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][jdk.event.security] TLSHandshake: y.y.y.y:443, TLSv1.3, TLS_AES_256_GCM_SHA384, 2041265836
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> CONNECTION 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000000 6 SETTINGS
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000000 4 WINDOW_UPDATE
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000003 4254 HEADERS END_HEADERS
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000003 0 DATA END_STREAM
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 18 SETTINGS
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 4 WINDOW_UPDATE
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 0 SETTINGS ACK
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] >> 0x00000000 0 SETTINGS ACK
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 8 GOAWAY
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] >> 0x00000003 4 RST_STREAM
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][jdk.event.security] ValidationChain: 86393724, 2041265836
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][jdk.event.security] TLSHandshake: y.y.y.y:443, TLSv1.3, TLS_AES_256_GCM_SHA384, 2041265836
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> CONNECTION 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000000 6 SETTINGS
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000000 4 WINDOW_UPDATE
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000003 4254 HEADERS END_HEADERS
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000003 0 DATA END_STREAM
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 18 SETTINGS
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 4 WINDOW_UPDATE
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 0 SETTINGS ACK
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] >> 0x00000000 0 SETTINGS ACK
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 8 GOAWAY
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] >> 0x00000003 4 RST_STREAM
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][jdk.event.security] TLSHandshake: y.y.y.y:443, TLSv1.3, TLS_AES_256_GCM_SHA384, 2041265836
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> CONNECTION 505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000000 6 SETTINGS
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000000 4 WINDOW_UPDATE
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000003 4254 HEADERS END_HEADERS
2020.01.23 11:05:52 DEBUG ce[AW_R3XEzmtc3Okx_LPPf][o.i.http2.Http2] >> 0x00000003 0 DATA END_STREAM
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 18 SETTINGS
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 4 WINDOW_UPDATE
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] >> 0x00000000 0 SETTINGS ACK
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 0 SETTINGS ACK
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] << 0x00000000 8 GOAWAY
2020.01.23 11:05:52 DEBUG ce[][o.i.http2.Http2] >> 0x00000003 4 RST_STREAM
Also we noticed that when the quality gate fails the following line is missing in the logs
2020.01.23 09:47:42 DEBUG ce[AW_RlenHc81fFix3m0Aw][jdk.event.security] X509Certificate: Alg:SHA256withRSA, Serial:b, Subject:CN=..., OU="...", O=..., L=..., ST=HE, C=DE, Issuer:EMAILADDRESS=postmaster@..., CN=YaST Default CA (...), C=DE, Key type:RSA, Length:2048, Cert Id:..., Valid from:1/6/20, 3:58 PM, Valid until:1/5/21, 3:58 PM
Gitlab Version: 12.6.4-ee & 12.4.0-ee
GitLab Runner Version: 12.4.0
SonarQube Version: Version 8.1 (build 31237) Developer Edition
Maven Version: 3.6.3
Java Version: openJDK11