Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37828

Pipeline Model: Steps at peer level to parallel below stage cause compilation error

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      This is a fun side effect of ParallelStep not having a DataBoundConstructor - theoretically, it should be possible to have both parallel and other steps directly within a stage, but the attempt to validate the arguments to parallel goes wrong due to that missing DataBoundConstructor.

      The ModelParser does look for parallel and treat it differently if it's the only step under the stage, but we're not looking for that in JSONParser at all, and we're not rejecting parallel in other cases in the first place. So...need to think about this some.

        Attachments

          Issue Links

            Activity

            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/2
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStep.groovy
            src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.groovy
            src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
            src/test/resources/errors/rejectParallelMixedInSteps.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/cb86d2ba560a5d89005495876376d549fc6a1b44
            Log:
            [FIXED JENKINS-37828] Properly reject parallel.

            More notably, reject it when it's not the only step in a block. In the
            JSON representation, we don't even use the term parallel - we just
            have multiple branches. In the groovy parsing, we look for parallel as
            the only step in a stage and treat it differently (resulting in
            multiple branches). So any time we see parallel as a step by the time
            we get to validation, well, it's wrong. So, yeah.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTStep.groovy src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.groovy src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java src/test/resources/errors/rejectParallelMixedInSteps.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/cb86d2ba560a5d89005495876376d549fc6a1b44 Log: [FIXED JENKINS-37828] Properly reject parallel. More notably, reject it when it's not the only step in a block. In the JSON representation, we don't even use the term parallel - we just have multiple branches. In the groovy parsing, we look for parallel as the only step in a stage and treat it differently (resulting in multiple branches). So any time we see parallel as a step by the time we get to validation, well, it's wrong. So, yeah.
            Hide
            abayer Andrew Bayer added a comment -

            Will be released in Pipeline Model Definition 0.2

            Show
            abayer Andrew Bayer added a comment - Will be released in Pipeline Model Definition 0.2

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                abayer Andrew Bayer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: