-
Type:
Task
-
Resolution: Done
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Java Drivers
-
None
-
None
-
None
-
None
-
None
-
None
The CodeQL Java scan on main has been failing since Nov 10 (example run: https://github.com/mongodb/mongo-java-driver/actions/runs/43884713635).
GitHub's ubuntu-latest runner now points to ubuntu-26.04, which defaults to JDK 25. Our Gradle 8.12 cannot run on JDK 25, so the CodeQL autobuild fails.
Proposed fix
Use an explicit CodeQL workflow configuration that pins the JDK, as in mongo-hibernate (see HIBERNATE-247): https://github.com/mongodb/mongo-hibernate/blob/main/.github/workflows/codeql.yml
Add a setup-java step before the CodeQL steps, pinned to Java 17. The Gradle toolchain is pinned to 17 and settings.gradle.kts registers no toolchain resolver, so the JDK must already be on the runner.
steps: \- if: matrix.language == 'java\-kotlin' uses: actions/setup\-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: distribution: temurin java\-version: 17
For mongo-hibernate a manual config to analyze release tags was also added; consider whether to do the same here.
Acceptance criteria
* CodeQL Java scan on main passes again with the JDK pinned.
* JDK version no longer depends on the ubuntu-latest runner default.
Slack thread: https://mongodb.slack.com/archives/GCKKT44RM/p1794849405415159