From b7d3486e4c401294182f38917dede3e48616df5e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 23 Jan 2018 11:42:16 +0100 Subject: web-scripts/broken-packages.php: much more functionality now --- web-scripts/broken-packages.php | 64 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 7 deletions(-) (limited to 'web-scripts') diff --git a/web-scripts/broken-packages.php b/web-scripts/broken-packages.php index f8a9eab..cccf18b 100644 --- a/web-scripts/broken-packages.php +++ b/web-scripts/broken-packages.php @@ -14,6 +14,8 @@ if ($mysql->connect_error) { $result = $mysql -> query( "SELECT " . + "`build_assignments`.`id`," . + "`build_assignments`.`is_blocked`," . "`package_sources`.`pkgbase`," . "`package_sources`.`git_revision`," . "`package_sources`.`mod_git_revision`," . @@ -21,7 +23,7 @@ $result = $mysql -> query( "FROM `build_assignments` " . "JOIN `package_sources` ON `build_assignments`.`package_source` = `package_sources`.`id` " . "JOIN `upstream_repositories` ON `package_sources`.`upstream_package_repository` = `upstream_repositories`.`id` " . - "WHERE `build_assignments`.`is_broken`" + "WHERE `build_assignments`.`is_broken` OR `build_assignments`.`is_blocked` IS NOT NULL" ); if ($result -> num_rows > 0) { print "\n"; @@ -30,23 +32,71 @@ if ($result -> num_rows > 0) { print ""; print ""; print ""; -// print ""; + print ""; // print ""; -// print ""; -// print ""; + print ""; + print ""; print "\n"; while($row = $result->fetch_assoc()) { + + $fail_result = $mysql -> query( + "SELECT " . + "`fail_reasons`.`name`, " . + "`failed_builds`.`log_file` " . + "FROM `failed_builds` " . + "JOIN `build_assignments` ON `failed_builds`.`build_assignment`=`build_assignments`.`id` ". + "JOIN `fail_reasons` ON `failed_builds`.`reason`=`fail_reasons`.`id` ". + "WHERE `build_assignments`.`id`=".$row["id"]." " . + "ORDER BY `failed_builds`.`date`" + ); + + unset($reasons); + unset($last_log); + $trials = $fail_result -> num_rows; + if ($trials > 0) { + while($fail_row = $fail_result->fetch_assoc()) { + $reasons[$fail_row["name"]]=$fail_row["name"]; + $last_log=$fail_row["log_file"]; + } + } + if (isset($reasons)) { + $to_print=""; + foreach ($reasons as $reason) { + $to_print=$to_print.", ".$reason; + } + $fail_reasons=substr($to_print,2); + } else { + $fail_reasons=" "; + } + print ""; print ""; print ""; print ""; print ""; -// + if (isset($last_log)) + print ""; + else + print ""; // -// -// + print ""; + if ($row["is_blocked"]=="") { + $row["is_blocked"]=" "; + } + $row["is_blocked"] = preg_replace( + array ( + "/FS32#(\\d+)/", + "/FS#(\\d+)/" + ), + array ( + "$0", + "$0" + ), + $row["is_blocked"] + ); + print ""; print "\n"; } -- cgit v1.2.3-70-g09d2
git revisionmodification git revisionpackage repositorycompilationscompilationsdependentbuild errorblockedbuild errorblocked
".$row["pkgbase"]."

".$row["git_revision"]."

".$row["mod_git_revision"]."

".$row["name"]."2". $trials ."". $trials ."0build()wait for FS32#20".$fail_reasons."".$row["is_blocked"]."