From: Andrew Dunstan Date: Thu, 20 Jan 2011 22:02:52 +0000 (-0800) Subject: failures completion X-Git-Url: https://git.exim.org/buildfarm-server.git/commitdiff_plain/d696a6f7068246f026ec4417e30aec0adb99913b failures completion --- diff --git a/cgi-bin/pgstatus.pl b/cgi-bin/pgstatus.pl index 0c60f80..9043b32 100755 --- a/cgi-bin/pgstatus.pl +++ b/cgi-bin/pgstatus.pl @@ -407,7 +407,7 @@ if ($stage ne 'OK') # prevent occasional duplication by forcing serialization of this operation $db->do("lock table nrecent_failures in share row exclusive mode"); $db->do("delete from nrecent_failures"); - $db->do("insert into nrecent_failures select bs.sysname, bs.snapshot, bs.branch from build_status bs where bs.stage <> 'OK' and bs.snapshot > now() - interval '30 days'"); + $db->do("insert into nrecent_failures select bs.sysname, bs.snapshot, bs.branch from build_status bs where bs.stage <> 'OK' and bs.snapshot > now() - interval '90 days'"); $db->commit; } diff --git a/cgi-bin/show_failures.pl b/cgi-bin/show_failures.pl new file mode 100755 index 0000000..104bd66 --- /dev/null +++ b/cgi-bin/show_failures.pl @@ -0,0 +1,109 @@ +#!/usr/bin/perl + +=comment + +Copyright (c) 2003-2010, Andrew Dunstan + +See accompanying License file for license details + +=cut + +use strict; +use DBI; +use Template; +use CGI; + +use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir); + + +require "$ENV{BFConfDir}/BuildFarmWeb.pl"; + +my $query = new CGI; +my @members = $query->param('member'); +map { s/[^a-zA-Z0-9_ -]//g; } @members; + +my $dsn="dbi:Pg:dbname=$dbname"; +$dsn .= ";host=$dbhost" if $dbhost; +$dsn .= ";port=$dbport" if $dbport; + + +my $sort_clause = ""; +my $presort_clause = ""; +my $sortby = $query->param('sortby') || 'nosort'; +if ($sortby eq 'name') +{ + $sort_clause = 'lower(sysname),'; +} +elsif ($sortby eq 'os') +{ + $sort_clause = 'lower(operating_system), os_version desc,'; +} +elsif ($sortby eq 'compiler') +{ + $sort_clause = "lower(compiler), compiler_version,"; +} +elsif ($sortby eq 'namenobranch') +{ + $presort_clause = "lower(sysname), snapshot desc," +} + +my $db = DBI->connect($dsn,$dbuser,$dbpass,{pg_expand_array => 0}) + or die("$dsn,$dbuser,$dbpass,$!"); + +my $statement =<prepare($statement); +$sth->execute; +while (my $row = $sth->fetchrow_hashref) +{ + next if (@members && ! grep {$_ eq $row->{sysname} } @members); + $row->{build_flags} =~ s/^\{(.*)\}$/$1/; + $row->{build_flags} =~ s/,/ /g; + # enable-integer-datetimes is now the default + if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_3_STABLE') + { + $row->{build_flags} .= " --enable-integer-datetimes " + unless ($row->{build_flags} =~ /--(en|dis)able-integer-datetimes/); + } + # enable-thread-safety is now the default + if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_5_STABLE') + { + $row->{build_flags} .= " --enable-thread-safety " + unless ($row->{build_flags} =~ /--(en|dis)able-thread-safety/); + } + $row->{build_flags} =~ s/--((enable|with)-)?//g; + $row->{build_flags} =~ s/libxml/xml/; + $row->{build_flags} =~ s/\S+=\S+//g; + push(@$statrows,$row); +} +$sth->finish; + + +$db->disconnect; + + +my $template_opts = { INCLUDE_PATH => $template_dir }; +my $template = new Template($template_opts); + +print "Content-Type: text/html\n\n"; + +$template->process('fstatus.tt', + {statrows=>$statrows, + sortby => $sortby, + members=> \@members} ); + +exit; + diff --git a/htdocs/inc/pgbf.css b/htdocs/inc/pgbf.css index 0873d6d..5c7ef7d 100644 --- a/htdocs/inc/pgbf.css +++ b/htdocs/inc/pgbf.css @@ -19,27 +19,31 @@ a:hover img { border: none; } #banner img { margin:6px 0; } -#nav { +li#thismenu a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } +li#thismenu { background: url(/inc/b/l.png) no-repeat 0% -20px; } + + +.nav { float:left; width:780px; background:#fff; margin:0 10px 10px; } -#nav ul { +.nav ul { margin:0; padding:0; list-style:none; } -#nav li { +.nav li { float:left; margin:0 .5em 0 0; padding:0 0 0 4px; background: url(/inc/b/l.png) no-repeat left top; } -#nav li a { +.nav li a { display:block; background:url(/inc/b/r.png) no-repeat right top; padding:0 11px 0 7px; @@ -48,20 +52,20 @@ a:hover img { border: none; } line-height:20px; } -#nav li a:hover { +.nav li a:hover { background: url(/inc/b/r.png) no-repeat 100% -20px; color:rgb(17,45,137); border: 0; } -#nav li:hover { background: url(/inc/b/l.png) no-repeat 0% -20px; } +.nav li:hover { background: url(/inc/b/l.png) no-repeat 0% -20px; } -#main { +.main { clear:both; margin:0 5px; } -#main a { +.main a { text-decoration: none; color: rgb(17,45,137); font-weight: bold; @@ -125,5 +129,6 @@ td.branch ul, td.branch li { .compiler { color: navy; } .arch { color: purple; } -td.flags { white-space: normal; font-size: x-small; } +td.flags { white-space: nowrap; font-size: x-small; } +td.failflags {white-space: nowrap; font-size: x-small; } diff --git a/htdocs/index.html b/htdocs/index.html index 9609bb4..18f5bbe 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -1,12 +1,5 @@ - @@ -22,17 +15,18 @@ See accompanying License file for license details