It seems that `?tree=allBuilds[number]{0,1}` unconditionally forces Jenkins to load all builds into memory. If the number of builds is large this canĀ denial-of-service your Jenkins instance.
Steps to reproduce:
- Find a Jenkins instance with a job that has a very long history
- Verify that the standard REST query (for 100 jobs) executes quickly. For example: https://example.com/jenkins/job/my-job/api/json
- Now runĀ https://example.com/jenkins/job/my-job/api/json?tree=allBuilds[number]{0,1}
Expected result: It runs fast
Actual result: Jenkins goes out to lunch.