git ref in status display
[buildfarm-server.git] / cgi-bin / show_history.pl
index 49ce76792c40855695f976668555a4a413d482f1..822ec8e6e703bef0d01a0e5c0e5e8739b2cc9b53 100755 (executable)
@@ -3,6 +3,7 @@
 =comment
 
 Copyright (c) 2003-2010, Andrew Dunstan
+Copyright (c) 2022, The Exim Maintainers
 
 See accompanying License file for license details
 
@@ -31,7 +32,7 @@ die $DBI::errstr unless $db;
 
 my $query = new CGI;
 my $member = $query->param('nm'); $member =~ s/[^a-zA-Z0-9_ -]//g;
-my $branch = $query->param('br'); $branch =~ s/[^a-zA-Z0-9-]//g;
+my $branch = $query->param('br'); $branch =~ s/[^a-zA-Z0-9+_ .-]//g;
 my $hm = $query->param('hm');  $hm =~ s/[^a-zA-Z0-9_ -]//g;
 $hm = '240' unless $hm =~ /^\d+$/;
 
@@ -58,7 +59,7 @@ my $statement = qq{
          and branch = ?
    )
    SELECT (now() at time zone 'GMT')::timestamp(0) - x.snapshot as when_ago, 
-            x.sysname, x.snapshot, x.status, x.stage, s.log_text
+            x.sysname, x.snapshot, x.status, x.stage, s.log_text, x.git_head_ref
    FROM x 
    LEFT JOIN build_status_log s
    ON x.snapshot = s.snapshot AND s.log_stage = 'test-results.log'
@@ -83,6 +84,9 @@ while (my $row = $sth->fetchrow_hashref)
        $row->{os_version} = $latest_personality->[0];
        $row->{compiler_version} = $latest_personality->[1];
     }
+
+    # convert list of individual testresults to list of ranges of equal results
+    # for speed of display
     if (defined($row->{log_text}))
       {         # convert to a hash, find ranges, output list of ranges
       my $h = { split /\s+/, $row->{log_text} };