Skip to content

Commit b91d9ec

Browse files
committed
HHH-18846 Enable release automation for ORM 6.6
1 parent b5178d0 commit b91d9ec

File tree

7 files changed

+90
-411
lines changed

7 files changed

+90
-411
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: GH Actions CI
22

33
on:
4-
push:
5-
branches:
6-
- '6.6'
74
pull_request:
85
branches:
96
- '6.6'

.github/workflows/codeql.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: "CodeQL"
22

33
on:
4-
push:
5-
branches: [ '6.6' ]
64
pull_request:
7-
# The branches below must be a subset of the branches above
85
branches: [ '6.6' ]
96
schedule:
107
- cron: '34 11 * * 4'

Jenkinsfile

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,21 @@ stage('Configure') {
2828
requireApprovalForPullRequest 'hibernate'
2929

3030
this.environments = [
31-
// new BuildEnvironment( dbName: 'h2' ),
32-
// new BuildEnvironment( dbName: 'hsqldb' ),
33-
// new BuildEnvironment( dbName: 'derby' ),
34-
// new BuildEnvironment( dbName: 'mysql' ),
35-
// new BuildEnvironment( dbName: 'mariadb' ),
36-
// new BuildEnvironment( dbName: 'postgresql' ),
37-
// new BuildEnvironment( dbName: 'edb' ),
38-
// new BuildEnvironment( dbName: 'oracle' ),
39-
// new BuildEnvironment( dbName: 'db2' ),
40-
// new BuildEnvironment( dbName: 'mssql' ),
41-
// new BuildEnvironment( dbName: 'sybase' ),
42-
// Don't build with HANA by default, but only do it nightly until we receive a 3rd instance
43-
// new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ),
4431
new BuildEnvironment( node: 's390x' ),
45-
new BuildEnvironment( dbName: 'tidb', node: 'tidb',
46-
notificationRecipients: '[email protected]' ),
32+
new BuildEnvironment( dbName: 'sybase_jconn' ),
4733
new BuildEnvironment( testJdkVersion: '17' ),
34+
new BuildEnvironment( testJdkVersion: '21' ),
4835
// We want to enable preview features when testing newer builds of OpenJDK:
4936
// even if we don't use these features, just enabling them can cause side effects
5037
// and it's useful to test that.
51-
new BuildEnvironment( testJdkVersion: '20', testJdkLauncherArgs: '--enable-preview' ),
52-
new BuildEnvironment( testJdkVersion: '21', testJdkLauncherArgs: '--enable-preview' ),
38+
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview' ),
5339
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
5440
// they require the use of -Dnet.bytebuddy.experimental=true.
5541
// Make sure to remove that argument as soon as possible
5642
// -- generally that requires upgrading bytebuddy after the JDK goes GA.
57-
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true' ),
5843
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true' )
5944
];
6045

61-
if ( env.CHANGE_ID ) {
62-
if ( pullRequest.labels.contains( 'cockroachdb' ) ) {
63-
this.environments.add( new BuildEnvironment( dbName: 'cockroachdb', node: 'cockroachdb', longRunning: true ) )
64-
}
65-
if ( pullRequest.labels.contains( 'hana' ) ) {
66-
this.environments.add( new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ) )
67-
}
68-
if ( pullRequest.labels.contains( 'sybase' ) ) {
69-
this.environments.add( new BuildEnvironment( dbName: 'sybase_jconn' ) )
70-
}
71-
}
72-
7346
helper.configure {
7447
file 'job-configuration.yaml'
7548
// We don't require the following, but the build helper plugin apparently does
@@ -97,15 +70,17 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
9770
currentBuild.result = 'NOT_BUILT'
9871
return
9972
}
73+
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
74+
if ( !env.CHANGE_ID ) {
75+
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
76+
currentBuild.result = 'NOT_BUILT'
77+
return
78+
}
10079

