Drone CI API doesn't return all builds

Attempting to list all builds for a repository isn’t working, as can be seen here:


Attempting to not limit the shown number of builds from the CLI isn’t working either:

drone build ls makedeb/prebuilt-mpr --limit 5000

This is causing some issues for me, as I have a Docker runner that shuts down nightly for backups when it detects no builds are running, which is done via the API. Last night I had a (normally) 12+ hour build that never finished due to the build being far back enough that it couldn’t be found via the API, and now I have to wait for it to restart and run through again.

The API is paginated and returns a maximum of 100 results per page. If you want to return the full list you need to paginate through the entire list, using the page and per_page query parameters.


Is there any way to have it all just be on one page? I fine having to paginate until I find what I need a bit tedious, and having it all at once would make it a lot easier for myself.

If I were to look into implementing this myself, would there be any interest in getting it added? I can see the potential for a ddos-like attack against a repo that has thousands of builds or so, but I think at the least being able to configure it on a per-instance basis would be nice.

I appreciate the offer to send a pull request, but would politely decline such a change to Drone, as pagination is considered best practice for security and performance reasons. In your previous comment you mentioned using the CLI. I would be open to a pull request in the CLI to add an --all flag, where the CLI paginates through the full result set client-side.

1 Like