[JIRA] (JENKINS-59843) Remote access API job builds list limit shouldn't be hardcoded

6 views
Skip to first unread message

oded@geek.co.il (JIRA)

unread,
Oct 18, 2019, 7:36:02 AM10/18/19
to jenkinsc...@googlegroups.com
Oded Arbel created an issue
 
Jenkins / Improvement JENKINS-59843
Remote access API job builds list limit shouldn't be hardcoded
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: core
Created: 2019-10-18 11:35
Environment: Operating System: Fedora 30 64bit
JDK: openjdk 8
Jenkins verrsion: 2.200, from official docker hub container image
Labels: REST remote-api
Priority: Minor Minor
Reporter: Oded Arbel

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.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Oct 18, 2019, 9:26:02 AM10/18/19
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Won't Fix
 

that's what allBuilds is for, documented in the section titled "Retrieving all builds".

Pagination  (well, slicing) exists as documented in the section titled "Controlling the amount of data you fetch"

Change By: Daniel Beck
Status: Open Closed
Resolution: Won't Fix

oded@geek.co.il (JIRA)

unread,
Oct 25, 2019, 6:47:02 AM10/25/19
to jenkinsc...@googlegroups.com
Oded Arbel commented on Improvement JENKINS-59843
 
Re: Remote access API job builds list limit shouldn't be hardcoded

`allBuilds` solved the problem for me. I'm not sure how I missed it, but thank you very much for pointing it out.

Reply all
Reply to author
Forward
0 new messages