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

Remote access API job builds list limit shouldn't be hardcoded

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • core
    • Operating System: Fedora 30 64bit
      JDK: openjdk 8
      Jenkins verrsion: 2.200, from official docker hub container image

      When using the Remote Access API to get the list of builds in a job, for example - like this:

      curl https://${AUTH}@jenkins/job/myjob/api/json -G --data-urlencode 'tree=builds[number]'

      only the last 100 jobs are returned. This seem to be hard coded in the Job model (saw it here: https://github.com/jenkinsci/jenkins/blob/11c1146d0dc30e948ade8d1636ae01345c294291/core/src/main/java/hudson/model/Job.java#L737 )

      There should be a way to override this and get at the older builds - by paging, setting the limit, etc.

      The only workaround seem to be to check if a build exists by guessing its number (shouldn't be hard as they're sequential) and query each and every build URL directly. If a job has a few thousand builds, this gets really old really fast.

            Unassigned Unassigned
            guss77 Oded Arbel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: