From 4489dd184cb22775f191ab4e8e4fa674e0514d36 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Fri, 13 Mar 2026 19:00:04 +0100 Subject: [PATCH] [Build] Fix nightly build TP and drop unused upstream trigger handling Upstream builds that trigger the Xtext Jenkins pipelines do not exist anymore and therefore isTriggeredByUpstream() always returns false. With that assumption the pipline can be simplify and also selectedTargetPlatform() can be removed. The latter returned an erroneous tp file name fragment anyways if it where called by an upstream job. --- Jenkinsfile | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0bd833041a7..ee726bd0d6c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { triggers { parameterizedCron(env.BRANCH_NAME == 'main' ? ''' - H H(0-1) * * * %TARGET_PLATFORM=r202403;JDK_VERSION=21 + H H(0-1) * * * %TARGET_PLATFORM=r202512;JDK_VERSION=21 H H(3-4) * * * %TARGET_PLATFORM=latest;JDK_VERSION=25 ''' : '') } @@ -72,7 +72,7 @@ pipeline { export JAVA_${javaVersion()}_HOME='' jdkEnvVar='JAVA_HOME' fi - ./full-build.sh --tp=${selectedTargetPlatform()} \ + ./full-build.sh --tp=${params.TARGET_PLATFORM} \ -Pstrict-jdk-${javaVersion()} -Dtoolchain.jdk.env=\${jdkEnvVar} """ } @@ -146,17 +146,12 @@ def javaVersion() { return Integer.parseInt(params.JDK_VERSION) } -/** returns true when this build was triggered by an upstream build */ -def isTriggeredByUpstream() { - return !"[]".equals(currentBuild.getBuildCauses('org.jenkinsci.plugins.workflow.support.steps.build.BuildUpstreamCause').toString()) -} - /** * Returns the Eclipse version dependent on the selected target platform. * Result: '4.XX' */ def eclipseVersion() { - def targetPlatform = selectedTargetPlatform() + def targetPlatform = params.TARGET_PLATFORM if (targetPlatform == 'latest') { return "4.40" } else { @@ -167,24 +162,3 @@ def eclipseVersion() { return "4."+ (8+(monthsBetween/3)) } } - -/** - * The target platform is primarily defined by the build parameter TARGET_PLATFORM. - * But when the build is triggered by upstream with at least Java version 21, 'latest' - * is returned. - */ -def selectedTargetPlatform() { - def tp = params.TARGET_PLATFORM - def isUpstream = isTriggeredByUpstream() - def javaVersion = javaVersion() - - if (isTriggeredByUpstream() && javaVersion>=25) { - println("Choosing 'latest' target since this build was triggered by upstream with Java ${javaVersion}") - return 'latest' - } else if (isTriggeredByUpstream() && javaVersion>=21) { - println("Choosing 'r2025-12' target since this build was triggered by upstream with Java ${javaVersion}") - return 'r2025-12' - } else { - return tp - } -}