From 56bbed3593fc4b159798ba640b1e6cf96285473b Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 13 Jan 2020 09:31:39 -0800 Subject: [PATCH] Fix build scan logic to support folder nested Jenkins job names Signed-off-by: Mark Vieira --- gradle/build-scan.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle/build-scan.gradle b/gradle/build-scan.gradle index 9e726adb046..4281b794e76 100644 --- a/gradle/build-scan.gradle +++ b/gradle/build-scan.gradle @@ -37,11 +37,11 @@ buildScan { // Parse job name in the case of matrix builds // Matrix job names come in the form of "base-job-name/matrix_param1=value1,matrix_param2=value2" def splitJobName = jobName.split('/') - if (splitJobName.length == 2) { - tag splitJobName[0] - tag splitJobName[1] - value 'Job Name', splitJobName[0] - def matrixParams = splitJobName[1].split(',') + if (splitJobName.length > 1 && splitJobName.last() ==~ /^([a-zA-Z0-9_\-]+=[a-zA-Z0-9_\-]+,?)+$/) { + def baseJobName = splitJobName.dropRight(1).join('/') + tag baseJobName + value 'Job Name', baseJobName + def matrixParams = splitJobName.last().split(',') matrixParams.collect { it.split('=') }.each { param -> value "MATRIX_${param[0].toUpperCase()}", param[1] }