4 <link rel="Shortcut Icon" href="//www.pld-linux.org/favicon.ico"/>
5 <title>PLD QA Reports</title>
6 <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="//srcbuilder.pld-linux.org/th/style.css">
8 .hidden { display: none; }
9 span#count { font-weight: bold; }
15 // (c) -2019 PLD developers
16 // filter-out feature - adamg
18 $report = isset($_GET['q']) ? basename($_GET['q']) : null;
20 "main" => "Main deps x86_64",
21 "main-ready" => "Main ready deps x86_64",
22 "main-ready-test" => "Main+ready+test deps x86_64",
24 "main-i686" => "Main deps i686",
25 "main-ready-i686" => "Main ready deps i686",
26 "main-ready-test-i686" => "Main+ready+test deps i686",
28 "main-x32" => "Main deps x32",
29 "main-ready-x32" => "Main ready deps x32",
30 "main-ready-test-x32" => "Main+ready+test deps x32",
32 "freshness" => "GIT vs FTP freshness",
34 "lint-PLD" => "rpmlint: main",
35 "lint-test" => "rpmlint: test",
36 "lint-ready" => "rpmlint: ready",
39 function reports_selection($reports) {
41 echo "Select report:";
42 echo "<select id=q name=q>\n";
43 foreach ($reports as $q => $title) {
44 printf("<option value=%s %s>%s</option>\n", $q, $q == $report ? 'selected' :'', $title);
50 * Create text input for filtering results
52 function filter_box() {
53 echo '<br>Filter results: <input id="filter" class="filter">';
54 echo '<br>Filter-out (grep -v) <input id="filter_out" class="filter">';
55 echo '<br><span id="count">?</span> errors';
58 function format_report($report) {
59 echo "<br>View the <a href=$report.txt>raw</a> report<br/>\n";
60 $file = "$report.txt";
61 $giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog';
62 echo '<ol id="lines">';
63 foreach (file($file) as $line) {
64 $line = preg_replace_callback('/^(?P<prefix>error:|GIT:)\s*\[(?P<spec>[^]]+)\]\s*(?P<msg>.+)$/', function($m) use ($giturl) {
65 $package = basename($m['spec'], '.spec');
66 $url = sprintf($giturl, $package);
67 return sprintf('<li><font color=red>%s</font> [<a href="%s">%s</a>] %s', $m['prefix'], $url, $m['spec'], $m['msg']);
69 echo $line, "<br/>\n";
74 reports_selection($reports);
76 if (isset($reports[$report])) {
77 format_report($report);
81 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
84 $('#q').on('change', function(e) {
87 var v = o[o.selectedIndex].value;
88 location.href = "?q=" + v;
91 var $lines = $('#lines>li');
92 var $count = $('#count');
93 $('.filter').on('keyup', function() {
94 var filter_in = $('#filter').val();
95 var filter_out = $('#filter_out').val().trim();
96 var do_filter_out = filter_out.length > 0;
98 $lines.each(function() {
100 var text = $line.text();
101 // everything is visible by default
102 $line.removeClass('hidden');
104 // but we hide lines that do not match filter
105 // OR match non-empty filter-out
106 if ( ! text.match(filter_in) || (do_filter_out && text.match(filter_out)) ) {
107 $line.addClass('hidden');
113 $count.html($lines.length);