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

Pressing "Show More" button on Activity tab for Multibranch yields unpredictable results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • blueocean-plugin
    • None

      Preconditions:

      • Set up a multibranch pipeline with 5 branches and 10 runs for each branch.

      Repro Steps
      1. Navigate to the Activity branch for the MBP
      2. Note there are 25 runs displayed
      3. Press "Show More"

      Expected Result

      • A total of 50 runs should be displayed

      Actual Results

      • No addition runs are displayed and the "Show More" button disappears

      Analysis:
      When the second request is made, it hits the /activities endpoint sending parameters of start=25 and limit=26. This request returns an empty array.

      The bug appears to be in MultiBranchPipelineImpl.getRuns() which is called from getActivities(). Inside of the anonymous BlueRunContainer.iterator(int start, int limit) method there is a bug around line 281:

      for(final BluePipeline b: branches) {
          Iterator<BlueRun> it = b.getRuns().iterator(0,MAX_MBP_RUNS_ROWS);
          int count = 0;
          Iterators.skip(it, start);
          while(it.hasNext() && count++ < limit){
              c.add(it.next());
          }
      }
      

      The problem is that the runs iterator for each branch skips forward based on the value of start (25). Since each branch only has 10 runs, each branch returns zero results, yielding an empty collection.

            Unassigned Unassigned
            cliffmeyers Cliff Meyers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: