diff options
-rw-r--r-- | autobuild/results.php | 30 | ||||
-rw-r--r-- | index.php | 3 |
2 files changed, 11 insertions, 22 deletions
diff --git a/autobuild/results.php b/autobuild/results.php index 053d4b2..2fcf432 100644 --- a/autobuild/results.php +++ b/autobuild/results.php @@ -166,34 +166,22 @@ function toggle(titleid, contentid){ <?php # See if the pattern of recent build failures indicate a flaky build -# This looks at the last 10 builds for at least two failures +# This looks at the last 10 builds for at least 4 result change function is_flaky($history) { if (count($history) < 10) return false; # Most recent 5 builds - $num_bad = 0; - for ($i = 0; $i < 5; $i++) { - if ($history[$i] === 'build_failure') - $num_bad++; + $num_change = 0; + $current = $history[0]; + for ($i = 1; $i < 10; $i++) { + if ($history[$i] != $current) { + $num_change++; + $current = $history[$i]; + } } - if ($num_bad < 1 || $num_bad >= 5) - return false; - # Next older 5 builds - $num_bad_older = 0; - for ($i = 5; $i < 10; $i++) { - if ($history[$i] === 'build_failure') - $num_bad_older++; - } - if ($num_bad_older < 1 || $num_bad_older >= 5) - return false; - - $num_bad = $num_bad + $num_bad_older; - if ($num_bad < 2 || $num_bad > 7) - return false; - - return true; + return $num_change >= 4; } function get_build_history($package) { @@ -194,7 +194,8 @@ if ($total > 0) { $failed_arches = array_keys($p['status']['fail']); if (!empty($failed_arches)) { sort($failed_arches); - $s .= '<span class="failure"><span class="status-box"></span> ' . join(' ', $failed_arches) . '</span>'; + $typelink = '/uploads/failure/' . $p['path']; + $s .= '<a rel="nofollow" href="' . $typelink . '" class="status-link"><span class="failure"><span class="status-box"></span> ' . join(' ', $failed_arches) . '</span></a>'; } $s .= '</td></tr>'; |