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

Expose StepContext from PlaceholderTask

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In Blueocean we want to correlate a queued item to the pipeline 'node' block's FlowNode. This is so that we can show cause of blockage to appropriate stage/parallel.

      We can get PlaceholderTask from build queue (Queue.Item.task). PlaceholderTask has StepContext but its private final. If it's exposed then I can simply call PlaceholderTask.context.get(FlowNode.class) and establish correlation with the 'node' block thats waiting to be executed and report appropriate cause of blockage. Basically it will be great if I have access to StepContext from PlaceholderTask or if there is some other way I can establish such correlation that would do that too.

      I also noticed, PlaceholderTask.getCauseOfBlockage() is always null, not a big deal as I can get it from Queue.Item.

        Attachments

          Activity

          Hide
          vivek Vivek Pandey added a comment -
          Show
          vivek Vivek Pandey added a comment - I have open a PR for this enhancement, https://github.com/jenkinsci/workflow-durable-task-step-plugin/pull/26
          Hide
          jglick Jesse Glick added a comment -

          PlaceholderTask.getCauseOfBlockage() is always null, not a big deal as I can get it from Queue.Item

          Task.getCauseOfBlockage would represent an inherent blockage, which does not apply to a node block. The Queue.Item represents what was actually scheduled and its current status in the queue.

          Show
          jglick Jesse Glick added a comment - PlaceholderTask.getCauseOfBlockage() is always null, not a big deal as I can get it from Queue.Item Task.getCauseOfBlockage would represent an inherent blockage, which does not apply to a node block. The Queue.Item represents what was actually scheduled and its current status in the queue.
          Hide
          vivek Vivek Pandey added a comment -

          Gotcha, thanks.

          Show
          vivek Vivek Pandey added a comment - Gotcha, thanks.

            People

            • Assignee:
              vivek Vivek Pandey
              Reporter:
              vivek Vivek Pandey
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: