aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Varghese2013-10-08 18:47:05 (EDT)
committerRoy Varghese2013-10-08 18:47:05 (EDT)
commitcd5b02fd3dd540de1173e4f8fbdce9156ebc8f9a (patch)
tree1388c1744aa0941ec8c74b1caaeafeae55aea0f1
parent0f945aaecade71c72d81674c2ee7e3abb8c06837 (diff)
downloadorg.eclipse.hudson.core-cd5b02fd3dd540de1173e4f8fbdce9156ebc8f9a.zip
org.eclipse.hudson.core-cd5b02fd3dd540de1173e4f8fbdce9156ebc8f9a.tar.gz
org.eclipse.hudson.core-cd5b02fd3dd540de1173e4f8fbdce9156ebc8f9a.tar.bz2
Fix Bug 418645 - Disk-Usage-Plugin does not show size of jobs.refs/changes/86/17186/1
The estimated time attribute was not part of the lightwt build proxy object. Also needed to surface badge actions for UI. Signed-off-by: Roy Varghese <rovarghe@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/BuildHistory.java3
-rw-r--r--hudson-core/src/main/java/hudson/model/Run.java18
-rw-r--r--hudson-core/src/main/java/hudson/model/RunMap.java10
3 files changed, 26 insertions, 5 deletions
diff --git a/hudson-core/src/main/java/hudson/model/BuildHistory.java b/hudson-core/src/main/java/hudson/model/BuildHistory.java
index b71ddd2..9a95bdb 100644
--- a/hudson-core/src/main/java/hudson/model/BuildHistory.java
+++ b/hudson-core/src/main/java/hudson/model/BuildHistory.java
@@ -72,6 +72,9 @@ public interface BuildHistory<JobT extends Job<JobT, RunT>, RunT extends Run<Job
String getFullDisplayName();
String getUrl();
+ Executor getExecutor();
+ List<BuildBadgeAction> getBadgeActions();
+
Record<JobT,RunT> getPrevious();
Record<JobT,RunT> getNext();
diff --git a/hudson-core/src/main/java/hudson/model/Run.java b/hudson-core/src/main/java/hudson/model/Run.java
index 8c95e4e..4ce9d5d 100644
--- a/hudson-core/src/main/java/hudson/model/Run.java
+++ b/hudson-core/src/main/java/hudson/model/Run.java
@@ -365,8 +365,12 @@ public abstract class Run<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
* {@link BuildBadgeAction}s.
*/
public List<BuildBadgeAction> getBadgeActions() {
+ return getBadgeActions(this);
+ }
+
+ static List<BuildBadgeAction> getBadgeActions(Run run) {
List<BuildBadgeAction> r = null;
- for (Action a : getActions()) {
+ for (Action a : run.getActions()) {
if (a instanceof BuildBadgeAction) {
if (r == null) {
r = new ArrayList<BuildBadgeAction>();
@@ -374,11 +378,11 @@ public abstract class Run<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
r.add((BuildBadgeAction) a);
}
}
- if (isKeepLog()) {
+ if (run.isKeepLog()) {
if (r == null) {
r = new ArrayList<BuildBadgeAction>();
}
- r.add(new KeepLogBuildBadge());
+ r.add(run.new KeepLogBuildBadge());
}
if (r == null) {
return Collections.emptyList();
@@ -407,10 +411,14 @@ public abstract class Run<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
* Gets the {@link Executor} building this job, if it's being built.
* Otherwise null.
*/
- public Executor getExecutor() {
+ final public Executor getExecutor() {
+ return getExecutor(this);
+ }
+
+ static Executor getExecutor(Run run) {
for (Computer c : Hudson.getInstance().getComputers()) {
for (Executor e : c.getExecutors()) {
- if (e.getCurrentExecutable() == this) {
+ if (e.getCurrentExecutable() == run) {
return e;
}
}
diff --git a/hudson-core/src/main/java/hudson/model/RunMap.java b/hudson-core/src/main/java/hudson/model/RunMap.java
index 98296d8..4ae43a9 100644
--- a/hudson-core/src/main/java/hudson/model/RunMap.java
+++ b/hudson-core/src/main/java/hudson/model/RunMap.java
@@ -1048,6 +1048,11 @@ public final class RunMap<J extends Job<J, R>, R extends Run<J, R>>
public String getBuiltOnNodeName() {
return builtOnStr;
}
+
+ @Override
+ public Executor getExecutor() {
+ return Run.getExecutor(getBuild());
+ }
@Override
public RunValue<J,R> getPrevious() {
@@ -1055,6 +1060,11 @@ public final class RunMap<J extends Job<J, R>, R extends Run<J, R>>
}
@Override
+ public List<BuildBadgeAction> getBadgeActions() {
+ return Run.getBadgeActions(getBuild());
+ }
+
+ @Override
public RunValue<J,R> getNext() {
return next;
}