Skip to content

[#188] Set up the JDK of the release for the CodeQL Java analysis, so that its results no longer follow the default JDK of the runner image - #189

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix/188-codeql-jdk
Oct 22, 2026
Merged

vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:fix/188-codeql-jdk

Conversation

@vharseko

@vharseko vharseko commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Fixes #188

Problem

The java-kotlin job of the CodeQL workflow runs with build-mode: none and sets up no JDK. CodeQL infers no JDK from the project (No specific JDK inferred from the project being analysed; using the java on the PATH), so it models the JDK API on the default java of the runner image. On 2026-10-19 ubuntu-latest moved from ubuntu-24.04 to ubuntu-26.04, and that java changed from 17 to 25. Code scanning then opened alerts for APIs deprecated only after Java 11, the version the release is built with. The details are in #188.

Fix

  • Before Initialize CodeQL, the java-kotlin job sets up the JDK that the release is built with, with the actions/setup-java parameters of release.yml: temurin, 8 on sustaining/5.4.x and 11 otherwise. The branch is taken from github.base_ref for a pull request and from github.ref_name for a push.
  • The commented-out JDK step of the manual build section is removed. If that build is turned on, the new step serves it.

The other languages do not use the step. The same change for OpenDJ is OpenIdentityPlatform/OpenDJ#1232.

The alignment that #188 proposes first — actions/setup-java@v6 in build.yml, deploy.yml and release.yml, a .github/dependabot.yml with weekly grouped GitHub Actions updates, and the CDDL header of the workflow files — reached master with #170, so this PR no longer carries it.

Test

The change only takes effect in a CodeQL run, so the CodeQL run of this PR is the test. The java-kotlin job log must show Java version: 11... from Eclipse Adoptium, where master shows Java version: 25.0.4.1.

A pull request analysis only reports results on the changed lines, so it cannot show the alerts going away. They are closed by the first analysis of master after the merge.

@vharseko vharseko added bug dependencies Pull requests that update a dependency file security Security fixes and CVE / vulnerability updates ci Build, CI/CD, and GitHub Actions changes labels Oct 22, 2026
@vharseko
vharseko requested a review from maximthomas October 22, 2026 10:27

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The fix is in the right place, and the PR's own test criterion holds.

  • .github/workflows/codeql.yml:80-85 sets up Temurin before Initialize CodeQL. The PR's Analyze (java-kotlin) log shows "Setting Java 11.0.32+1 as the default", then "No specific JDK inferred from the project being analysed; using the java on the PATH" and Java version: 11.0.32.1, vendor: Eclipse Adoptium. The JDK API model is now 11, not the image's 25.
  • (github.base_ref || github.ref_name) handles both pull_request runs (base branch) and push/schedule/dispatch runs (ref) in one expression.

…QL Java analysis, so that its results no longer follow the default JDK of the runner image

Fixes OpenIdentityPlatform#188

With build-mode 'none' CodeQL infers no JDK from the project and models
the JDK API on the java found on the PATH. When ubuntu-latest moved to
ubuntu-26.04 on 2026-10-19 that java became 25 instead of 17, and code
scanning opened alerts for APIs deprecated only after Java 11, the
version the release is built with.

The java-kotlin job now sets up the JDK of the release before Initialize
CodeQL, with the setup-java parameters of release.yml: temurin, 8 on
sustaining/5.4.x and 11 otherwise.

The commented-out JDK step of the manual build is gone, since the step
now serves it too.
@vharseko
vharseko merged commit 25eca8d into OpenIdentityPlatform:master Oct 22, 2026
12 checks passed
@vharseko
vharseko deleted the fix/188-codeql-jdk branch October 22, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci Build, CI/CD, and GitHub Actions changes dependencies Pull requests that update a dependency file security Security fixes and CVE / vulnerability updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CodeQL: the Java analysis takes its JDK from the runner image, which moved from Java 17 to 25 with ubuntu-26.04

2 participants