-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.504.1
Active Choice Plugin 2.8.8
In a build which contains an activeChoice checkbox param, there is a problem when the build is triggered by a push or any event that don't give any parameters.
If the script that provide the checkbox list is in sandbox mode, then a default value of the environnement variable is filled with the first item value.
Exemple with this simple Jenkinsfile :
pipeline {
agent any
parameters {
activeChoice(name: 'environnements', choiceType: 'PT_CHECKBOX', filterLength: 1, filterable: false, script: groovyScript(script: [sandbox: true, script: "return ['devA','devB','devC']", classpath: []]))
}
stages {
stage('Hello') {
steps {
echo 'Parameters :'
sh "env -0 | sort -zfi | tr '\\0' '\\n' | sed 's/^/ /'"
}
}
}
}
The log provide to the environnements envvar the value "devA".
environnements=devA
Nota : By setting the sandbox to "false", this behaviour disappear and all is OK but not secured.