[go: up one dir, main page]

Page MenuHomePhabricator

Upgrade SonarQube / codehealth jobs to use Java 17
Closed, ResolvedPublic

Description

As seen here (https://sonarcloud.io/summary/new_code?id=mediawiki-extensions-ReportIncident&branch=968698-24):

This project was scanned using Java 11 runtime. Starting from 15 Nov 2023, SonarCloud will stop accepting scans that are started with Java 11. We highly recommend moving your configuration to Java 17+.

More info is in https://community.sonarsource.com/t/java-11-is-deprecated-as-a-runtime-env-to-scan-your-projects/96597

Event Timeline

I think Java 17 is only required for Sonar scanner 5.x so as long as we run the old 4x scanner we can still use Java 11 and the dropped support is for SonarCloud. At least that is how I understand this comment:

If you update the Scanner CLI to the 5.x, then you will need to install a Java 17 runtime.
SonarCloud will, after the 31st of October 2023, not allow you to trigger scans if you still use Java 11 as a runtime. It will just fail at the beginning saying that the JRE version used is not supported.

Nonetheless, we can still create Java 17 images based on Bullseye (I don't think any image is based on Bookworm yet), reparent the sonar-scanner on top of it. Then I don't know whether the Sonar Scanner 4.x will work with Java 17.

It appears they are enforcing the minimum scanner version that can be used with Java 17 to be version 5.x. Although from limited research I have seen some who had scanner v4.8^ could run it in Java 17. We can only know for sure by trying after we have a Java 17 image available.

However, as per the comment, I think we can still use Java 11 with 4x scanner even after support is dropped just like we used node14 for a couple of months after support was dropped.

hashar renamed this task from Upgrade jobs to use Java 17 to Upgrade SonarQube / codehealth jobs to use Java 17.Nov 6 2023, 9:15 AM

Change 971906 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] dockerfiles: sonar-scanner: upgrade from Java 11 to 17

https://gerrit.wikimedia.org/r/971906

Change 971906 merged by jenkins-bot:

[integration/config@master] dockerfiles: sonar-scanner: upgrade from Java 11 to 17

https://gerrit.wikimedia.org/r/971906

I have build the image based on Java 17: docker-registry.wikimedia.org/sonar-scanner:4.6.0.2311-7.

Thank you @hashar I will monitor the codehealth jobs to ensure they are running smoothly.

Change 971919 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] jjb: use Java 17 for MediaWiki core codehealth jobs

https://gerrit.wikimedia.org/r/971919

Change 971920 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] jjb: use Java 17 for extensions codehealth jobs

https://gerrit.wikimedia.org/r/971920

Change 971919 merged by jenkins-bot:

[integration/config@master] jjb: use Java 17 for MediaWiki core codehealth jobs

https://gerrit.wikimedia.org/r/971919

I have updated the two jobs that runs for mediawiki/core

If the Sonar scanner works with Java 17 we can then update the jobs which trigger for MediaWiki extensions using https://gerrit.wikimedia.org/r/971920 :)

Looking at the reports for mediawiki/core on https://sonarcloud.io/project/overview?id=mediawiki-core , it looks like the switch to Java 17 works. I guess we can now update the Jenkins jobs used for extensions?

It seems to be working fine with our sonar scanner version. We can go ahead and update extensions Jenkins jobs.

Change 971920 merged by jenkins-bot:

[integration/config@master] jjb: use Java 17 for extensions codehealth jobs

https://gerrit.wikimedia.org/r/971920

Jdforrester-WMF claimed this task.
Jdforrester-WMF subscribed.

It seems to be working fine with our sonar scanner version. We can go ahead and update extensions Jenkins jobs.

Done.

Change 1001958 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[research/mwaddlink@main] build: Use Java 17 for codehealth job

https://gerrit.wikimedia.org/r/1001958

Change 1001958 abandoned by Kosta Harlan:

[research/mwaddlink@main] [WIP] blubber: support Java 17 for codehealth job

Reason:

I465b73664b087c96fe6a056bc642b00b726a0c27

https://gerrit.wikimedia.org/r/1001958