Allow Build Queue to be "stack" like.

XMLWordPrintable

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor
    • Component/s: plugin-proposals
    • None
    • Environment:
      latest

      Hi,

      currently the build queue works in FIFO like fashion, which means that older builds are executed first. I think it would be helpful to have a choice between LIFO and FIFO build queues.
      In case of long build queue it is usually crucial to have the latest state of your software known and not the historical view.

      For example if there were a bunch of commits during the day, and the queue is full of tests that take long time to complete, it is more important to know how the more recent commits are affecting them than the older ones. The older commits can be tested e.g. during the night. So the history is kept but the feedback comes sooner in terms of current software state.

      After fiddling around with the code I've found out that the easies way to achieve LIFO is to change:

      ./core/src/main/java/hudson/model/Queue.java:170:

          private final Set<WaitingItem> waitingList = new TreeSet<WaitingItem>();
      

      to

          private final Set<WaitingItem> waitingList = new TreeSet<WaitingItem>(Collections.reverseOrder());
      

      However I'm not familiar enough with java or jenkins codebase to implement the configuration part of this feature (dropdown list or so) myself. The Queue object gets initialized before the GlobalCofiguration objects or so I think.

      To sum up:

      • the LIFO queue would allow us to see the current state of given branch in case of long Build Queues,
      • the older builds are built later than the newer ones (they are less interesting than the recent ones anyway),
      • I haven't heard about such a feature in other CI servers.

            Assignee:
            Unassigned
            Reporter:
            Bartlomiej Palmowski
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: