Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Show unstable builds as yellow.
This is based on pull requests 2 & 7.

Unstable builds both with and without failing tests appear as yellow.

One issue with the current implementation is that builds that are unstable
due to being marked that way (with no failing tests) aren't enlarged as
broken jobs are.

[FIXED JENKINS-9772]
[FIXED JENKINS-10585]
[FIXED JENKINS-10614]
[FIXED JENKINS-10846]
  • Loading branch information
david-resnick committed Oct 1, 2013
1 parent bc2264d commit 394f78e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 24 deletions.
17 changes: 10 additions & 7 deletions src/main/java/hudson/model/JobViewEntry.java
Expand Up @@ -98,14 +98,17 @@ public String getBackgroundColor() {
}

public String getStatus() {
if (getBroken() || getFailCount() > 0)
if (!StringUtils.isEmpty(getClaim())
&& !getClaim().equals(NOT_CLAIMED + "."))
return "claimed";
else
return "failing";
else
if (getStable()) {
return "successful";
}
if (!StringUtils.isEmpty(getClaim())
&& !getClaim().equals(NOT_CLAIMED + ".")) {
return "claimed";
}
if (getBroken()) {
return "failing";
}
return "unstable";
}

/*
Expand Down
35 changes: 20 additions & 15 deletions src/main/java/hudson/model/ProjectViewEntry.java
Expand Up @@ -62,15 +62,15 @@ public TreeSet<IViewEntry> getFailingJobs() {
}

public TreeSet<IViewEntry> getUnclaimedJobs() {
TreeSet<IViewEntry> failing = new TreeSet<IViewEntry>(
TreeSet<IViewEntry> unclaimed = new TreeSet<IViewEntry>(
new EntryComparator());
for (IViewEntry job : jobs) {
if ((job.getBroken() || job.getFailCount() > 0)) {
if ((!job.getStable()) || job.getFailCount() > 0) {
if (!job.isClaimed())
failing.add(job);
unclaimed.add(job);
}
}
return failing;
return unclaimed;
}

public TreeSet<IViewEntry> getJobs() {
Expand All @@ -85,16 +85,18 @@ public void addBuild(IViewEntry entry) {
Validate.notNull(entry);
jobs.add(entry);
}

public String getStatus()
{
if (getBroken() || getFailCount() > 0)
if (getUnclaimedJobs().size() == 0)
return "claimed";
else
return "failing";
else

public String getStatus() {
if (getStable()) {
return "successful";
}
if (getUnclaimedJobs().size() == 0) {
return "claimed";
}
if (getBroken()) {
return "failing";
}
return "unstable";
}

public String getBackgroundColor() {
Expand Down Expand Up @@ -194,8 +196,11 @@ public Boolean getQueued() {
}

public boolean getStable() {
// TODO Auto-generated method stub
return false;
boolean stable = true;
for (IViewEntry job : jobs) {
stable &= job.getStable();
}
return stable;
}

public int getSuccessCount() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/hudson/model/RadiatorView/job.jelly
Expand Up @@ -31,11 +31,11 @@
<j:if test="${job.broken == false}">
<j:if test="${job.failCount == 1}">
<font
style="text-align=center; color: #FFFF00; font-size: ${failFont}; font-weight:bold;">1/${job.testCount} test failure</font>
style="text-align=center; color: #000000; font-size: ${failFont}; font-weight:bold;">1/${job.testCount} test failure</font>
</j:if>
<j:if test="${ job.failCount > 1}">
<font
style="text-align=center; color: #FFFF00; font-size: ${failFont}; font-weight:bold;">${job.failCount}/${job.testCount} test failures</font>
style="text-align=center; color: #000000; font-size: ${failFont}; font-weight:bold;">${job.failCount}/${job.testCount} test failures</font>
</j:if>
<j:if test="${job.diff != ''}">
(
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/hudson/model/RadiatorView/main.jelly
Expand Up @@ -173,6 +173,20 @@
);
}

.unstable {
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.6, rgb(224,224,0)),
color-stop(0.9, yellow)
);
background-image: -moz-linear-gradient(
center bottom,
rgb(224,224,0) 60%,
yellow 90%
);
}

</style>
<j:choose>
Expand Down

0 comments on commit 394f78e

Please sign in to comment.