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

null parallelStartNode in StandardChunkVisitor.parallelBranchStart()

    Details

    • Similar Issues:

      Description

      With nested parallel branch, parallelStartNode is passed as null. Its supposed to be non-null value, this behavior has consequence of causing NPE.

      public void parallelBranchStart(@Nonnull FlowNode parallelStartNode, @Nonnull FlowNode branchStartNode, @Nonnull ForkScanner scanner) {}
      
      node {
         stage ('test') { 
           echo ('Testing'); 
           parallel nestedBranch: {
             echo 'nested Branch'
             stage('nestedBranchStage') {
               echo 'running nestedBranchStage'
               parallel secondLevelNestedBranch1: {
                 echo 'secondLevelNestedBranch1'
               }
             }
           },
          failFast: false
         } 
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            svanoort Sam Van Oort added a comment -

            Probably also needs the parallelStartPredicate to be set automatically if not done currently:

            public static Predicate<FlowNode> PARALLEL_START_PREDICATE = new Predicate<FlowNode>() {
                    @Override
                    public boolean apply(FlowNode input)

            {             return input != null && input instanceof StepStartNode && (((StepStartNode) input).getDescriptor().getClass() == ParallelStep.DescriptorImpl.class);         }

                };

            ForkScanner.setParallelStartPredicate(PARALLEL_START_PREDICATE);

            Show
            svanoort Sam Van Oort added a comment - Probably also needs the parallelStartPredicate to be set automatically if not done currently: public static Predicate<FlowNode> PARALLEL_START_PREDICATE = new Predicate<FlowNode>() {         @Override         public boolean apply(FlowNode input) {             return input != null && input instanceof StepStartNode && (((StepStartNode) input).getDescriptor().getClass() == ParallelStep.DescriptorImpl.class);         }     }; ForkScanner.setParallelStartPredicate(PARALLEL_START_PREDICATE);
            Hide
            vivek Vivek Pandey added a comment -

            Sam Van Oort I am not setting this predicate, wasn't aware of it. Looking at it, this seems one of default predicate in ForkScanner? Otherwise everyone doing this kind of thing needs to remember to set it up.

            Show
            vivek Vivek Pandey added a comment - Sam Van Oort I am not setting this predicate, wasn't aware of it. Looking at it, this seems one of default predicate in ForkScanner? Otherwise everyone doing this kind of thing needs to remember to set it up.
            Hide
            svanoort Sam Van Oort added a comment -

            Vivek Pandey Due to a new API added to support other work for Step descriptions in flownodes, I've got the ability to set a working default predicate in this case now (requires workflow-cps v 2.26 to work completely though).

            Show
            svanoort Sam Van Oort added a comment - Vivek Pandey Due to a new API added to support other work for Step descriptions in flownodes, I've got the ability to set a working default predicate in this case now (requires workflow-cps v 2.26 to work completely though).
            Hide
            vivek Vivek Pandey added a comment -

            Thanks Sam Van Oort

            Show
            vivek Vivek Pandey added a comment - Thanks Sam Van Oort
            Hide
            svanoort Sam Van Oort added a comment -

            Vivek Pandey A fix for this, among other things, is awaiting your review in https://github.com/jenkinsci/workflow-api-plugin/pull/33

            Show
            svanoort Sam Van Oort added a comment - Vivek Pandey A fix for this, among other things, is awaiting your review in https://github.com/jenkinsci/workflow-api-plugin/pull/33
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Sam Van Oort
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/graphanalysis/ForkScanner.java
            src/test/java/org/jenkinsci/plugins/workflow/graphanalysis/ForkScannerTest.java
            http://jenkins-ci.org/commit/workflow-api-plugin/96e2c2ed99384a9c9f4fb80cc8f8876d9b225504
            Log:
            Fix a couple forkscanner testcase quirks, and put JENKINS-39839 to bed along with JENKINS-39841

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sam Van Oort Path: src/main/java/org/jenkinsci/plugins/workflow/graphanalysis/ForkScanner.java src/test/java/org/jenkinsci/plugins/workflow/graphanalysis/ForkScannerTest.java http://jenkins-ci.org/commit/workflow-api-plugin/96e2c2ed99384a9c9f4fb80cc8f8876d9b225504 Log: Fix a couple forkscanner testcase quirks, and put JENKINS-39839 to bed along with JENKINS-39841
            Hide
            svanoort Sam Van Oort added a comment -

            Fixed with explicit test coverage in workflow-api 2.12

            Show
            svanoort Sam Van Oort added a comment - Fixed with explicit test coverage in workflow-api 2.12

              People

              • Assignee:
                svanoort Sam Van Oort
                Reporter:
                vivek Vivek Pandey
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: