diff options
Diffstat (limited to 'autobuild')
-rw-r--r-- | autobuild/results.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/autobuild/results.php b/autobuild/results.php index fe1d479..3bbee74 100644 --- a/autobuild/results.php +++ b/autobuild/results.php @@ -224,10 +224,10 @@ function get_build_history($package_id) { function get_package_attributes($package_id) { global $db, $runepoc; if ($package_id) { - # TODO: optimize by retrieving Runs.Id once at the start - $attributes = $db->querySingle("SELECT Attr FROM Attributes, Runs WHERE Runs.Id = Attributes.Run AND Runs.Start = $runepoc AND Attributes.Package = '$package_id';"); + # TODO: optimize by retrieving Runs.Id once at the start + return $db->querySingle("SELECT Attr FROM Attributes, Runs WHERE Runs.Id = Attributes.Run AND Runs.Start = $runepoc AND Attributes.Package = '$package_id';"); } - return $attributes; + return ""; } function get_all_attributes() { @@ -314,11 +314,11 @@ if ($all_attrs) { $filters[$attr_type] = Array(); foreach ($attrs as $attr) { $checked = ""; - if ($_GET["attr_$attr_type_$attr"]) { + if (isset($_GET["attr_${attr_type}_$attr"]) && $_GET["attr_${attr_type}_$attr"]) { $checked = "checked"; array_push($filters[$attr_type], $attr); } - echo "<input type=\"checkbox\" $checked name=\"attr_$attr_type_$attr\" value=\"1\">$attr</input>\n"; + echo "<input type=\"checkbox\" $checked name=\"attr_${attr_type}_$attr\" value=\"1\">$attr</input>\n"; } echo "<br/>\n"; } @@ -327,7 +327,7 @@ if ($all_attrs) { echo "<select name=\"maintainer\" id=\"maintainer\">\n"; echo "<option />\n"; foreach ($maintainers_package_count as $m => $c) { - if ($m === $_GET["maintainer"]) { + if (isset($_GET["maintainer"]) && $m === $_GET["maintainer"]) { $selected = "selected"; array_push($filters["maintainer"], $m) ; } else { @@ -338,14 +338,14 @@ if ($all_attrs) { echo "</select><br/>\n"; $filters["history"] = Array(); $checked = ""; - if ($_GET["history_new"]) { + if (isset($_GET["history_new"]) && $_GET["history_new"]) { $checked = "checked"; array_push($filters["history"], "new"); } echo "<input type=\"checkbox\" $checked name=\"history_new\" value=\"1\">Only show newly broken packages</input><br/>\n"; $filters["status"] = Array(); $checked = ""; - if ($_GET["status_broken"]) { + if (isset($_GET["status_broken"]) && $_GET["status_broken"]) { $checked = "checked"; array_push($filters["status"], "broken"); } @@ -358,6 +358,7 @@ echo "<table class=\"failureTable\" >\n"; echo "<tr><th></th><th>Maintainer</th><th>Status</th><th>Failure type</th><th>Build step</th><th></th><th>Languages</th><th>Detected errors</th></tr>\n"; foreach ($failure as $rpm => $error) { $parsed = parse_package($rpm); + $packageid = get_package_id($parsed['package']); $attributes = get_package_attributes($packageid); if (isset($pkg_maintainers[$parsed['package']])) { $maintainer = $pkg_maintainers[$parsed['package']]; @@ -384,7 +385,6 @@ foreach ($failure as $rpm => $error) { if (file_exists("icons/error-$error.png")) { $error_html = "<img src='icons/error-$error.png' title='$error'/> $error"; } - $packageid = get_package_id($parsed['package']); $history = get_build_history($packageid); if (is_flaky($history)) { $history_link = $history_link . " <img src='icons/warning-flaky.png' title='Flaky build' />"; |