Skip to content

[#378] 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 - #379

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/378-codeql-jdk
Oct 22, 2026
Merged

vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/378-codeql-jdk

Conversation

@vharseko

Copy link
Copy Markdown
Member

Fixes #378

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 #378.

Fix

  • build.yml, deploy.yml and release.yml use actions/setup-java@v6, as every workflow of OpenAM, OpenDJ, OpenICF and OpenIDM does. Their inputs (java-version, distribution, server-id, server-username, server-password) are the ones that OpenAM deploys and releases with on v6. Its release of 2026-10-22 ran on v6.
  • .github/dependabot.yml is added, the same as in OpenDJ and OpenIDM: one grouped pull request a week for the GitHub Actions updates, labelled ci and dependencies. This repository had no Dependabot configuration, which is why its actions fell behind.
  • The three workflow files get the CDDL header that the workflows of OpenDJ carry.
  • 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/2.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 file gets the CDDL header that codeql.yml carries in the other projects. It had none.

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

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.

…w and have Dependabot keep the actions up to date, as in the other projects

build.yml, deploy.yml and release.yml still used actions/setup-java@v5.
OpenAM, OpenDJ, OpenICF and OpenIDM use v6 in every workflow, because
Dependabot updates their actions, and this repository had no Dependabot
configuration. The inputs used here (java-version, distribution,
server-id, server-username, server-password) are the ones OpenAM deploys
and releases with on v6.

.github/dependabot.yml now asks for one grouped pull request a week for
the GitHub Actions updates, labelled ci and dependencies, as in OpenDJ and
OpenIDM.

The three workflow files get the CDDL header that the workflows of OpenDJ
carry.
…QL Java analysis, so that its results no longer follow the default JDK of the runner image

Fixes OpenIdentityPlatform#378

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/2.4.x and 11 otherwise.

The commented-out JDK step of the manual build is gone, since the step
now serves it too.

The file gets the CDDL header that codeql.yml carries in the other
projects.
@vharseko vharseko added bug dependencies Pull requests that update a dependency file security Security fixes and CVE remediation ci Build, CI/CD, JDK matrix and workflow changes labels Oct 22, 2026
@vharseko
vharseko requested a review from maximthomas October 22, 2026 10:25

@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 analysis JDK now comes from the workflow instead of the runner image, and the job log shows it.

  • Set up JDK (.github/workflows/codeql.yml:82-87) runs before Initialize CodeQL, only for java-kotlin, with the temurin distribution of release.yml and deploy.yml.
  • This PR's java-kotlin job logs Resolved Java 11.0.32+1 from tool-cache and Java version: 11.0.32.1, vendor: Eclipse Adoptium, while master's push run (0aa455b) logs 25.0.4.1. Both log No specific JDK inferred from the project being analysed; using the java on the PATH, which is the mechanism the description states.

@vharseko
vharseko merged commit a233ff0 into OpenIdentityPlatform:master Oct 22, 2026
14 checks passed
@vharseko
vharseko deleted the fix/378-codeql-jdk branch October 22, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci Build, CI/CD, JDK matrix and workflow changes dependencies Pull requests that update a dependency file security Security fixes and CVE remediation

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