Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Generate cache key
id: cache-key
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
build:
permissions:
contents: read
name: OpenJDK 21 - ${{matrix.rdbms}}
name: OpenJDK 25 - ${{matrix.rdbms}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -63,11 +63,11 @@ jobs:
env:
RDBMS: ${{ matrix.rdbms }}
run: ci/database-start.sh
- name: Set up Java 21
- name: Set up Java 25
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Generate cache key
id: cache-key
Expand Down Expand Up @@ -161,11 +161,11 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Java 21
- name: Set up Java 25
uses: graalvm/setup-graalvm@aafbedb8d382ed0ca6167d3a051415f20c859274 # v1.2.8
with:
distribution: 'graalvm'
java-version: '21'
java-version: '25'
- name: Generate cache key
id: cache-key
run: |
Expand Down Expand Up @@ -270,11 +270,11 @@ jobs:
persist-credentials: false
- name: Reclaim disk space and sanitize user home
run: .github/ci-prerequisites-atlas.sh
- name: Set up Java 21
- name: Set up Java 25
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Generate cache key
id: cache-key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
13 changes: 7 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
@Library('hibernate-jenkins-pipeline-helpers') _
import org.hibernate.jenkins.pipeline.helpers.job.JobHelper

@Field final String DEFAULT_JDK_VERSION = '21'
@Field final String DEFAULT_JDK_VERSION = '25'
@Field final String DEFAULT_JDK_TOOL = "OpenJDK ${DEFAULT_JDK_VERSION} Latest"
@Field final String NODE_PATTERN_BASE = 'Worker&&Containers'
@Field List<BuildEnvironment> environments
Expand All @@ -40,13 +40,14 @@ stage('Configure') {
// Don't build with HANA by default, but only do it nightly until we receive a 3rd instance
// new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ),
new BuildEnvironment( node: 's390x' ),
// We generally build with JDK 21, but our baseline is Java 17, so we test with JDK 17, to be sure everything works.
// Here we even compile the main code with JDK 17, to be sure no JDK 18+ classes are depended on.
Copy link
Member

Choose a reason for hiding this comment

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

I wonder what's the history behind this and how bad it is to lose it... checking

Copy link
Member

@yrodiere yrodiere Oct 27, 2025

Choose a reason for hiding this comment

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

This is the reason: #hibernate-orm-dev > JDK builds @ 💬

TLDR: people will unknowningly using JDK 18+ APIs if we don't have a job that compiles the main code with JDK 17.

So I'd recommend something like this?

		// We generally build with JDK 25, but our baseline is Java 17, so we test with earlier JDKs, to be sure everything works.
		// We also compile the main code with JDK 17 once, to be sure no JDK 18+ classes are depended on.
		// See https://hibernate.zulipchat.com/#narrow/channel/132094-hibernate-orm-dev/topic/JDK.20builds/near/524436141
		new BuildEnvironment( mainJdkVersion: '17', testJdkVersion: '17', additionalOptions: 'something that skips javadoc' ),
		new BuildEnvironment( testJdkVersion: '21' ),

Copy link
Member Author

Choose a reason for hiding this comment

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

So the s390x bit aside, this is for the most part working.

As for this desire to run one job with mainJdkVersion=17, there are 2 "problems"...

  1. Each of these BuildEnvironments trigger running against H2. ci/build.sh always accounts for H2 using the problematic tasks. Your "something that skips javadoc" would need to get accounted for there. That's easy, but for completeness..
  2. Per our other conversation here, we changed the minimum JDK to be 25. Attempting to use a JDK earlier than 25 now results in an error. The hacky approach there would be to literally pass -Porm.jdk.min=17 for this one job. Coupled with the solution for (1), we aren't building the Javadoc so no harm, no foul.

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. Each of these BuildEnvironments trigger running against H2. ci/build.sh always accounts for H2 using the problematic tasks. Your "something that skips javadoc" would need to get accounted for there. That's easy, but for completeness..

In fact, for all of these H2 jobs from Jenkins we should always just skip javadoc generation. Stated more correctly, for these jobs from Jenkins we should treat them like the non-H2 jobs from GH workflow in terms of executing just ciCheck instead of ciCheck preVerifyRelease

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll try to hack something but this Jenkinsfile syntax is bizarre to me :)

new BuildEnvironment( mainJdkVersion: '17', testJdkVersion: '17' ),
// We generally build with JDK 25, but our baseline is Java 17, so we test with JDK 17, to be sure everything works.
new BuildEnvironment( mainJdkVersion: '25', testJdkVersion: '17' ),
// Additionally, have one job that builds using JDK 17 as well
new BuildEnvironment( mainJdkVersion: '17', additionalOptions: '-Porm.jdk.min=17' ),
new BuildEnvironment( mainJdkVersion: '25', testJdkVersion: '21' ),
// We want to enable preview features when testing newer builds of OpenJDK:
// even if we don't use these features, just enabling them can cause side effects
// and it's useful to test that.
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
// they require the use of -Dnet.bytebuddy.experimental=true.
Expand Down Expand Up @@ -170,7 +171,7 @@ stage('Build') {
}
stage('Test') {
String args = "${buildEnv.additionalOptions ?: ''} ${state[buildEnv.tag]['additionalOptions'] ?: ''}"
withEnv(["RDBMS=${buildEnv.dbName}"]) {
withEnv(["RDBMS=${buildEnv.dbName}", 'CI_SYSTEM=jenkins']) {
tryFinally({
if (buildEnv.dbLockableResource == null) {
withCredentials([file(credentialsId: 'sybase-jconnect-driver', variable: 'jconnect_driver')]) {
Expand Down
9 changes: 6 additions & 3 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
goal=
if [ "$RDBMS" == "h2" ] || [ "$RDBMS" == "" ]; then
# This is the default.
goal="preVerifyRelease"
# Settings needed for `preVerifyRelease` execution - for asciidoctor doc rendering
export GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'
# - special check for Jenkins CI jobs where we don't want to run preVerifyRelease
if [[-n "$CI_SYSTEM" && "$CI_SYSTEM" != "jenkins"]]; then
goal="preVerifyRelease"
# Settings needed for `preVerifyRelease` execution - for asciidoctor doc rendering
export GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'
fi
Comment on lines 5 to 11
Copy link
Member

Choose a reason for hiding this comment

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

I think you wanted [[ -n "$CI_SYSTEM" || "$CI_SYSTEM" != "jenkins" ]]? (Note the space after [[, it's important)

Though this begs the question: shouldn't calling preVerifyRelease and adding these settings be the exception, e.g. added explicitly in one of the GH Actions jobs, while leaving the default to... whatever the default task is in our Gradle build?

Copy link
Member Author

Choose a reason for hiding this comment

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

If I understand what you are asking, that's what happens - now (once this check is correct).

Previously, ci/build.sh would simply check for H2 and always trigger preVerifyRelease. However, we have a few CI jobs that use H2 -

  1. The Git Hub job
  2. These Jenkins JDK jobs

Previously, each of those would trigger preVerifyRelease because, again, ci/build.sh would simply check for H2.

Copy link
Member

Choose a reason for hiding this comment

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

I was suggesting moving this out of this script and directly into the GH Actions script where it's needed. We can just call:

 export GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8
./ci/build.sh preVerifyRelease

Yes in practice that's the same -- except if calling build.sh locally.

elif [ "$RDBMS" == "hsqldb" ] || [ "$RDBMS" == "hsqldb_2_6" ]; then
goal="-Pdb=hsqldb"
elif [ "$RDBMS" == "mysql" ] || [ "$RDBMS" == "mysql_8_0" ]; then
Expand Down
4 changes: 2 additions & 2 deletions ci/jpa-3.2-tck.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ else {
pipeline {
agent none
tools {
jdk 'OpenJDK 21 Latest'
jdk 'OpenJDK 25 Latest'
}
options {
rateLimitBuilds(throttle: [count: throttleCount, durationName: 'day', userBoost: true])
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true)
}
parameters {
choice(name: 'IMAGE_JDK', choices: ['jdk17', 'jdk21'], description: 'The JDK base image version to use for the TCK image.')
choice(name: 'IMAGE_JDK', choices: ['jdk17', 'jdk25'], description: 'The JDK base image version to use for the TCK image.')
string(name: 'TCK_VERSION', defaultValue: '3.2.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
string(name: 'TCK_SHA', defaultValue: '', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
string(name: 'TCK_URL', defaultValue: 'https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee11/staged/eftl/jakarta-persistence-tck-3.2.0.zip&mirror_id=1', description: 'The URL from which to download the TCK ZIP file. Only needed for testing staged builds. Ensure the TCK_VERSION variable matches the ZIP file name suffix.')
Expand Down
2 changes: 1 addition & 1 deletion ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pipeline {
cron('0 0 * * 0')
}
tools {
jdk 'OpenJDK 21 Latest'
jdk 'OpenJDK 25 Latest'
}
options {
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
Expand Down
2 changes: 1 addition & 1 deletion ci/snapshot-publish.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline {
label 'Release'
}
tools {
jdk 'OpenJDK 21 Latest'
jdk 'OpenJDK 25 Latest'
}
options {
rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true])
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ org.gradle.java.installations.auto-download=false

# externalized definition of JDK versions so that they are available in both Project (build.gradle) and Settings (settings.gradle)
orm.jdk.base=17
orm.jdk.min=21
orm.jdk.min=25
# See gradlew/wrapper/gradle-wrapper.properties, https://docs.gradle.org/current/userguide/compatibility.html#java_runtime
orm.jdk.max=22
orm.jdk.max=25

# The minimum version of Gradle supported for the ORM Gradle plugin.
# This is the version used in the plugin tests, used to make sure we do not break compatibility.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ test {
"--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED")
}

if ( jdkVersions.test.launcher.asInt() > 21 ) {
project.logger.lifecycle( "Skipping {} tests for JDK version {}", project.name, jdkVersions.test.launcher.asInt() )
tasks.getByName( "test" ).enabled = false
}

def releasePrepareTask = tasks.register("releasePrepare") {
group "release-prepare"
description "See :release:releasePrepare for details. Here we hook in the `check` task."
Expand Down