Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-39011] Error out at parse time when pipeline step is n…
…ested. We don't want to support nesting the pipeline step within other blocks - until JENKINS-38152, we never noticed that this was actually possible, since the parse-time validation just ignored any Jenkinsfile without a root-level pipeline step, but with JENKINS-38152, we not only do another parse round but need to grab the stages from the model to attach to the run, so we hit an NPE when there's a pipeline step nested under other blocks. So - this will now catch when the pipeline step is nested within another block and give an error message at parse-time, rather than NPEing at runtime. There is a valid use case for wanting to wrap the entire build in something like a timeout or timestamper, but we're going to address that with JENKINS-37823.
- Loading branch information
Showing with 66 additions and 1 deletion.
- +19 −1 ...finition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
- +9 −0 ...-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
- +38 −0 pipeline-model-definition/src/test/resources/errors/pipelineStepWithinOtherBlocksFailure.groovy