Skip to content

Commit

Permalink
HHH-17981 Automate maintenance releases for 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Apr 24, 2024
1 parent 7401c19 commit 66dbb7a
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 483 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/atlas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
name: Hibernate ORM build-Atlas

on:
push:
branches:
- '6.4'
pull_request:
branches:
- '6.4'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/contributor-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
name: Hibernate ORM build

on:
push:
branches:
- '6.4'
pull_request:
branches:
- '6.4'
Expand Down
46 changes: 12 additions & 34 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,13 @@ this.helper = new JobHelper(this)
helper.runWithNotification {
stage('Configure') {
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: '22', 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.
Expand All @@ -56,18 +41,6 @@ stage('Configure') {
new BuildEnvironment( testJdkVersion: '23', 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 All @@ -91,19 +64,21 @@ stage('Configure') {

// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
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
}

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 @@ -194,6 +169,9 @@ stage('Build') {
}
})
}
executions.put('Hibernate Search Update Dependency', {
build job: '/hibernate-search-dependency-update/7.1', propagate: true, parameters: [string(name: 'UPDATE_JOB', value: 'orm6.4'), string(name: 'ORM_REPOSITORY', value: helper.scmSource.remoteUrl), string(name: 'ORM_PULL_REQUEST_ID', value: helper.scmSource.pullRequest.id)]
})
parallel(executions)
}

Expand Down
21 changes: 7 additions & 14 deletions ci/jpa-3.1-tck.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@

// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'NOT_BUILT'
return
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
99 changes: 0 additions & 99 deletions ci/jpa-3.2-tck.Jenkinsfile

This file was deleted.

64 changes: 64 additions & 0 deletions ci/quarkus.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
@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)
}
stages {
stage('Build') {
steps {
script {
sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com --no-daemon'
script {
env.HIBERNATE_VERSION = sh (
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
returnStdout: true
).trim()
}
dir('.release/quarkus') {
sh "git clone -b 3.8 --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/-Xmx1920m/' ./.mvn/jvm.config"
sh "echo -e '\\n-XX:MaxMetaspaceSize=768m'>>./.mvn/jvm.config"
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/-Xmx1920m/-Xmx1340m/' ./.mvn/jvm.config"
sh "sed -i 's/MaxMetaspaceSize=768m/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 -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
}
}
}
}
9 changes: 5 additions & 4 deletions ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ pipeline {
steps {
script {
// Avoid doing a release for commits from a release
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true)
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true)
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true).trim()
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true).trim()
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
print "INFO: Build skipped because last commits were for the previous release"
currentBuild.result = 'ABORTED'
print "INFO: Release skipped because last commits were for the previous release"
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 66dbb7a

Please sign in to comment.