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

Pipeline scripts that should appear in /queue are returned in /runs API

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • blueocean-plugin
    • None

      from cliffmeyers:
      Hitting the /runs REST API for a Pipeline shows all the job runs, including those that probably should be in the /queue. The status of all jobs is "RUNNING" which also feels a bit misleading.

      from vivek
      What needs to happen is that if a build item is in queue, should not be returned. We should not be mixing run object with queue because they are vastly different. There is already an API /pipeline/:id/activities Ivan implemented to give all runs and items in queue, so if this is what you look for you can use that.

          [JENKINS-37338] Pipeline scripts that should appear in /queue are returned in /runs API

          Cliff Meyers created issue -
          Cliff Meyers made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]
          Cliff Meyers made changes -
          Link New: This issue is related to JENKINS-37337 [ JENKINS-37337 ]

          Vivek Pandey added a comment -

          cliffmeyers

          Based on what I discovered after experimenting with pipeline/nodes and its behavior w.r.t being in queue and its state running as well as being in queue, I think our api implementation tries to do such re-arrangment of pipeline run state is recipe for more confusion and errors. See my last mail. Fact that a pipeline is in RUNNING state is truth and should be represented that way because its indeed running. At the same time, based on how the script is, part of it might be in queue. I am not really sure what else can we do really.

          Vivek Pandey added a comment - cliffmeyers Based on what I discovered after experimenting with pipeline/nodes and its behavior w.r.t being in queue and its state running as well as being in queue, I think our api implementation tries to do such re-arrangment of pipeline run state is recipe for more confusion and errors. See my last mail. Fact that a pipeline is in RUNNING state is truth and should be represented that way because its indeed running. At the same time, based on how the script is, part of it might be in queue. I am not really sure what else can we do really.

          Michael Neale added a comment -

          I think the missing piece is showing the activity of Jenkins in the not-yet-implemented GUI, this would make it clear...

          otherwise, if there was a way we could enquire as to what "parts" of a pipeline are doing... we could report more intelligently why it is waiting when it is in the RUNNING state...

          IN a sense we don't really want "Queued" anyway - it is an artifact of Jenkins internals that we don't always want to expose.

          What we may want to expose is that their build is in a bad way because of exahusted executors or mis configuration - that is really what it is about.

          Michael Neale added a comment - I think the missing piece is showing the activity of Jenkins in the not-yet-implemented GUI, this would make it clear... otherwise, if there was a way we could enquire as to what "parts" of a pipeline are doing... we could report more intelligently why it is waiting when it is in the RUNNING state... IN a sense we don't really want "Queued" anyway - it is an artifact of Jenkins internals that we don't always want to expose. What we may want to expose is that their build is in a bad way because of exahusted executors or mis configuration - that is really what it is about.

          Michael Neale added a comment -

          Summary: for pipeline this is actually "correct" behavior, as there is no queue on a per pipeline basis. Much more work is needed to show what parts of it are in a piepline and where it is blocked.

          Michael Neale added a comment - Summary: for pipeline this is actually "correct" behavior, as there is no queue on a per pipeline basis. Much more work is needed to show what parts of it are in a piepline and where it is blocked.
          James Dumay made changes -
          Sprint New: 1.0-beta-1 [ 96 ]
          James Dumay made changes -
          Rank New: Ranked lower
          James Dumay made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          James Dumay made changes -
          Rank New: Ranked higher

            vivek Vivek Pandey
            cliffmeyers Cliff Meyers
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: