Skip to content

Commit be407f2

Browse files
authored
Sanitize launchable build name (#11174)
* Launchable rejects a name with embedded '%2F' The '%2F' is a URL encoded '/' and occurs when a branch name with a '/' is pushed to the Jenkins core repository. This first step in the fix is to show that the bug exists. * Sanitize launchable build name
1 parent f73f1f0 commit be407f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Jenkinsfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ stage('Record build') {
2929
/*
3030
* TODO Add the commits of the transitive closure of the Jenkins WAR under test to this build.
3131
*/
32-
sh 'launchable verify && launchable record build --name ${BUILD_TAG} --source jenkinsci/jenkins=.'
32+
// Replace URL encoded characters with '-' because Launchable rejects '%2F' in build name
33+
def launchableName = env.BUILD_TAG.replaceAll('(%[0-9A-Fa-f]{2})+', '-')
34+
sh "launchable verify && launchable record build --name ${launchableName} --source jenkinsci/jenkins=."
3335
axes.values().combinations {
3436
def (platform, jdk) = it
3537
if (platform == 'windows' && jdk != 17) {
3638
return // unnecessary use of hardware
3739
}
3840
def sessionFile = "launchable-session-${platform}-jdk${jdk}.txt"
39-
sh "launchable record session --build ${env.BUILD_TAG} --flavor platform=${platform} --flavor jdk=${jdk} >${sessionFile}"
41+
sh "launchable record session --build ${launchableName} --flavor platform=${platform} --flavor jdk=${jdk} >${sessionFile}"
4042
stash name: sessionFile, includes: sessionFile
4143
}
4244
}

0 commit comments

Comments
 (0)