Using fake timestamp in OS version make some results invisible
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Dec 2015 05:15:52 +0000 (05:15 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Dec 2015 05:15:52 +0000 (05:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152289

Reviewed by Stephanie Lewis.

Fix various bugs after r194088.

* public/api/commits.php:
(format_commit): Include the commit order.
* public/v2/data.js:
(CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
* tools/pull-os-versions.py:
(OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
(available_builds_from_command): Exit early when an exception is thrown.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194093 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/api/commits.php
Websites/perf.webkit.org/public/v2/data.js
Websites/perf.webkit.org/tools/pull-os-versions.py

index 9dae1a9..a9671b8 100644 (file)
@@ -1,5 +1,22 @@
 2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Using fake timestamp in OS version make some results invisible
+        https://bugs.webkit.org/show_bug.cgi?id=152289
+
+        Reviewed by Stephanie Lewis.
+
+        Fix various bugs after r194088.
+
+        * public/api/commits.php:
+        (format_commit): Include the commit order.
+        * public/v2/data.js:
+        (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
+        * tools/pull-os-versions.py:
+        (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
+        (available_builds_from_command): Exit early when an exception is thrown.
+
+2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
+
         Fix a typo in the previous commit.
 
         * public/include/report-processor.php:
index 87e62e2..bee8661 100644 (file)
@@ -116,6 +116,7 @@ function format_commit($commit_row, $committer_row) {
         'revision' => $commit_row['commit_revision'],
         'parent' => $commit_row['commit_parent'],
         'time' => Database::to_js_time($commit_row['commit_time']),
+        'order' => $commit_row['commit_order'],
         'authorName' => $committer_row ? $committer_row['committer_name'] : null,
         'authorEmail' => $committer_row ? $committer_row['committer_account'] : null,
         'message' => $commit_row['commit_message']
index 42b3a77..106c055 100644 (file)
@@ -136,7 +136,7 @@ CommitLogs._cacheConsecutiveCommits = function (repository, from, to, consecutiv
         cachedCommits.commitsByTime.push(commit);
     });
 
-    cachedCommits.commitsByTime.sort(function (a, b) { return a.time - b.time; });
+    cachedCommits.commitsByTime.sort(function (a, b) { return a.time && b.time ? (a.time - b.time) : (a.order - b.order); });
     cachedCommits.commitsByTime.forEach(function (commit, index) { commit.cacheIndex = index; });
 }
 
index 257607a..6f1ac9c 100755 (executable)
@@ -79,9 +79,7 @@ class OSBuildFetcher:
             kind = ord(match.group('kind').upper()) - ord('A')
             minor = int(match.group('minor'))
             variant = ord(match.group('variant').upper()) - ord('A') + 1 if match.group('variant') else 0
-            # These fake times won't conflict with real commit time since even 99Z9999z is still in Feb 1973
-            fake_time = datetime.utcfromtimestamp((major * 100 + kind) * 10000 + minor + float(variant) / 100)
-            commit['order'] = fake_time.isoformat()
+            commit['order'] = ((major * 100 + kind) * 10000 + minor) * 100 + variant
 
 
 def available_builds_from_command(repository_name, command, lines_to_ignore):
@@ -89,6 +87,7 @@ def available_builds_from_command(repository_name, command, lines_to_ignore):
         output = subprocess.check_output(command, stderr=subprocess.STDOUT)
     except subprocess.CalledProcessError as error:
         print "Failed:", str(error)
+        return []
 
     regex = re.compile(lines_to_ignore)
     return [{'repository': repository_name, 'revision': line} for line in output.split('\n') if not regex.match(line)]