提交 2b36bd0b 编写于 作者: K Kanstantsin Shautsou

[JENKINS-16178] Add builds that were run by user to user's build list.

上级 5fe9e52b
......@@ -433,9 +433,19 @@ public class User extends AbstractModelObject implements AccessControlled, Descr
public RunList getBuilds() {
List<AbstractBuild> r = new ArrayList<AbstractBuild>();
for (AbstractProject<?,?> p : Jenkins.getInstance().getAllItems(AbstractProject.class))
for (AbstractBuild<?,?> b : p.getBuilds().newBuilds())
for (AbstractBuild<?,?> b : p.getBuilds().newBuilds()){
if(b.hasParticipant(this))
r.add(b);
else {
//append builds that were run by this user
Cause.UserIdCause cause = b.getCause(Cause.UserIdCause.class);
if (cause != null) {
String userId = cause.getUserId();
if (userId != null && this.getId() != null && userId.equals(this.getId()))
r.add(b);
}
}
}
return RunList.fromRuns(r);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册