Class PipelineNodeGraphVisitor

  • All Implemented Interfaces:
    NodeGraphBuilder, org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor

    public class PipelineNodeGraphVisitor
    extends org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
    implements NodeGraphBuilder
    Author:
    Vivek Pandey

    Run your Jenkins instance with -DNODE-DUMP-ENABLED to turn on the logging when diagnosing bugs! You'll also need to have a logging config that enables debug for (at least) this class. Use -Djava.util.logging.config.file=./logging.properties to set a custom logging properties file from the command line, or do it from within the admin UI.

    • Constructor Summary

      Constructors 
      Constructor Description
      PipelineNodeGraphVisitor​(org.jenkinsci.plugins.workflow.job.WorkflowRun run)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void accumulatePipelineActions​(org.jenkinsci.plugins.workflow.graph.FlowNode node)
      Find any Actions on this node, and add them to the pipelineActions collection until we can attach them to a FlowNodeWrapper.
      void atomNode​(org.jenkinsci.plugins.workflow.graph.FlowNode before, org.jenkinsci.plugins.workflow.graph.FlowNode atomNode, org.jenkinsci.plugins.workflow.graph.FlowNode after, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scan)  
      void chunkEnd​(org.jenkinsci.plugins.workflow.graph.FlowNode endNode, org.jenkinsci.plugins.workflow.graph.FlowNode afterBlock, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)  
      void chunkStart​(org.jenkinsci.plugins.workflow.graph.FlowNode startNode, org.jenkinsci.plugins.workflow.graph.FlowNode beforeBlock, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)  
      protected Set<Action> drainPipelineActions()
      Empty the pipelineActions buffer, returning its contents.
      List<FlowNodeWrapper> getPipelineNodes()
      Gives all pipeline nodes DAG graph
      List<io.jenkins.blueocean.rest.model.BluePipelineNode> getPipelineNodes​(io.jenkins.blueocean.rest.hal.Link parent)
      Gives DAG graph as list of BluePipelineNode
      io.jenkins.blueocean.rest.model.BluePipelineStep getPipelineNodeStep​(String id, io.jenkins.blueocean.rest.hal.Link parent)
      Give the step for given id
      List<io.jenkins.blueocean.rest.model.BluePipelineStep> getPipelineNodeSteps​(io.jenkins.blueocean.rest.hal.Link parent)
      Gives all the steps in this pipeline
      List<io.jenkins.blueocean.rest.model.BluePipelineStep> getPipelineNodeSteps​(String nodeId, io.jenkins.blueocean.rest.hal.Link parent)
      Gives all the steps inside given nodeId
      protected void handleChunkDone​(org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)  
      boolean isDeclarative()  
      void parallelBranchEnd​(org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode, org.jenkinsci.plugins.workflow.graph.FlowNode branchEndNode, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)  
      void parallelBranchStart​(org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode, org.jenkinsci.plugins.workflow.graph.FlowNode branchStartNode, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)  
      void parallelEnd​(org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode, org.jenkinsci.plugins.workflow.graph.FlowNode parallelEndNode, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)  
      void parallelStart​(org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode, org.jenkinsci.plugins.workflow.graph.FlowNode branchNode, org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)  
      protected void resetChunk​(org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)  
      List<io.jenkins.blueocean.rest.model.BluePipelineNode> union​(List<FlowNodeWrapper> previousNodes, io.jenkins.blueocean.rest.hal.Link parent)
      Create union of last successful run and this partial run
    • Constructor Detail

      • PipelineNodeGraphVisitor

        public PipelineNodeGraphVisitor​(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
    • Method Detail

      • chunkStart

        public void chunkStart​(@Nonnull
                               org.jenkinsci.plugins.workflow.graph.FlowNode startNode,
                               @CheckForNull
                               org.jenkinsci.plugins.workflow.graph.FlowNode beforeBlock,
                               @Nonnull
                               org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)
        Specified by:
        chunkStart in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        chunkStart in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • chunkEnd

        public void chunkEnd​(@Nonnull
                             org.jenkinsci.plugins.workflow.graph.FlowNode endNode,
                             @CheckForNull
                             org.jenkinsci.plugins.workflow.graph.FlowNode afterBlock,
                             @Nonnull
                             org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)
        Specified by:
        chunkEnd in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        chunkEnd in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • handleChunkDone

        protected void handleChunkDone​(@Nonnull
                                       org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)
        Overrides:
        handleChunkDone in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • resetChunk

        protected void resetChunk​(@Nonnull
                                  org.jenkinsci.plugins.workflow.graphanalysis.MemoryFlowChunk chunk)
        Overrides:
        resetChunk in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • parallelStart

        public void parallelStart​(@Nonnull
                                  org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode,
                                  @Nonnull
                                  org.jenkinsci.plugins.workflow.graph.FlowNode branchNode,
                                  @Nonnull
                                  org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)
        Specified by:
        parallelStart in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        parallelStart in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • parallelEnd

        public void parallelEnd​(@Nonnull
                                org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode,
                                @Nonnull
                                org.jenkinsci.plugins.workflow.graph.FlowNode parallelEndNode,
                                @Nonnull
                                org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)
        Specified by:
        parallelEnd in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        parallelEnd in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • parallelBranchStart

        public void parallelBranchStart​(@Nonnull
                                        org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode,
                                        @Nonnull
                                        org.jenkinsci.plugins.workflow.graph.FlowNode branchStartNode,
                                        @Nonnull
                                        org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)
        Specified by:
        parallelBranchStart in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        parallelBranchStart in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • parallelBranchEnd

        public void parallelBranchEnd​(@Nonnull
                                      org.jenkinsci.plugins.workflow.graph.FlowNode parallelStartNode,
                                      @Nonnull
                                      org.jenkinsci.plugins.workflow.graph.FlowNode branchEndNode,
                                      @Nonnull
                                      org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scanner)
        Specified by:
        parallelBranchEnd in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        parallelBranchEnd in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • atomNode

        public void atomNode​(@CheckForNull
                             org.jenkinsci.plugins.workflow.graph.FlowNode before,
                             @Nonnull
                             org.jenkinsci.plugins.workflow.graph.FlowNode atomNode,
                             @CheckForNull
                             org.jenkinsci.plugins.workflow.graph.FlowNode after,
                             @Nonnull
                             org.jenkinsci.plugins.workflow.graphanalysis.ForkScanner scan)
        Specified by:
        atomNode in interface org.jenkinsci.plugins.workflow.graphanalysis.SimpleChunkVisitor
        Overrides:
        atomNode in class org.jenkinsci.plugins.workflow.graphanalysis.StandardChunkVisitor
      • accumulatePipelineActions

        protected void accumulatePipelineActions​(org.jenkinsci.plugins.workflow.graph.FlowNode node)
        Find any Actions on this node, and add them to the pipelineActions collection until we can attach them to a FlowNodeWrapper.
      • drainPipelineActions

        protected Set<Action> drainPipelineActions()
        Empty the pipelineActions buffer, returning its contents.
      • getPipelineNodes

        public List<io.jenkins.blueocean.rest.model.BluePipelineNode> getPipelineNodes​(io.jenkins.blueocean.rest.hal.Link parent)
        Description copied from interface: NodeGraphBuilder
        Gives DAG graph as list of BluePipelineNode
        Specified by:
        getPipelineNodes in interface NodeGraphBuilder
      • getPipelineNodeSteps

        public List<io.jenkins.blueocean.rest.model.BluePipelineStep> getPipelineNodeSteps​(String nodeId,
                                                                                           io.jenkins.blueocean.rest.hal.Link parent)
        Description copied from interface: NodeGraphBuilder
        Gives all the steps inside given nodeId
        Specified by:
        getPipelineNodeSteps in interface NodeGraphBuilder
      • getPipelineNodeSteps

        public List<io.jenkins.blueocean.rest.model.BluePipelineStep> getPipelineNodeSteps​(io.jenkins.blueocean.rest.hal.Link parent)
        Description copied from interface: NodeGraphBuilder
        Gives all the steps in this pipeline
        Specified by:
        getPipelineNodeSteps in interface NodeGraphBuilder
      • getPipelineNodeStep

        public io.jenkins.blueocean.rest.model.BluePipelineStep getPipelineNodeStep​(String id,
                                                                                    io.jenkins.blueocean.rest.hal.Link parent)
        Description copied from interface: NodeGraphBuilder
        Give the step for given id
        Specified by:
        getPipelineNodeStep in interface NodeGraphBuilder
      • union

        public List<io.jenkins.blueocean.rest.model.BluePipelineNode> union​(List<FlowNodeWrapper> previousNodes,
                                                                            io.jenkins.blueocean.rest.hal.Link parent)
        Description copied from interface: NodeGraphBuilder
        Create union of last successful run and this partial run
        Specified by:
        union in interface NodeGraphBuilder
      • isDeclarative

        public boolean isDeclarative()