webapps.mason: show all the configured build machines, not just the failing ones.

db4
John Benediktsson 2012-08-13 16:21:32 -07:00
parent 7b2b3f5e9f
commit dda43cc647
3 changed files with 35 additions and 18 deletions

View File

@ -64,10 +64,19 @@ counter "COUNTER" {
: increment-counter-value ( -- n )
counter-tuple [ 0 or 1 + dup ] change-value update-tuple ;
: all-builders ( -- builders )
builder new select-tuples ; inline
: crashed? ( builder -- ? )
heartbeat-timestamp>> 30 minutes ago before? ;
: broken? ( builder -- ? )
[ clean-git-id>> ] [ last-git-id>> ] bi = not ;
: funny-builders ( -- crashed broken )
builder new select-tuples
[ [ heartbeat-timestamp>> 30 minutes ago before? ] filter ]
[ [ [ clean-git-id>> ] [ last-git-id>> ] bi = not ] filter ]
all-builders
[ [ crashed? ] filter ]
[ [ broken? ] filter ]
bi ;
: os/cpu ( builder -- string )

View File

@ -3,13 +3,8 @@
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<t:title>Mason dashboard</t:title>
<h1>Crashed build machines</h1>
<p>Machines which are not sending heartbeats:</p>
<t:xml t:name="crashed" />
<h1>Broken build machines</h1>
<p>Machines with failing builds:</p>
<t:xml t:name="broken" />
<h1>Build machines</h1>
<t:xml t:name="builders" />
<h1>Force build now</h1>
<p>Requires build engineer status.</p>

View File

@ -1,13 +1,28 @@
! Copyright (C) 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel furnace.actions html.forms sequences
xml.syntax webapps.mason.backend webapps.mason.utils ;
USING: accessors combinators kernel furnace.actions html.forms
sequences sorting xml.syntax webapps.mason.backend
webapps.mason.utils ;
IN: webapps.mason.downloads
CONSTANT: CRASHED
[XML <span style="background-color: yellow;">CRASHED</span> XML]
CONSTANT: BROKEN
[XML <span style="background-color: red; color: white;">BROKEN</span> XML]
: builder-status ( builder -- status/f )
{
{ [ dup crashed? ] [ drop CRASHED ] }
{ [ dup broken? ] [ drop BROKEN ] }
[ drop f ]
} cond ;
: builder-list ( seq -- xml )
[ os/cpu ] sort-with
[
[ report-url ] [ os/cpu ] bi
[XML <li><a href=<->><-></a></li> XML]
[ report-url ] [ os/cpu ] [ builder-status ] tri
[XML <li><a href=<->><-></a> <-></li> XML]
] map
[ [XML <p>No machines.</p> XML] ]
[ [XML <ul><-></ul> XML] ]
@ -17,9 +32,7 @@ IN: webapps.mason.downloads
<page-action>
[
[
funny-builders
[ builder-list ] bi@
[ "crashed" set-value ]
[ "broken" set-value ] bi*
all-builders builder-list
"builders" set-value
] with-mason-db
] >>init ;