Skip to content
Permalink
Browse files

Unbuilt shown as gray in job view, varied in project view.

Possible improvement: change the project bg color when the only other jobs are
successful, as right now it shows as orange.

[FIXED JENKINS-12460]
  • Loading branch information...
david-resnick committed Oct 20, 2013
1 parent 0c2e61f commit 32153dd1a9b86a7f0c7be90ea44de1bc2eb79f78
@@ -123,4 +123,6 @@
*/
public abstract boolean isCompletelyClaimed();

public boolean isNotBuilt();

}
@@ -37,10 +37,9 @@

private Boolean building = false;

/**
* If the build is stable.
*/
private boolean stable;
private boolean stable = false;

private boolean notBuilt = false;

/**
* C'tor
@@ -98,6 +97,9 @@ public String getBackgroundColor() {
}

public String getStatus() {
if (isNotBuilt()) {
return "never built";
}
if (getStable()) {
return "successful";
}
@@ -330,20 +332,17 @@ public String getSuccessPercentage() {
private void findStatus() {
Result result = RadiatorUtil.getLastFinishedResult(job);

this.stable = false;
if (result.ordinal == Result.NOT_BUILT.ordinal) {
this.backgroundColor = getColors().getOtherBG();
this.color = getColors().getOtherFG();
this.broken = true;
this.notBuilt = true;
} else if (result.ordinal == Result.SUCCESS.ordinal) {
this.backgroundColor = getColors().getOkBG();
this.color = getColors().getOkFG();
this.broken = false;
this.stable = true;
} else if (result.ordinal == Result.UNSTABLE.ordinal) {
this.backgroundColor = getColors().getFailedBG();
this.color = getColors().getFailedFG();
this.broken = false;
} else {
this.backgroundColor = getColors().getBrokenBG();
this.color = getColors().getBrokenFG();
@@ -404,6 +403,10 @@ public boolean getStable() {
return stable;
}

public boolean isNotBuilt() {
return notBuilt;
}

/*
* (non-Javadoc)
*
@@ -6,7 +6,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

@@ -65,14 +64,25 @@ public ProjectViewEntry() {
TreeSet<IViewEntry> unclaimed = new TreeSet<IViewEntry>(
new EntryComparator());
for (IViewEntry job : jobs) {
if ((!job.getStable()) || job.getFailCount() > 0) {
if (((!job.getStable()) || job.getFailCount() > 0) && !job.isNotBuilt()) {
if (!job.isCompletelyClaimed())
unclaimed.add(job);
}
}
return unclaimed;
}

public TreeSet<IViewEntry> getUnbuiltJobs() {
TreeSet<IViewEntry> unbuilt = new TreeSet<IViewEntry>(
new EntryComparator());
for (IViewEntry job : jobs) {
if (job.isNotBuilt()) {
unbuilt.add(job);
}
}
return unbuilt;
}

public TreeSet<IViewEntry> getJobs() {
return jobs;
}
@@ -252,4 +262,8 @@ public boolean isCompletelyClaimed() {
public String getUnclaimedMatrixBuilds() {
throw new UnsupportedOperationException();
}

public boolean isNotBuilt() {
throw new UnsupportedOperationException();
}
}
@@ -38,6 +38,7 @@

<j:invoke var="passJobs" on="${job}" method="getPassingJobs" />
<j:invoke var="failJobs" on="${job}" method="getUnclaimedJobs" />
<j:invoke var="unbuiltJobs" on="${job}" method="getUnbuiltJobs" />
<j:invoke var="claimedJobs" on="${job}" method="getClaimedBuilds" />
<j:if test="${!failJobs.isEmpty()}">
<j:if
@@ -83,6 +84,25 @@
</ul>
</p>
</j:if>
<j:if test="${!unbuiltJobs.isEmpty()}">
<p>
Never Built:
<ul>
<j:forEach var="subjob" items="${unbuiltJobs}">
<j:invokeStatic className="org.apache.commons.lang.StringUtils"
method="removeStart" var="subjobShortName">
<j:arg type="java.lang.String" value="${subjob.name}" />
<j:arg type="java.lang.String" value="${job.name}_" />
</j:invokeStatic>
<li>
<a href="${subjob.lastBuildUrl}">${subjobShortName}</a>
<j:if test="${subjob.getBuilding()}">(building now)</j:if>
<j:if test="${subjob.getQueued()}">(build pending)</j:if>
</li>
</j:forEach>
</ul>
</p>
</j:if>
</div>

</j:jelly>

0 comments on commit 32153dd

Please sign in to comment.
You can’t perform that action at this time.