Skip to content

Commit

Permalink
Simplify the source check logic configuration in a CI upgrade job
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta authored and yrodiere committed Sep 29, 2023
1 parent e72fafe commit 96209e6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ci/dependency-update/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,24 @@ Map settings() {
return [
updateProperties: ['version.org.hibernate.orm'],
onlyRunTestDependingOn: ['hibernate-search-mapper-orm'],
requiresSourceModifications: true,
// we need to recompile this module since it has incompatible return type and will result in a build error:
additionalMavenArgs: '-pl :hibernate-search-util-internal-integrationtest-mapper-orm'
]
case 'lucene9.8':
return [
updateProperties: ['version.org.apache.lucene'],
onlyRunTestDependingOn: ['hibernate-search-backend-lucene'],
requiresSourceModifications: true
]
case 'lucene9':
return [
updateProperties: ['version.org.apache.lucene'],
onlyRunTestDependingOn: ['hibernate-search-backend-lucene'],
requiresSourceModifications: true,
additionalMavenArgs: '-Dtest.elasticsearch.skip=true'
]
case 'lucene10':
return [
updateProperties: ['version.org.apache.lucene'],
onlyRunTestDependingOn: ['hibernate-search-backend-lucene'],
requiresSourceModifications: true,
additionalMavenArgs: '-Dtest.elasticsearch.skip=true'
]
case 'elasticsearch-latest':
Expand All @@ -46,7 +42,7 @@ Map settings() {
// We want to use the snapshot version of an image from the ES registry since that's where they are publishing their snapshots.
additionalMavenArgs: '-Dtest.elasticsearch.run.elastic.image.name=docker.elastic.co/elasticsearch/elasticsearch -Dtest.elasticsearch.run.elastic.image.tag=master-SNAPSHOT',
// This job won't change the versions in the pom. We are passing the latest Elasticsearch version through an additional maven argument `-D`
requiresSourceModifications: false,
skipSourceModifiedCheck: true,
additionalMavenArgs: '-Dtest.lucene.skip=true'
]
default:
Expand Down Expand Up @@ -172,7 +168,7 @@ pipeline {
sh "ci/dependency-update/perform-update.sh ${env.DEPENDENCY_UPDATE_NAME} '${settings().updateProperties?.join(",") ?: ''}'"
}
script {
if (settings().requiresSourceModifications && 0 != sh(script: "git diff origin/${BRANCH_NAME} | grep -q '.'", returnStatus: true)) {
if (!settings().skipSourceModifiedCheck && 0 != sh(script: "git diff origin/${BRANCH_NAME} | grep -q '.'", returnStatus: true)) {
error "This job does not seem to update any dependency; perhaps it is misconfigured? The source code has not been updated, neither by merging a WIP branch nor by updating version properties."
}
}
Expand Down

0 comments on commit 96209e6

Please sign in to comment.