Skip to content

Commit

Permalink
HHH-18846 Enable release automation for ORM 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Nov 21, 2024
1 parent b5178d0 commit b91d9ec
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 411 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: GH Actions CI

on:
push:
branches:
- '6.6'
pull_request:
branches:
- '6.6'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: "CodeQL"

on:
push:
branches: [ '6.6' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ '6.6' ]
schedule:
- cron: '34 11 * * 4'
Expand Down
46 changes: 12 additions & 34 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,21 @@ stage('Configure') {
requireApprovalForPullRequest 'hibernate'

this.environments = [
// new BuildEnvironment( dbName: 'h2' ),
// new BuildEnvironment( dbName: 'hsqldb' ),
// new BuildEnvironment( dbName: 'derby' ),
// new BuildEnvironment( dbName: 'mysql' ),
// new BuildEnvironment( dbName: 'mariadb' ),
// new BuildEnvironment( dbName: 'postgresql' ),
// new BuildEnvironment( dbName: 'edb' ),
// new BuildEnvironment( dbName: 'oracle' ),
// new BuildEnvironment( dbName: 'db2' ),
// new BuildEnvironment( dbName: 'mssql' ),
// new BuildEnvironment( dbName: 'sybase' ),
// 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' ),
new BuildEnvironment( dbName: 'tidb', node: 'tidb',
notificationRecipients: '[email protected]' ),
new BuildEnvironment( dbName: 'sybase_jconn' ),
new BuildEnvironment( testJdkVersion: '17' ),
new BuildEnvironment( 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: '20', testJdkLauncherArgs: '--enable-preview' ),
new BuildEnvironment( testJdkVersion: '21', testJdkLauncherArgs: '--enable-preview' ),
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview' ),
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
// they require the use of -Dnet.bytebuddy.experimental=true.
// Make sure to remove that argument as soon as possible
// -- generally that requires upgrading bytebuddy after the JDK goes GA.
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true' ),
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true' )
];

if ( env.CHANGE_ID ) {
if ( pullRequest.labels.contains( 'cockroachdb' ) ) {
this.environments.add( new BuildEnvironment( dbName: 'cockroachdb', node: 'cockroachdb', longRunning: true ) )
}
if ( pullRequest.labels.contains( 'hana' ) ) {
this.environments.add( new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ) )
}
if ( pullRequest.labels.contains( 'sybase' ) ) {
this.environments.add( new BuildEnvironment( dbName: 'sybase_jconn' ) )
}
}

helper.configure {
file 'job-configuration.yaml'
// We don't require the following, but the build helper plugin apparently does
Expand Down Expand Up @@ -97,15 +70,17 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
currentBuild.result = 'NOT_BUILT'
return
}
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
if ( !env.CHANGE_ID ) {
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
currentBuild.result = 'NOT_BUILT'
return
}

stage('Build') {
Map<String, Closure> executions = [:]
Map<String, Map<String, String>> state = [:]
environments.each { BuildEnvironment buildEnv ->
// Don't build environments for newer JDKs when this is a PR
if ( helper.scmSource.pullRequest && buildEnv.testJdkVersion ) {
return
}
state[buildEnv.tag] = [:]
executions.put(buildEnv.tag, {
runBuildOnNode(buildEnv.node ?: NODE_PATTERN_BASE) {
Expand Down Expand Up @@ -198,6 +173,9 @@ stage('Build') {
}
})
}
executions.put('Hibernate Search Update Dependency', {
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)]
})
parallel(executions)
}

Expand Down
17 changes: 5 additions & 12 deletions ci/jpa-3.1-tck.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
currentBuild.result = 'NOT_BUILT'
return
}
def throttleCount
// Don't build the TCK on PRs, unless they use the tck label
if ( env.CHANGE_ID != null ) {
if ( !pullRequest.labels.contains( 'tck' ) ) {
print "INFO: Build skipped because pull request doesn't have 'tck' label"
return
}
throttleCount = 20
}
else {
throttleCount = 1
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
if ( !env.CHANGE_ID ) {
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
currentBuild.result = 'NOT_BUILT'
return
}

pipeline {
Expand All @@ -27,7 +21,6 @@ pipeline {
jdk 'OpenJDK 11 Latest'
}
options {
rateLimitBuilds(throttle: [count: throttleCount, durationName: 'day', userBoost: true])
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true)
}
Expand Down
70 changes: 70 additions & 0 deletions ci/quarkus.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@Library('[email protected]') _

// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'NOT_BUILT'
return
}
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
if ( !env.CHANGE_ID ) {
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
currentBuild.result = 'NOT_BUILT'
return
}

pipeline {
agent {
label 'LongDuration'
}
tools {
jdk 'OpenJDK 17 Latest'
}
options {
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true)
skipDefaultCheckout()
}
stages {
stage('Build') {
steps {
script {
dir('hibernate') {
checkout scm
sh "./gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com --no-daemon -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
script {
env.HIBERNATE_VERSION = sh (
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
returnStdout: true
).trim()
}
}
dir('quarkus') {
sh "git clone -b 3.15 --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml"
// Need to override the default maven configuration this way, because there is no other way to do it
sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy:'EXPLICIT') {
sh "./mvnw -pl !docs -Dquickly install"
// Need to kill the gradle daemons started during the Maven install run
sh "sudo pkill -f '.*GradleDaemon.*' || true"
// Need to override the default maven configuration this way, because there is no other way to do it
sh "sed -i 's/-Xmx2048m/-Xmx1340m/' ./.mvn/jvm.config"
sh "sed -i 's/MaxMetaspaceSize=1024m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
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'"
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"
}
}
}
}
}
}
post {
always {
configFileProvider([configFile(fileId: 'job-configuration.yaml', variable: 'JOB_CONFIGURATION_FILE')]) {
notifyBuildResult maintainers: (String) readYaml(file: env.JOB_CONFIGURATION_FILE).notification?.email?.recipients
}
}
}
}
5 changes: 3 additions & 2 deletions ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.hibernate.jenkins.pipeline.helpers.version.Version
// Global build configuration
env.PROJECT = "orm"
env.JIRA_KEY = "HHH"
def RELEASE_ON_PUSH = false // Set to `true` *only* on branches where you want a release on each push.
def RELEASE_ON_PUSH = true // Set to `true` *only* on branches where you want a release on each push.

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

Expand Down
Loading

0 comments on commit b91d9ec

Please sign in to comment.