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

Add new "waitingForInput" status to API for runs, dag and steps

    Details

    • Similar Issues:
    • Epic Link:
    • Sprint:
      pacific, atlantic, indian, arctic, tasman, frank

      Description

      In Scope

      • Add new "waitingForInput" status to API for runs, dag and steps
      • Status should be called "waitingForInput"
      • A pipeline's run and any stages or parallels can have the status "waiting for input" so long as it contains one or more input steps waiting for input.

      Context
      We are showing any runs "waiting for input" with their own status indicator. Don't worry if the UI hasn't mapped it.

        Attachments

          Issue Links

            Activity

            Hide
            vivek Vivek Pandey added a comment -

            Sam Van Oort We need to associate a FlowNode (StepAtomNode) with an InputStep. Only possible way I can do it now is, WorkflowRun.getExecutions() and then InputStepExecution.getInput() gives me input but there is no public method to get underlying FlowNode from InputStepExecution. Is there way we can do such association?

            Show
            vivek Vivek Pandey added a comment - Sam Van Oort We need to associate a FlowNode (StepAtomNode) with an InputStep. Only possible way I can do it now is, WorkflowRun.getExecutions() and then InputStepExecution.getInput() gives me input but there is no public method to get underlying FlowNode from InputStepExecution. Is there way we can do such association?
            Hide
            svanoort Sam Van Oort added a comment -

            @vivek I'm shocked to see you really do need all the statuses in pipeline-graph-analysis (PAUSED_PENDING_INPUT)

            Two easy ways to get the FlowNode: it'll be a current head (FlowExecution.getCurrentHeads()) and have a PauseAction on it, or mark it when the StatusAndTiming API gives you the node status (it'll be PAUSED_PENDING_INPUT).

            Show
            svanoort Sam Van Oort added a comment - @vivek I'm shocked to see you really do need all the statuses in pipeline-graph-analysis (PAUSED_PENDING_INPUT) Two easy ways to get the FlowNode: it'll be a current head (FlowExecution.getCurrentHeads()) and have a PauseAction on it, or mark it when the StatusAndTiming API gives you the node status (it'll be PAUSED_PENDING_INPUT).
            Hide
            vivek Vivek Pandey added a comment -

            Sam Van Oort haha, yes

            So if I have 3 branches and and all of them have step that's waiting for input, not sure how FlowExecution.getCurrentHeads() will help there? I guess I can make it work by checking status of each atomNode and check if its PAUSED_PENDING_INPUT, assuming I get it on the atomNode thats waiting for input.

            Show
            vivek Vivek Pandey added a comment - Sam Van Oort haha, yes So if I have 3 branches and and all of them have step that's waiting for input, not sure how FlowExecution.getCurrentHeads() will help there? I guess I can make it work by checking status of each atomNode and check if its PAUSED_PENDING_INPUT, assuming I get it on the atomNode thats waiting for input.
            Hide
            svanoort Sam Van Oort added a comment -

            Vivek Pandey The run itself will have an InputAction on it – if present, one (or more!) of its heads will be paused for input.

            Show
            svanoort Sam Van Oort added a comment - Vivek Pandey The run itself will have an InputAction on it – if present, one (or more!) of its heads will be paused for input.
            Hide
            vivek Vivek Pandey added a comment - - edited

            Sam Van Oort Yeah I saw StatusAndTiming.computechunkStatus() doing it and that looks to me a bug. It reports even the inputs busy doing stuff inside shell script are marked as waiting for PAUSED_PENDING_INPUT status. Basically its going to report every paused input as PAUSED_PENDING_INPUT if there is atleast one of the step is waiting for input.

            Try this:

            Inside StandardChunkVisitor.atomNode() implementation I commute status using this api:

            StatusAndTiming.computeChunkStatus(run, before,atomNode,atomNode,after);
            

            Try this script, it will report shell step with sleep inside 'right' branch as PAUSED_PENDING_INPUT status. That is wrong as it should really be IN_PROGRESS.

            node {
                stage("parallelStage"){
                  parallel left : {
                        echo "running"
                        def branchInput = input message: 'Please input branch to test against', parameters: [[$class: 'StringParameterDefinition', defaultValue: 'master', description: '', name: 'branch']]
                        echo "BRANCH NAME: ${branchInput}"
                    }, 
                    right : {
                        sh 'sleep 10000000'
                    }
                }
            }
            
            Show
            vivek Vivek Pandey added a comment - - edited Sam Van Oort Yeah I saw StatusAndTiming.computechunkStatus() doing it and that looks to me a bug. It reports even the inputs busy doing stuff inside shell script are marked as waiting for PAUSED_PENDING_INPUT status. Basically its going to report every paused input as PAUSED_PENDING_INPUT if there is atleast one of the step is waiting for input. Try this: Inside StandardChunkVisitor.atomNode() implementation I commute status using this api: StatusAndTiming.computeChunkStatus(run, before,atomNode,atomNode,after); Try this script, it will report shell step with sleep inside 'right' branch as PAUSED_PENDING_INPUT status. That is wrong as it should really be IN_PROGRESS. node { stage( "parallelStage" ){ parallel left : { echo "running" def branchInput = input message: 'Please input branch to test against' , parameters: [[$class: 'StringParameterDefinition' , defaultValue: 'master' , description: '', name: ' branch']] echo "BRANCH NAME: ${branchInput}" }, right : { sh 'sleep 10000000' } } }

              People

              • Assignee:
                vivek Vivek Pandey
                Reporter:
                jamesdumay James Dumay
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: