jjb: Fix crash when trying to launch a job that is not defined
[lttng-ci.git] / scripts / system-tests / system-trigger.groovy
index dc4e9b75d5fbf5405f0c10248acf39f6fde72cd9..c4013daabdf73d3a9f50f656fd1505dd822a608d 100644 (file)
@@ -269,11 +269,15 @@ def CraftJobName = { jobType, linuxBranch, lttngBranch ->
 
 def LaunchJob = { jobName, jobInfo ->
   def job = Hudson.instance.getJob(jobName)
+  if (job == null) {
+    println(String.format("Failed to find job by name '%s'", jobName))
+    return null;
+  }
   def params = []
   for (paramdef in job.getProperty(ParametersDefinitionProperty.class).getParameterDefinitions()) {
     // If there is a default value for this parameter, use it. Don't use empty
     // default value parameters.
-    if (paramdef.getDefaultValue()) {
+    if (paramdef.getDefaultParameterValue() != null) {
       params += paramdef.getDefaultParameterValue();
     }
   }
@@ -304,18 +308,23 @@ def recentLttngBranchesOfInterest = ['master',
   'stable-2.13',
   'stable-2.12']
 def recentLinuxBranchesOfInterest = ['master',
-  'linux-5.16.y',
+  'linux-6.1.y',
   'linux-5.15.y',
   'linux-5.10.y',
   'linux-5.4.y',
   'linux-4.19.y',
   'linux-4.14.y',
-  'linux-4.9.y']
+]
 
 def legacyLttngBranchesOfInterest = []
-def legacyLinuxBranchesOfInterest = []
+def legacyLinuxBranchesOfInterest = [
+    'linux-5.14.y',
+    'linux-4.18.y',
+    'linux-4.12.y',
+    'linux-4.9.y',
+]
 
-def vmLinuxBranchesOfInterest = ['linux-3.18.y']
+def vmLinuxBranchesOfInterest = []
 
 // Generate configurations of interest.
 def configurationOfInterest = [] as Set
@@ -446,7 +455,7 @@ while (ongoingJobs > 0) {
 
     // The isCancelled() method checks if the run was cancelled before
     // execution. We consider such run as being aborted.
-    if (jobBuild.isCancelled()) {
+    if (jobBuild == null || jobBuild.isCancelled()) {
       println("${jobName} was cancelled before launch.")
       isAborted = true;
       abortedRuns.add(jobName);
This page took 0.025723 seconds and 4 git commands to generate.