Bug 1054977 - Revert EOL changes to make future local use easier
authorEd Morley <emorley@mozilla.com>
Wed, 01 Apr 2015 14:04:18 +0400
changeset 1519 134bdfcf7e2d
parent 1518 7a5a6eeaf0e0
child 1520 8aff676182f9
push id879
push useremorley@mozilla.com
push dateWed, 29 Apr 2015 22:02:56 +0000
bugs1054977
Bug 1054977 - Revert EOL changes to make future local use easier TBPL has now been switched off in production, so the src repo is no longer being used. However in case anyone in the future wants to try using TBPL locally (eg for a side by side comparison when debugging a Treeherder issue), let's revert a bunch of the EOL changes we made, so it's not quite so limited in functionality.
.htaccess
js/Config.js
php/inc/AnnotatedSummaryGenerator.php
php/inc/LogParser.php
--- a/.htaccess
+++ b/.htaccess
@@ -1,105 +1,12 @@
 # PHP directives set here won't apply when scripts are run from the
 # command line (eg for prefetching), so any PHP directive edits made
 # to this file should likely be made to php/config-cli.php too.
 
-<IfModule mod_rewrite.c>
-  # Redirects for TBPL end of life (bug 1054977).
-  RewriteEngine On
-  RewriteBase /
-
-  # Exclude the cache directory from all other rules, so we can still
-  # view cache/revision_info.txt & the data-import logs.
-  RewriteRule ^cache(/.*)?$ - [L]
-
-  # mcMerge is now on its own hosting, so redirect separately from TBPL:
-  # eg: https://tbpl.mozilla.org/mcmerge/?cset=2a404169de2d&tree=mozilla-central
-  RewriteRule ^mcmerge(/.*)?$ https://mcmerge.paas.allizom.org/ [R=301,L]
-
-  # Redirecting doesn't make sense for calls to TBPL's backend, so let's
-  # return 403 Forbidden, so API consumers hit a more obvious failure mode.
-  RewriteRule ^php(/.*)?$ - [F,L]
-
-  # TBPL used non-standard names for the trees, so we have to convert to the
-  # canonical repo name used by Treeherder/everywhere else. These rules could
-  # be simplified using RewriteMap to just convert many of the repo names to
-  # lowercase (though there are exceptions) but it can't be used inside an
-  # .htaccess, and it's not worth the hassle of having to get WebOps involved.
-  # So we just handle the common trees and let the rest hit the catch-all.
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Mozilla-Inbound(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=mozilla-inbound%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=B2g-Inbound(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=b2g-inbound%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Fx-Team(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=fx-team%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Try(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=try%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Mozilla-Aurora(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=mozilla-aurora%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Mozilla-Beta(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=mozilla-beta%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Mozilla-Release(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=mozilla-release%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Gaia-Try(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=gaia-try%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Thunderbird-Trunk(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=comm-central%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Thunderbird-Try(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=try-comm-central%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Thunderbird-Aurora(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=comm-aurora%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Thunderbird-Beta(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=comm-beta%2
-
-  RewriteCond %{QUERY_STRING} ^(.*)tree=Jetpack(.*)$
-  RewriteRule ^(.*)$ $1?%1repo=addon-sdk%2
-
-  # Next problem: Treeherder's query params are different in virtually all cases.
-  # The repo name mappings above have already converted 'tree' to 'repo', but we
-  # still have to handle pusher/rev. Any other params will be discarded for
-  # simplicity. In addition, if the params are specified in an order different to
-  # the one used by the UI, we don't match and so hit the catch-all, but it's not
-  # worth the added complexity to handle this, since it should be rare.
-  # The [NE] flag is required to prevent Apache escaping the '#' to '%23'.
-
-  # Filtered by pusher:
-  # eg: https://tbpl.mozilla.org/?tree=Try&pusher=email@mozilla.com
-  # Any params other than the repo and pusher are discarded.
-  RewriteCond %{QUERY_STRING} repo=([^&]+).*&pusher=([^&]+)
-  RewriteRule ^(.*)$ https://treeherder.mozilla.org/#/jobs?repo=%1&author=%2 [NE,R=301,L]
-
-  # Viewing a specific revision:
-  # eg: https://tbpl.mozilla.org/?tree=Try&rev=cc63db12dafb
-  # Any params other than the repo and revision are discarded.
-  RewriteCond %{QUERY_STRING} repo=([^&]+).*&rev=([^&]+)
-  RewriteRule ^(.*)$ https://treeherder.mozilla.org/#/jobs?repo=%1&revision=%2 [NE,R=301,L]
-
-  # The standard view for a repo:
-  # eg: https://tbpl.mozilla.org/?tree=Mozilla-Inbound
-  # Any params other than the repo are discarded.
-  RewriteCond %{QUERY_STRING} repo=([^&]+)
-  RewriteRule ^(.*)$ https://treeherder.mozilla.org/#/jobs?repo=%1 [NE,R=301,L]
-
-  # For everything else just redirect with the entire query string discarded.
-  RewriteRule ^(.*)$ https://treeherder.mozilla.org/? [R=301,L]
-</IfModule>
-
 <IfModule mod_expires.c>
   ExpiresActive on
   ExpiresDefault "access plus 15 minutes"
 </IfModule>
 
 # Display errors in addition to logging them
 # (disabled in production, change for dev environments)
 php_flag display_startup_errors Off
--- a/js/Config.js
+++ b/js/Config.js
@@ -2,17 +2,17 @@
 /* vim: set sw=2 ts=2 et tw=80 : */
 
 "use strict";
 
 var Config = {
   jobDataLoader: BuildbotDBUser,
   pushlogDataLoader: PushlogJSONParser,
   defaultTreeName: "Mozilla-Central",
-  loadInterval: 1800, // seconds
+  loadInterval: 120, // seconds
   goBackPushes: 10,
   maxChangesets: 20,
   // Max length of the title prefix added to certain pages (eg Try).
   titlePrefixLimit: 70,
   // By default the server-side components at '<location of index.html> + php/'
   // are used - unless index.html is opened from the local filesystem (in which
   // case we default to prodBaseURL, for easy client-side testing). To override
   // this, set serverBaseURL to the location of the TBPL backend, eg:
--- a/php/inc/AnnotatedSummaryGenerator.php
+++ b/php/inc/AnnotatedSummaryGenerator.php
@@ -17,31 +17,31 @@ require_once 'inc/JSON.php';
 class AnnotatedSummaryGenerator implements LogGenerator {
   public function __construct($rawSummary, $logDescription) {
     $this->rawSummary = $rawSummary;
     $this->logDescription = $logDescription;
     $this->hasLeak = false;
   }
 
   public function generate($log) {
-    $maxAnnotatedFailures = 5;
+    $maxAnnotatedFailures = 20;
     $rawSummaryLines = GzipUtils::getLines($this->rawSummary);
     $annotatedLines = array();
     foreach ($rawSummaryLines as $i => $line) {
       // Only display the first N failures from the unannotated summary
       if ($i >= $maxAnnotatedFailures) {
         $totalParsedFailures = count($rawSummaryLines);
         // In extreme cases we will have truncated the raw log too (in Logparser.php),
         // so cannot state the actual number of failures. In which case, the truncation
         // message makes $totalParsedFailures exceed $maxParsedFailures.$maxParsedFailures
         // here should be kept in sync with LogParser.php's $maxParsedFailures.
         // TODO: Move these prefs to config.php so we don't have to keep them in sync
         // (once we have an in-repo config.php with passwords separated out, that isn't
         // a PITA to update).
-        $maxParsedFailures = 20;
+        $maxParsedFailures = 100;
         if ($totalParsedFailures > $maxParsedFailures)
           $totalParsedFailures = $maxParsedFailures . '+';
         $annotatedLines[] = "Only displaying first $maxAnnotatedFailures of $totalParsedFailures" .
                             " failures - <a href=\"php/getParsedLog.php?id=" . $_GET["id"] .
                             "\" target=\"_blank\">View log</a>.";
         break;
       }
       $this->processLine($annotatedLines, $line);
@@ -66,21 +66,19 @@ class AnnotatedSummaryGenerator implemen
                  "data-summary=\"$bug->summary\" " .
                  "data-signature=\"$this->logDescription\" " .
                  "data-logline=\"$line\" " .
                  "data-status=\"$bug->status $bug->resolution\"" .
            "></span>\n";
   }
 
   protected function processLine(&$annotatedLines, $line) {
+    $bugs = array();
     $annotatedLines[] = htmlspecialchars($line);
 
-    // Disable bug suggestions, now EOL is imminent.
-    return;
-
     // On windows, $line can have spurious whitespace/line-endings appended
     $trimmedLine = trim($line);
 
     // Our standard logging format uses the pipe symbol as a delimeter.
     $lineParts = preg_split("#\s\|\s#", $trimmedLine);
     if (count($lineParts) >= 3) {
       // Is in the "FAILURE-TYPE | testNameOrFilePath | message" type format.
       // testNameOrFilePath can either be a test filepath, or an arbitrary
@@ -103,17 +101,16 @@ class AnnotatedSummaryGenerator implemen
     // If the failure line was not in the pipe symbol delimited format or the search term 
     // will likely return too many (or irrelevant) results (eg: too short or matches terms
     // on the blacklist), then we fall back to searching for the entire failure line.
     if ((!isset($searchTerm) || !$this->isHelpfulSearchTerm($searchTerm)) &&
         $this->isHelpfulSearchTerm($trimmedLine)) {
       $searchTerm = $trimmedLine;
     }
 
-    $bugs = array();
     if (isset($searchTerm)) {
       $bugs = $this->getBugsForFailure($searchTerm);
     }
 
     // For crashes with no suggestions, search for the top frame as a fallback.
     // Catches shutdown crashes/anything else that is blacklisted, as well as GC
     // crashes that occur in too many tests to put all of them in bug summaries.
     if (empty($bugs) &&
--- a/php/inc/LogParser.php
+++ b/php/inc/LogParser.php
@@ -32,17 +32,17 @@ class LogParser implements LogGenerator 
       $text = substr($text, 0, -1);
     if (substr($text, -1) == "\r")
       $text = substr($text, 0, -1);
     return '<a href="'.$target.'">'.htmlspecialchars($text)."</a>\n";
   }
 
   public function getExcerpt($asHTML = false) {
     // Keep in sync with AnnotatedSummaryGenerator.php's $maxParsedFailures
-    $maxParsedFailures = 20;
+    $maxParsedFailures = 100;
     $maxLineLength = 500;
     $type = $this->lineFilter->getType();
     // The TinderboxPrint and reftest analyser scrape lines must remain untouched.
     $canTruncate = ($type != "tinderbox_print" && $type != "reftest");
     $lines = $this->getLines();
     $matchedLineNumbers = $this->getMatchedLineNumbers();
     $excerptLines = array();
     foreach ($matchedLineNumbers as $i => $lineNumber) {