Closed mguillem closed 1 year ago
Thanks for the bug report, and especially for the reproduction steps! See https://github.com/jenkinsci/groovy-sandbox/pull/100 for a fix.
@dwnusbaum this was really fast! Thanks!
The fix was ultimately released in Script Security plugin version 1228.vd93135a_2fb_25.
Jenkins and plugins versions report
Exception parsing Jenkinsfile. The problem has been isolated in a small unit test (below). This is a regression: our Jenkinsfile have been working successfully until this change two months ago.
What Operating System are you using (both controller, and any agents involved in the problem)?
doesn't matter
Reproduction steps
Add following test to SandboxTransformerTest and execute it:
Expected Results
a green unit test
Actual Results
Following exception:
Anything else?
The problem has probably been introduced in commit 520243213bcd8c81322e8e683daa8d555bb4f484 https://github.com/jenkinsci/groovy-sandbox/commit/520243213bcd8c81322e8e683daa8d555bb4f484#diff-2de07a9b073d0d81f913c248e08a99a237aec811fb3d54ee32a76bb4d8bb9abbR411
The unit test is working at revision 74d3a4efec72cc4e4e2d7a236936873c732cddc8.
A simple workaround consist in initializing the map with an empty map and to assign a value later.