diff options
author | Pascal Terjan <pterjan@mageia.org> | 2022-11-11 14:32:09 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2022-11-11 14:32:31 +0000 |
commit | 2222561789db0bb1f9e94f265905a74f5ef6ee9e (patch) | |
tree | 5886170cb38a005e031ecfc12c154f62d56fa43d /autobuild/results.php | |
parent | f82ff085a117f45a69fc2b367166d06b02edf401 (diff) | |
download | pkgsubmit-2222561789db0bb1f9e94f265905a74f5ef6ee9e.tar pkgsubmit-2222561789db0bb1f9e94f265905a74f5ef6ee9e.tar.gz pkgsubmit-2222561789db0bb1f9e94f265905a74f5ef6ee9e.tar.bz2 pkgsubmit-2222561789db0bb1f9e94f265905a74f5ef6ee9e.tar.xz pkgsubmit-2222561789db0bb1f9e94f265905a74f5ef6ee9e.zip |
Allow filtering by maintainer
Diffstat (limited to 'autobuild/results.php')
-rw-r--r-- | autobuild/results.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/autobuild/results.php b/autobuild/results.php index 3cbc476..9574f5d 100644 --- a/autobuild/results.php +++ b/autobuild/results.php @@ -256,6 +256,26 @@ function get_all_attributes() { return $attr_types; } +function get_package_maintainers() { + global $failure; + $pkgs = Array(); + $maintdb = file('/var/www/bs/data/maintdb.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + foreach ($maintdb as $l) { + list($pkg, $m) = explode(" ", $l); + if ($m == "") { + $m = "nobody"; + } + $pkgs[$pkg] = $m; + } + $failedpkgs = Array(); + foreach ($failure as $rpm => $error) { + $parsed = parse_package($rpm); + $pkg = $parsed["package"]; + $failedpkgs[$pkg] = $pkgs[$pkg]; + } + return $failedpkgs; +} + echo "<header id=\"mgnavt\"><h1>$title</h1><ul><li>$succes_percent% success</li></ul></header><article>\n"; echo "<form><select name='run' onChange='document.location.href=\"".$_SERVER["PHP_SELF"]."?run=\"+this.form.run.value'>"; foreach ($runs as $r) { @@ -278,9 +298,13 @@ echo "<tr><td>Unchanged</td><td>$nb_still_broken</td></tr>\n"; echo "</table>\n"; echo "<br />If no new package was broken, success rate next time should be $estimated_percent%.\n"; $all_attrs = get_all_attributes(); +$pkg_maintainers = get_package_maintainers(); +$maintainers_package_count = array_count_values($pkg_maintainers); +arsort($maintainers_package_count); $filters = Array(); if ($all_attrs) { echo "<h2>Filters</h2>\n"; + echo "<i>If nothing is checked on a line, that category is not filtered, else only the values checked appear.<i>"; echo "<form action=\"" . $_SERVER["PHP_SELF"] . "\" method=\"get\">\n"; if ($_GET["run"]) { echo "<input type=\"hidden\" name=\"run\" value=\"" . $_GET["run"] . "\" />\n"; @@ -299,6 +323,20 @@ if ($all_attrs) { } echo "<br/>\n"; } + echo "<b>maintainer: </b>"; + $filters["maintainer"] = Array(); + echo "<select name=\"maintainer\" id=\"maintainer\">\n"; + echo "<option />\n"; + foreach ($maintainers_package_count as $m => $c) { + if ($m === $_GET["maintainer"]) { + $selected = "selected"; + array_push($filters["maintainer"], $m) ; + } else { + $selected = ""; + } + echo "<option $selected value=\"$m\">$m ($c)</option>\n"; + } + echo "</select>\n"; echo "<input type=\"submit\" value=\"Apply\" />\n"; echo "</form>"; } @@ -329,6 +367,12 @@ foreach ($failure as $rpm => $error) { $errors = ""; $stage = ""; $attributes = get_package_attributes($packageid); + if (isset($pkg_maintainers[$parsed['package']])) { + $maintainer = $pkg_maintainers[$parsed['package']]; + $attributes .= " maintainer_$maintainer"; + } else { + $maintainer = "nobody"; + } if ($attributes) { # Attributes are space separated words of the form "TYPE_SPECIFIER", e.g., "lang_php" # Types are currently build (use of a particular build system), |