10180
stage('Build') {
10281
Map<String, Closure> executions = [:]
10382
Map<String, Map<String, String>> state = [:]
10483
environments.each { BuildEnvironment buildEnv ->
105-
// Don't build environments for newer JDKs when this is a PR
106-
if ( helper.scmSource.pullRequest && buildEnv.testJdkVersion ) {
107-
return
108-
}
10984
state[buildEnv.tag] = [:]
11085
executions.put(buildEnv.tag, {
11186
runBuildOnNode(buildEnv.node ?: NODE_PATTERN_BASE) {
@@ -198,6 +173,9 @@ stage('Build') {
198173
}
199174
})
200175
}
176+
executions.put('Hibernate Search Update Dependency', {
177+
build job: '/hibernate-search-dependency-update/7.2', propagate: true, parameters: [string(name: 'UPDATE_JOB', value: 'orm6.6'), string(name: 'ORM_REPOSITORY', value: helper.scmSource.remoteUrl), string(name: 'ORM_PULL_REQUEST_ID', value: helper.scmSource.pullRequest.id)]
178+
})
201179
parallel(executions)
202180
}
203181

ci/jpa-3.1-tck.Jenkinsfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
66
currentBuild.result = 'NOT_BUILT'
77
return
88
}
9-
def throttleCount
10-
// Don't build the TCK on PRs, unless they use the tck label
11-
if ( env.CHANGE_ID != null ) {
12-
if ( !pullRequest.labels.contains( 'tck' ) ) {
13-
print "INFO: Build skipped because pull request doesn't have 'tck' label"
14-
return
15-
}
16-
throttleCount = 20
17-
}
18-
else {
19-
throttleCount = 1
9+
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
10+
if ( !env.CHANGE_ID ) {
11+
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
12+
currentBuild.result = 'NOT_BUILT'
13+
return
2014
}
2115

2216
pipeline {
@@ -27,7 +21,6 @@ pipeline {
2721
jdk 'OpenJDK 11 Latest'
2822
}
2923
options {
30-
rateLimitBuilds(throttle: [count: throttleCount, durationName: 'day', userBoost: true])
3124
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
3225
disableConcurrentBuilds(abortPrevious: true)
3326
}

ci/quarkus.Jenkinsfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
@Library('[email protected]') _
2+
3+
// Avoid running the pipeline on branch indexing
4+
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
5+
print "INFO: Build skipped due to trigger being Branch Indexing"
6+
currentBuild.result = 'NOT_BUILT'
7+
return
8+
}
9+
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
10+
if ( !env.CHANGE_ID ) {
11+
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
12+
currentBuild.result = 'NOT_BUILT'
13+
return
14+
}
15+
16+
pipeline {
17+
agent {
18+
label 'LongDuration'
19+
}
20+
tools {
21+
jdk 'OpenJDK 17 Latest'
22+
}
23+
options {
24+
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
25+
disableConcurrentBuilds(abortPrevious: true)
26+
skipDefaultCheckout()
27+
}
28+
stages {
29+
stage('Build') {
30+
steps {
31+
script {
32+
dir('hibernate') {
33+
checkout scm
34+
sh "./gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com --no-daemon -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
35+
script {
36+
env.HIBERNATE_VERSION = sh (
37+
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
38+
returnStdout: true
39+
).trim()
40+
}
41+
}
42+
dir('quarkus') {
43+
sh "git clone -b 3.15 --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
44+
sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml"
45+
// Need to override the default maven configuration this way, because there is no other way to do it
46+
sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
47+
sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
48+
withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy:'EXPLICIT') {
49+
sh "./mvnw -pl !docs -Dquickly install"
50+
// Need to kill the gradle daemons started during the Maven install run
51+
sh "sudo pkill -f '.*GradleDaemon.*' || true"
52+
// Need to override the default maven configuration this way, because there is no other way to do it
53+
sh "sed -i 's/-Xmx2048m/-Xmx1340m/' ./.mvn/jvm.config"
54+
sh "sed -i 's/MaxMetaspaceSize=1024m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
55+
def excludes = "'!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/maven,!integration-tests/quartz,!integration-tests/reactive-messaging-kafka,!integration-tests/resteasy-reactive-kotlin/standard,!integration-tests/opentelemetry-reactive-messaging,!integration-tests/virtual-threads/kafka-virtual-threads,!integration-tests/smallrye-jwt-oidc-webapp,!docs'"
56+
sh "TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED=true ./mvnw -Dinsecure.repositories=WARN -pl :quarkus-hibernate-orm -amd -pl ${excludes} verify -Dstart-containers -Dtest-containers -Dskip.gradle.build"
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
post {
64+
always {
65+
configFileProvider([configFile(fileId: 'job-configuration.yaml', variable: 'JOB_CONFIGURATION_FILE')]) {
66+
notifyBuildResult maintainers: (String) readYaml(file: env.JOB_CONFIGURATION_FILE).notification?.email?.recipients
67+
}
68+
}
69+
}
70+
}

ci/release/Jenkinsfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.hibernate.jenkins.pipeline.helpers.version.Version
1717
// Global build configuration
1818
env.PROJECT = "orm"
1919
env.JIRA_KEY = "HHH"
20-
def RELEASE_ON_PUSH = false // Set to `true` *only* on branches where you want a release on each push.
20+
def RELEASE_ON_PUSH = true // Set to `true` *only* on branches where you want a release on each push.
2121

2222
print "INFO: env.PROJECT = ${env.PROJECT}"
2323
print "INFO: env.JIRA_KEY = ${env.JIRA_KEY}"
@@ -123,7 +123,8 @@ pipeline {
123123
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true)
124124
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
125125
print "INFO: Automatic release skipped because last commits were for the previous release"
126-
currentBuild.result = 'ABORTED'
126+
currentBuild.getRawBuild().getExecutor().interrupt(Result.NOT_BUILT)
127+
sleep(1) // Interrupt is not blocking and does not take effect immediately.
127128
return
128129
}
129130

0 commit comments

Comments
 (0)