-
Bug
-
Resolution: Fixed
-
Minor
-
Jenkins 2.60.1
Windows master & slave
jre1.8.0_131
pipeline-model-definition 1.1.8
-
-
Pipeline - July/August
Using jenkins pipeline, I have found that an environment property that takes variable substitution (see example below) doesn't get it's backslashes correctly reduced. I would have expected that both keys below start with "a\b". Instead, AAA_Key1 becomes "a
b 0", while AAA_Key2 becomes "a\b".
Example script
pipeline { agent any stages { stage('Build') { environment { AAA_Key1 = "a\\b ${EXECUTOR_NUMBER}" AAA_Key2 = "a\\b" } steps { bat 'set' } } } }
Current Output
c:\w\Pipeline Experimental\default>set
AAA_Key1=a\\b 0
AAA_Key2=a\b
Current workaround is to use withEnv directly, which doesn't appear to suffer from this issue
- depends on
-
JENKINS-42753 Generate runtime model directly from AST model
-
- Closed
-
[JENKINS-45636] Backslashes are not correctly reduced when in environment var with substituted value
Description |
Original:
Using jenkins pipeline, I have found that an environment property that takes variable substitution (see example below) doesn't get it's backslashes correctly reduced. I would have expected that both keys below start with "a\b". Instead, AAA_Key1 becomes "a b 0", while AAA_Key2 becomes "a\b". Example script {code:java} pipeline { agent any stages { stage('Build') { environment { AAA_Key1 = "a\\b ${EXECUTOR_NUMBER}" AAA_Key2 = "a\\b" } steps { bat 'set' } } } }{code} Current Output {code:java} c:\w\Pipeline Experimental\default>set AAA_Key1=a\\b 0 AAA_Key2=a\b {code} |
New:
Using jenkins pipeline, I have found that an environment property that takes variable substitution (see example below) doesn't get it's backslashes correctly reduced. I would have expected that both keys below start with "a\b". Instead, AAA_Key1 becomes "a b 0", while AAA_Key2 becomes "a\b". Example script {code:java} pipeline { agent any stages { stage('Build') { environment { AAA_Key1 = "a\\b ${EXECUTOR_NUMBER}" AAA_Key2 = "a\\b" } steps { bat 'set' } } } }{code} Current Output {code:java} c:\w\Pipeline Experimental\default>set AAA_Key1=a\\b 0 AAA_Key2=a\b {code} Current workaround is to use withEnv directly, which doesn't appear to suffer from this issue |
Labels | New: declarative-variable-and-method-resolution |
Sprint | New: Pipeline - July/August [ 371 ] |
Link |
New:
This issue depends on |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Again, this is fixed along the way in
JENKINS-42753, I've added a test verifying this to the relevant PR, and it'll be included in Declarative 1.2.