提交 fe9f6760 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-15583]

Report 100 recent builds in the JSON API, including in-progress builds.

Not reporting all the builds since this would nullify the lazy loading
effect. Will introduce a pagenation API that supports retrieval.
上级 c7ad5e97
......@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
an in-progress build was dropped from JSON API when lazy-loading was introduced.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15583">issue 15583</a>)
<li class=bug>
Fixed a bad interaction between Windows symlinks and build record lazy loading.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15587">issue 15587</a>)
......
......@@ -612,7 +612,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
*/
@Exported(name="builds")
public RunList<RunT> getNewBuilds() {
return getBuilds().newBuilds();
return getBuilds().limit(100);
}
/**
......
......@@ -221,6 +221,14 @@ public class RunList<R extends Run> extends AbstractList<R> {
return this;
}
public RunList<R> limit(final int n) {
return limit(new CountingPredicate<R>() {
public boolean apply(int index, R input) {
return index<n;
}
});
}
/**
* Filter the list to non-successful builds only.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册