summaryrefslogtreecommitdiffstats
path: root/autobuild/results.php
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-09-13 00:44:47 +0200
committerDan Fandrich <dan@coneharvesters.com>2020-03-26 22:18:10 +0100
commit6e719bb97ca94c205e694bab9fd1def07725b3fd (patch)
tree7a41df2b781dff18bc1b8b4b8f21253c9d8334dd /autobuild/results.php
parentda1786eda289a8dd1c8b1011249e16f4b8bed51b (diff)
downloadpkgsubmit-6e719bb97ca94c205e694bab9fd1def07725b3fd.tar
pkgsubmit-6e719bb97ca94c205e694bab9fd1def07725b3fd.tar.gz
pkgsubmit-6e719bb97ca94c205e694bab9fd1def07725b3fd.tar.bz2
pkgsubmit-6e719bb97ca94c205e694bab9fd1def07725b3fd.tar.xz
pkgsubmit-6e719bb97ca94c205e694bab9fd1def07725b3fd.zip
Show icons for some programming language dependencies
Search the package install log to find some dependencies that get turned into icons next to the package names. This should give maintainers a better clue about whether they they have the skills or interest to tackle a package build issue. Logos are displayed only for packages that are failing and have not been fixed yet.
Diffstat (limited to 'autobuild/results.php')
-rw-r--r--autobuild/results.php44
1 files changed, 39 insertions, 5 deletions
diff --git a/autobuild/results.php b/autobuild/results.php
index e3ab4d1..9a81622 100644
--- a/autobuild/results.php
+++ b/autobuild/results.php
@@ -40,6 +40,7 @@ foreach ($runs as $r) {
}
$prev = $r;
}
+$runepoc = strtotime($run);
$packages = Array();
if ($handle = opendir('/distrib/bootstrap/distrib/cauldron/SRPMS/core/release/')) {
@@ -192,10 +193,15 @@ function is_flaky($history) {
return $num_change >= 4;
}
-function get_build_history($package) {
+function get_package_id($package) {
+ global $db;
+ return $db->querySingle("SELECT Id FROM Packages WHERE Name = '$package'");
+}
+
+function get_build_history($package_id) {
global $db;
- $package_id = $db->querySingle("SELECT Id FROM Packages WHERE Name = '$package'");
if ($package_id) {
+ # TODO: optimize by retrieving Runs.Id once at the start
$result = $db->query("SELECT ResultValues.Name FROM Runs, Results, ResultValues WHERE Runs.Id = Results.Run AND Results.Result = ResultValues.Id AND Results.Package = '$package_id' ORDER BY Start DESC LIMIT 10");
if ($result) {
$build_stats = Array();
@@ -208,6 +214,15 @@ function get_build_history($package) {
return false;
}
+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';");
+ }
+ return $attributes;
+}
+
echo "<form><select name='run' onChange='document.location.href=\"".$_SERVER["PHP_SELF"]."?run=\"+this.form.run.value'>";
foreach ($runs as $r) {
$in_progress = ($r > $latest) ? ' (in progress)' : '';
@@ -234,15 +249,34 @@ foreach ($failure as $rpm => $error) {
if (file_exists("icons/error-$error.png")) {
$error_html = "<img src='icons/error-$error.png' title='$error'/>";
}
- $history = get_build_history($parsed['package']);
+ $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' />";
}
+ $language_link = "";
+ if (!$fixed[$rpm]) {
+ $attributes = get_package_attributes($packageid);
+ if ($attributes) {
+ # Attributes are space separated words of the form "lang_php"
+ foreach (explode(" ", $attributes) as $attr) {
+ $attrname = ucfirst(explode("_", $attr)[1]);
+ $icon_fn = "icons/" . str_replace("_", "-", $attr) . ".png";
+ if (file_exists($icon_fn)) {
+ $language_link = $language_link . " <img src='$icon_fn' " .
+ "title='$attrname dependency' />";
+ } else {
+ $language_link = $language_link . " [$attrname dep]";
+ }
+ }
+ }
+ }
if (file_exists("$base_dir/$rpm/")) {
- echo "<li>$error_html <a href='$base_dir/$rpm/'>$rpm</a> $status_html $history_link</li>\n";
+ echo "<li>$error_html <a href='$base_dir/$rpm/'>$rpm</a>";
} else {
- echo "<li>$error_html $rpm $status_html $history_link</li>\n";
+ echo "<li>$error_html $rpm";
}
+ echo " $status_html $history_link$language_link</li>\n";
}
$db->close();
?>