[FFmpeg-devel] [PATCH] [fateserver] Include slot owner in summary hash

Martin Storsjo martin at martin.st
Mon Jan 20 21:46:16 EET 2020


From: Mans Rullgard <mans at mansr.com>

---
I think this should allow filtering on the owner by doing
/index.cgi?query=owner:<name>, but as I don't have access to the
actual fate server, I'd appreciate if someone could try it out.
---
 FATE.pm    | 14 +++++++++++++-
 report.cgi |  8 +-------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/FATE.pm b/FATE.pm
index 86ffe07..50b5c69 100644
--- a/FATE.pm
+++ b/FATE.pm
@@ -99,6 +99,18 @@ sub split_rec {
     };
 }
 
+sub owner {
+    my ($slot) = @_;
+    my $owner;
+
+    if (open O, "$fatedir/$slot/owner") {
+        chomp($owner = <O>);
+        close O;
+    }
+
+    return $owner;
+}
+
 sub load_summary {
     my ($slot, $date) = @_;
     my $repdir = "$fatedir/$slot/$date";
@@ -109,7 +121,7 @@ sub load_summary {
         my $conf = split_config scalar <S> or return;
         my $st   = split_stats  scalar <S> or return;
         close S;
-        return { %$hdr, %$conf, %$st };
+        return { %$hdr, %$conf, %$st, owner => owner $slot };
     }
 
     return if not -f "$repdir/report.xz";
diff --git a/report.cgi b/report.cgi
index 9ae42fd..a980617 100755
--- a/report.cgi
+++ b/report.cgi
@@ -52,12 +52,6 @@ my $ntest = $npass + $nfail;
 my $rep = load_summary $req_slot, $req_time;
 my $lastpass = load_lastpass $req_slot;
 
-my $owner;
-if (open O, "$slotdir/owner") {
-    chomp($owner = <O>);
-    close O;
-}
-
 # main text
 
 print "Content-type: text/html\r\n";
@@ -100,7 +94,7 @@ trow 'Architecture',  $$conf{arch};
 trow 'Variant',       $$conf{subarch};
 trow 'CPU',           $$conf{cpu};
 trow 'OS',            $$conf{os};
-trow 'Owner',         $owner if $owner;
+trow 'Owner',         $$rep{owner};
 trow 'Compiler',      $$conf{cc};
 trow 'Configuration', '<code>' . $$conf{config} . '</code>';
 trow 'Comment',       $$hdr{comment};
-- 
2.17.1



More information about the ffmpeg-devel mailing list